@zayne-labs/ui-react 0.10.38 → 0.10.39

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.
@@ -1,8 +1,8 @@
1
- import { a as ErrorBoundaryProps } from "../../index-6DfF1UEM.js";
2
- import { n as SuspenseWithBoundaryProps } from "../../index-CSxj6Lp1.js";
1
+ import { a as ErrorBoundaryProps } from "../../index-DYKwNSzB.js";
2
+ import { n as SuspenseWithBoundaryProps } from "../../index-BpohqQE-.js";
3
3
  import { GetSlotComponentProps } from "@zayne-labs/toolkit-react/utils";
4
- import * as react32 from "react";
5
- import * as react_jsx_runtime31 from "react/jsx-runtime";
4
+ import * as react38 from "react";
5
+ import * as react_jsx_runtime48 from "react/jsx-runtime";
6
6
 
7
7
  //#region src/components/common/await/await.d.ts
8
8
  type RenderPropFn<TValue> = (result: TValue) => React.ReactNode;
@@ -14,9 +14,9 @@ type AwaitRootProps<TValue> = Pick<SuspenseWithBoundaryProps, "errorFallback" |
14
14
  withErrorBoundary?: boolean;
15
15
  withSuspense?: boolean;
16
16
  };
17
- declare function AwaitRoot<TValue>(props: AwaitRootProps<TValue>): react_jsx_runtime31.JSX.Element;
17
+ declare function AwaitRoot<TValue>(props: AwaitRootProps<TValue>): react_jsx_runtime48.JSX.Element;
18
18
  type AwaitSuccessProps<TValue = unknown> = GetSlotComponentProps<"default", ChildrenType<TValue>>;
19
- declare function AwaitSuccess<TPromiseOrValue, TValue = Awaited<TPromiseOrValue>>(props: Pick<AwaitSuccessProps<TValue>, "children">): react32.ReactNode;
19
+ declare function AwaitSuccess<TPromiseOrValue, TValue = Awaited<TPromiseOrValue>>(props: Pick<AwaitSuccessProps<TValue>, "children">): react38.ReactNode;
20
20
  type AwaitErrorProps = GetSlotComponentProps<"error", ErrorBoundaryProps["fallback"]>;
21
21
  declare const AwaitError: {
22
22
  (props: Pick<AwaitErrorProps, "children"> & {
@@ -1,4 +1,4 @@
1
- import * as react27 from "react";
1
+ import * as react13 from "react";
2
2
 
3
3
  //#region src/components/common/client-gate/client-gate.d.ts
4
4
  type ClientGateProps = {
@@ -27,7 +27,7 @@ type ClientGateProps = {
27
27
  * );
28
28
  * ```
29
29
  */
30
- declare function ClientGate(props: ClientGateProps): react27.ReactNode;
30
+ declare function ClientGate(props: ClientGateProps): react13.ReactNode;
31
31
  //#endregion
32
32
  export { ClientGate };
33
33
  //# sourceMappingURL=index.d.ts.map
@@ -1,2 +1,2 @@
1
- import { a as ErrorBoundaryProps, i as ErrorBoundary, n as ErrorBoundaryContextType, o as FallbackProps, r as useErrorBoundaryContext, t as useErrorBoundary } from "../../index-6DfF1UEM.js";
1
+ import { a as ErrorBoundaryProps, i as ErrorBoundary, n as ErrorBoundaryContextType, o as FallbackProps, r as useErrorBoundaryContext, t as useErrorBoundary } from "../../index-DYKwNSzB.js";
2
2
  export { ErrorBoundary, ErrorBoundaryContextType, ErrorBoundaryProps, FallbackProps, useErrorBoundary, useErrorBoundaryContext };
@@ -1,7 +1,7 @@
1
1
  import { DiscriminatedRenderItemProps, PolymorphicPropsStrict } from "@zayne-labs/toolkit-react/utils";
2
2
  import { Prettify } from "@zayne-labs/toolkit-type-helpers";
3
- import * as react4 from "react";
4
- import * as react_jsx_runtime12 from "react/jsx-runtime";
3
+ import * as react26 from "react";
4
+ import * as react_jsx_runtime47 from "react/jsx-runtime";
5
5
 
6
6
  //#region src/components/common/for/for.d.ts
7
7
  type ArrayOrNumber = number | readonly unknown[];
@@ -12,10 +12,10 @@ type ForProps<TArray extends ArrayOrNumber> = Prettify<{
12
12
  each: TArray;
13
13
  fallback?: React.ReactNode;
14
14
  } & ForRenderProps<TArray>>;
15
- declare function For<const TArray extends ArrayOrNumber>(props: ForProps<TArray>): string | number | bigint | boolean | react4.ReactElement<unknown, string | react4.JSXElementConstructor<any>> | Iterable<react4.ReactNode> | Promise<string | number | bigint | boolean | react4.ReactPortal | react4.ReactElement<unknown, string | react4.JSXElementConstructor<any>> | Iterable<react4.ReactNode> | null | undefined> | null;
15
+ declare function For<const TArray extends ArrayOrNumber>(props: ForProps<TArray>): string | number | bigint | boolean | react26.ReactElement<unknown, string | react26.JSXElementConstructor<any>> | Iterable<react26.ReactNode> | Promise<string | number | bigint | boolean | react26.ReactPortal | react26.ReactElement<unknown, string | react26.JSXElementConstructor<any>> | Iterable<react26.ReactNode> | null | undefined> | null;
16
16
  declare function ForWithWrapper<const TArray extends ArrayOrNumber, TElement extends React.ElementType = "ul">(props: PolymorphicPropsStrict<TElement, ForProps<TArray>> & {
17
17
  displayFallBackWhenEmpty?: boolean;
18
- }): string | number | bigint | boolean | react_jsx_runtime12.JSX.Element | Iterable<react4.ReactNode> | Promise<string | number | bigint | boolean | react4.ReactPortal | react4.ReactElement<unknown, string | react4.JSXElementConstructor<any>> | Iterable<react4.ReactNode> | null | undefined> | null;
18
+ }): string | number | bigint | boolean | react_jsx_runtime47.JSX.Element | Iterable<react26.ReactNode> | Promise<string | number | bigint | boolean | react26.ReactPortal | react26.ReactElement<unknown, string | react26.JSXElementConstructor<any>> | Iterable<react26.ReactNode> | null | undefined> | null;
19
19
  //#endregion
20
20
  //#region src/components/common/for/getElementList.d.ts
21
21
  type GetElementListResult<TVariant extends "base" | "withWrapper"> = TVariant extends "base" ? [typeof For] : [typeof ForWithWrapper];
@@ -1,5 +1,5 @@
1
1
  import { InferProps } from "@zayne-labs/toolkit-react/utils";
2
- import * as react_jsx_runtime30 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/components/common/presence/use-presence.d.ts
5
5
  type UsePresenceOptions = {
@@ -30,7 +30,7 @@ type PresenceProps = UsePresenceOptions & {
30
30
  className?: string;
31
31
  forceMount?: boolean;
32
32
  };
33
- declare function Presence(props: PresenceProps): react_jsx_runtime30.JSX.Element | null;
33
+ declare function Presence(props: PresenceProps): react_jsx_runtime0.JSX.Element | null;
34
34
  //#endregion
35
35
  export { Presence };
36
36
  //# sourceMappingURL=index.d.ts.map
@@ -1,6 +1,5 @@
1
1
  "use client";
2
2
 
3
- import "../../slot--lEkrAQf.js";
4
- import { t as Presence } from "../../presence-C2VQITU0.js";
3
+ import { t as Presence } from "../../presence-DNwNWipt.js";
5
4
 
6
5
  export { Presence };
@@ -1,4 +1,4 @@
1
- import * as react18 from "react";
1
+ import * as react4 from "react";
2
2
 
3
3
  //#region src/components/common/show/show.d.ts
4
4
  type ShowProps<TWhen> = {
@@ -12,15 +12,15 @@ type ShowProps<TWhen> = {
12
12
  fallback?: React.ReactNode;
13
13
  when: false | TWhen | null | undefined;
14
14
  };
15
- declare function ShowRoot<TWhen>(props: ShowProps<TWhen>): string | number | bigint | boolean | react18.ReactElement<unknown, string | react18.JSXElementConstructor<any>> | Iterable<react18.ReactNode> | Promise<string | number | bigint | boolean | react18.ReactPortal | react18.ReactElement<unknown, string | react18.JSXElementConstructor<any>> | Iterable<react18.ReactNode> | null | undefined> | null;
15
+ declare function ShowRoot<TWhen>(props: ShowProps<TWhen>): string | number | bigint | boolean | react4.ReactElement<unknown, string | react4.JSXElementConstructor<any>> | Iterable<react4.ReactNode> | Promise<string | number | bigint | boolean | react4.ReactPortal | react4.ReactElement<unknown, string | react4.JSXElementConstructor<any>> | Iterable<react4.ReactNode> | null | undefined> | null;
16
16
  type ShowContentProps<TWhen> = Pick<ShowProps<TWhen>, "children" | "when">;
17
- declare function ShowContent<TWhen>(props: ShowContentProps<TWhen>): react18.ReactNode;
17
+ declare function ShowContent<TWhen>(props: ShowContentProps<TWhen>): react4.ReactNode;
18
18
  declare namespace ShowContent {
19
19
  var slotSymbol: symbol;
20
20
  }
21
21
  declare function ShowFallback(props: {
22
22
  children: React.ReactNode;
23
- }): react18.ReactNode;
23
+ }): react4.ReactNode;
24
24
  declare namespace ShowFallback {
25
25
  var slotSymbol: symbol;
26
26
  }
@@ -1,15 +1,15 @@
1
1
  import { InferProps } from "@zayne-labs/toolkit-react/utils";
2
- import * as react17 from "react";
3
- import * as react_jsx_runtime28 from "react/jsx-runtime";
2
+ import * as react3 from "react";
3
+ import * as react_jsx_runtime1 from "react/jsx-runtime";
4
4
 
5
5
  //#region src/components/common/slot/slot.d.ts
6
6
  type SlotProps = InferProps<HTMLElement> & {
7
7
  ref?: React.Ref<HTMLElement>;
8
8
  };
9
- declare function SlotRoot(props: SlotProps): react_jsx_runtime28.JSX.Element | null;
9
+ declare function SlotRoot(props: SlotProps): react_jsx_runtime1.JSX.Element | null;
10
10
  declare function SlotSlottable({
11
11
  children
12
- }: Pick<SlotProps, "children">): react17.ReactNode;
12
+ }: Pick<SlotProps, "children">): react3.ReactNode;
13
13
  declare namespace slot_parts_d_exports {
14
14
  export { SlotRoot as Root, SlotSlottable as Slottable };
15
15
  }
@@ -1,3 +1,3 @@
1
- import "../../index-6DfF1UEM.js";
2
- import { n as SuspenseWithBoundaryProps, t as SuspenseWithBoundary } from "../../index-CSxj6Lp1.js";
1
+ import "../../index-DYKwNSzB.js";
2
+ import { n as SuspenseWithBoundaryProps, t as SuspenseWithBoundary } from "../../index-BpohqQE-.js";
3
3
  export { SuspenseWithBoundary, SuspenseWithBoundaryProps };
@@ -1,4 +1,4 @@
1
- import * as react28 from "react";
1
+ import * as react0 from "react";
2
2
 
3
3
  //#region src/components/common/switch/switch.d.ts
4
4
  type ValidSwitchComponentType = React.ReactElement<SwitchMatchProps<unknown>>;
@@ -6,17 +6,17 @@ type SwitchProps = {
6
6
  children: ValidSwitchComponentType | ValidSwitchComponentType[];
7
7
  value?: unknown;
8
8
  };
9
- declare function SwitchRoot(props: SwitchProps): react28.ReactNode;
9
+ declare function SwitchRoot(props: SwitchProps): react0.ReactNode;
10
10
  type SwitchMatchProps<TWhen> = {
11
11
  children: React.ReactNode | ((value: TWhen) => React.ReactNode);
12
12
  when: false | TWhen | null | undefined;
13
13
  };
14
- declare function SwitchMatch<TWhen>(props: SwitchMatchProps<TWhen>): react28.ReactNode;
14
+ declare function SwitchMatch<TWhen>(props: SwitchMatchProps<TWhen>): react0.ReactNode;
15
15
  declare function SwitchDefault({
16
16
  children
17
17
  }: {
18
18
  children: React.ReactNode;
19
- }): react28.ReactNode;
19
+ }): react0.ReactNode;
20
20
  declare namespace SwitchDefault {
21
21
  var slotSymbol: symbol;
22
22
  }
@@ -1,5 +1,5 @@
1
1
  import { AnyString } from "@zayne-labs/toolkit-type-helpers";
2
- import * as react16 from "react";
2
+ import * as react0 from "react";
3
3
 
4
4
  //#region src/components/common/teleport/teleport.d.ts
5
5
  type ValidHtmlTags = keyof HTMLElementTagNameMap;
@@ -8,7 +8,7 @@ type PortalProps = {
8
8
  insertPosition?: InsertPosition;
9
9
  to: AnyString | HTMLElement | ValidHtmlTags | null;
10
10
  };
11
- declare function Teleport(props: PortalProps): react16.ReactPortal | null;
11
+ declare function Teleport(props: PortalProps): react0.ReactPortal | null;
12
12
  //#endregion
13
13
  export { Teleport };
14
14
  //# sourceMappingURL=index.d.ts.map
@@ -1,4 +1,4 @@
1
- import { a as ErrorBoundaryProps } from "./index-6DfF1UEM.js";
1
+ import { a as ErrorBoundaryProps } from "./index-DYKwNSzB.js";
2
2
  import * as react_jsx_runtime0 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/components/common/suspense-with-boundary/suspense-with-boundary.d.ts
@@ -10,4 +10,4 @@ type SuspenseWithBoundaryProps = {
10
10
  declare function SuspenseWithBoundary(props: SuspenseWithBoundaryProps): react_jsx_runtime0.JSX.Element;
11
11
  //#endregion
12
12
  export { SuspenseWithBoundaryProps as n, SuspenseWithBoundary as t };
13
- //# sourceMappingURL=index-CSxj6Lp1.d.ts.map
13
+ //# sourceMappingURL=index-BpohqQE-.d.ts.map
@@ -1,7 +1,7 @@
1
- import * as react31 from "react";
1
+ import * as react14 from "react";
2
2
  import { Component } from "react";
3
- import * as _zayne_labs_toolkit_react1 from "@zayne-labs/toolkit-react";
4
- import * as react_jsx_runtime29 from "react/jsx-runtime";
3
+ import * as _zayne_labs_toolkit_react0 from "@zayne-labs/toolkit-react";
4
+ import * as react_jsx_runtime10 from "react/jsx-runtime";
5
5
 
6
6
  //#region src/components/common/error-boundary/types.d.ts
7
7
  type FallbackProps = {
@@ -49,7 +49,7 @@ declare class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryS
49
49
  };
50
50
  componentDidCatch(error: Error, info: React.ErrorInfo): void;
51
51
  componentDidUpdate(prevProps: ErrorBoundaryProps, prevState: ErrorBoundaryState): void;
52
- render(): react_jsx_runtime29.JSX.Element;
52
+ render(): react_jsx_runtime10.JSX.Element;
53
53
  }
54
54
  //#endregion
55
55
  //#region src/components/common/error-boundary/error-boundary-context.d.ts
@@ -58,7 +58,7 @@ type ErrorBoundaryContextType = {
58
58
  hasError: boolean;
59
59
  resetErrorBoundary: (...args: unknown[]) => void;
60
60
  };
61
- declare const ErrorBoundaryContext: react31.Context<ErrorBoundaryContextType>, useErrorBoundaryContext: _zayne_labs_toolkit_react1.UseCustomContext<ErrorBoundaryContextType, true>;
61
+ declare const ErrorBoundaryContext: react14.Context<ErrorBoundaryContextType>, useErrorBoundaryContext: _zayne_labs_toolkit_react0.UseCustomContext<ErrorBoundaryContextType, true>;
62
62
  //#endregion
63
63
  //#region src/components/common/error-boundary/useErrorBoundary.d.ts
64
64
  declare const useErrorBoundary: <TError extends Error>() => {
@@ -67,4 +67,4 @@ declare const useErrorBoundary: <TError extends Error>() => {
67
67
  };
68
68
  //#endregion
69
69
  export { ErrorBoundaryProps as a, ErrorBoundary as i, ErrorBoundaryContextType as n, FallbackProps as o, useErrorBoundaryContext as r, useErrorBoundary as t };
70
- //# sourceMappingURL=index-6DfF1UEM.d.ts.map
70
+ //# sourceMappingURL=index-DYKwNSzB.d.ts.map
@@ -134,7 +134,7 @@ const usePresence = (options) => {
134
134
  useEffect(() => {
135
135
  if (state === "unmounted" && !presentProp) {
136
136
  toggleHasTransitioned(false);
137
- stableOnExitComplete();
137
+ stableOnExitComplete?.();
138
138
  }
139
139
  }, [
140
140
  state,
@@ -208,4 +208,4 @@ function Presence(props) {
208
208
 
209
209
  //#endregion
210
210
  export { Presence as t };
211
- //# sourceMappingURL=presence-C2VQITU0.js.map
211
+ //# sourceMappingURL=presence-DNwNWipt.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"presence-C2VQITU0.js","names":["timeoutId: number","getPresenceProps: UsePresenceResult[\"propGetters\"][\"getPresenceProps\"]","Slot.Root"],"sources":["../../src/components/common/presence/use-presence.ts","../../src/components/common/presence/presence.tsx"],"sourcesContent":["import { dataAttr, on } from \"@zayne-labs/toolkit-core\";\nimport { useCallbackRef, useToggle } from \"@zayne-labs/toolkit-react\";\nimport type { InferProps } from \"@zayne-labs/toolkit-react/utils\";\nimport { useCallback, useEffect, useLayoutEffect, useMemo, useReducer, useRef, useState } from \"react\";\n\ntype StateMachineConfig<TState extends string, TEvent extends string> = {\n\tinitial: TState;\n\tstates: Record<TState, Partial<Record<TEvent, TState>>>;\n};\n\nconst useStateMachine = <TState extends string, TEvent extends string>(\n\tconfig: StateMachineConfig<TState, TEvent>\n) => {\n\tconst reducer = (prevState: TState, event: TEvent): TState => {\n\t\tconst newState = config.states[prevState][event] ?? prevState;\n\n\t\treturn newState;\n\t};\n\n\treturn useReducer(reducer, config.initial);\n};\n\nconst getAnimationName = (styles: CSSStyleDeclaration | null) => styles?.animationName ?? \"none\";\n\nexport type UsePresenceOptions = {\n\tonExitComplete?: () => void;\n\tpresent: boolean;\n\t/**\n\t * @default \"animation\"\n\t */\n\tvariant?: \"animation\" | \"transition\";\n};\n\nexport type UsePresenceResult = {\n\tisPresent: boolean;\n\tisPresentOrIsTransitionComplete: boolean;\n\tpropGetters: {\n\t\tgetPresenceProps: (innerProps: InferProps<HTMLElement>) => InferProps<HTMLElement>;\n\t};\n\tref: React.Ref<HTMLElement>;\n\tshouldStartTransition: boolean;\n};\n\n/**\n * React hook that provides the ability to animate the mount/unmount of a component.\n * @see https://github.com/radix-ui/primitives/blob/main/packages/react/presence/src/presence.tsx\n */\n\nconst usePresence = (options: UsePresenceOptions): UsePresenceResult => {\n\tconst { onExitComplete, present: presentProp, variant = \"animation\" } = options;\n\n\tconst stableOnExitComplete = useCallbackRef(onExitComplete);\n\n\tconst [node, setNode] = useState<HTMLElement | null>(null);\n\n\tconst [hasTransitioned, toggleHasTransitioned] = useToggle(false);\n\n\tconst stylesRef = useRef<CSSStyleDeclaration | null>(null);\n\n\tconst prevNodeStateRef = useRef<{\n\t\tprevAnimationName: string;\n\t\tprevPresent: boolean;\n\t}>({\n\t\tprevAnimationName: \"none\",\n\t\tprevPresent: presentProp,\n\t});\n\n\tconst initialState = presentProp ? \"mounted\" : \"unmounted\";\n\n\tconst [state, send] = useStateMachine({\n\t\tinitial: initialState,\n\t\tstates: {\n\t\t\tmounted: {\n\t\t\t\tANIMATION_OUT: \"unmountSuspended\",\n\t\t\t\tUNMOUNT: \"unmounted\",\n\t\t\t},\n\t\t\tunmounted: {\n\t\t\t\tMOUNT: \"mounted\",\n\t\t\t},\n\t\t\tunmountSuspended: {\n\t\t\t\tANIMATION_END: \"unmounted\",\n\t\t\t\tMOUNT: \"mounted\",\n\t\t\t},\n\t\t},\n\t});\n\n\tuseEffect(() => {\n\t\tconst currentAnimationName = getAnimationName(stylesRef.current);\n\n\t\tprevNodeStateRef.current.prevAnimationName = state === \"mounted\" ? currentAnimationName : \"none\";\n\t}, [state]);\n\n\tuseLayoutEffect(() => {\n\t\tconst styles = stylesRef.current;\n\t\tconst wasPresent = prevNodeStateRef.current.prevPresent;\n\t\tconst hasPresentChanged = wasPresent !== presentProp;\n\n\t\tif (!hasPresentChanged) return;\n\n\t\tconst prevAnimationName = prevNodeStateRef.current.prevAnimationName;\n\t\tconst currentAnimationName = getAnimationName(styles);\n\n\t\tswitch (true) {\n\t\t\tcase presentProp: {\n\t\t\t\tsend(\"MOUNT\");\n\n\t\t\t\tif (variant === \"transition\") {\n\t\t\t\t\trequestAnimationFrame(() => toggleHasTransitioned(true));\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcase Boolean(node) && variant === \"animation\": {\n\t\t\t\tconst hasAnimation = currentAnimationName !== \"none\" && styles?.display !== \"none\";\n\n\t\t\t\t/**\n\t\t\t\t * When `present` changes to `false`, we check changes to animation-name to\n\t\t\t\t * determine whether an animation has started. We chose this approach (reading\n\t\t\t\t * computed styles) because there is no `animationrun` event (like the `transitionrun` event) and `animationstart`\n\t\t\t\t * fires after `animation-delay` has expired which would be too late.\n\t\t\t\t */\n\n\t\t\t\tconst isAnimationStarted = hasAnimation && prevAnimationName !== currentAnimationName;\n\n\t\t\t\tconst isAnimatingOut = wasPresent && isAnimationStarted;\n\n\t\t\t\tsend(isAnimatingOut ? \"ANIMATION_OUT\" : \"UNMOUNT\");\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tdefault: {\n\t\t\t\tsend(\"UNMOUNT\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tprevNodeStateRef.current.prevPresent = presentProp;\n\t}, [presentProp, node, send, variant, toggleHasTransitioned]);\n\n\tuseLayoutEffect(() => {\n\t\tif (!node) {\n\t\t\t// Transition to the unmounted state if the node is removed prematurely.\n\t\t\t// We avoid doing so during cleanup as the node may change but still exist.\n\t\t\tsend(\"ANIMATION_END\");\n\t\t\treturn;\n\t\t}\n\n\t\tlet timeoutId: number;\n\n\t\tconst ownerWindow = node.ownerDocument.defaultView ?? globalThis;\n\n\t\tconst handleAnimationStart = (event: AnimationEvent) => {\n\t\t\tconst isTargetAnimatingNode = event.target === node;\n\n\t\t\tif (!isTargetAnimatingNode) return;\n\n\t\t\tprevNodeStateRef.current.prevAnimationName = getAnimationName(stylesRef.current);\n\t\t};\n\n\t\t/**\n\t\t * @description Triggering an ANIMATION_OUT during an ANIMATION_IN will fire an `animationcancel`\n\t\t * event for ANIMATION_IN after we have entered `unmountSuspended` state. So, we\n\t\t * make sure we only trigger ANIMATION_END for the currently active animation.\n\t\t */\n\t\tconst handleAnimationEnd = (event: AnimationEvent) => {\n\t\t\tconst currentAnimationName = getAnimationName(stylesRef.current);\n\n\t\t\t// The event.animationName is unescaped for CSS syntax, so we need to escape it to compare with the animationName computed from the style.\n\t\t\tconst isCurrentAnimation = currentAnimationName.includes(CSS.escape(event.animationName));\n\n\t\t\tconst isTargetAnimatingNode = event.target === node && isCurrentAnimation;\n\n\t\t\tif (!isTargetAnimatingNode) return;\n\n\t\t\t// With React 18 concurrency this update is applied a frame after the\n\t\t\t// animation ends, creating a flash of visible content. By setting the\n\t\t\t// animation fill mode to \"forwards\", we force the node to keep the\n\t\t\t// styles of the last keyframe, removing the flash.\n\n\t\t\t// Previously we flushed the update via ReactDom.flushSync, but with\n\t\t\t// exit animations this resulted in the node being removed from the\n\t\t\t// DOM before the synthetic animationEnd event was dispatched, meaning\n\t\t\t// user-provided event handlers would not be called.\n\t\t\t// https://github.com/radix-ui/primitives/pull/1849\n\t\t\tsend(\"ANIMATION_END\");\n\n\t\t\tif (!prevNodeStateRef.current.prevPresent) {\n\t\t\t\tconst currentFillMode = node.style.animationFillMode;\n\t\t\t\tnode.style.animationFillMode = \"forwards\";\n\n\t\t\t\t// Reset the style after the node had time to unmount (for cases\n\t\t\t\t// where the component chooses not to unmount). Doing this any\n\t\t\t\t// sooner than `setTimeout` (e.g. with `requestAnimationFrame`)\n\t\t\t\t// still causes a flash.\n\t\t\t\ttimeoutId = ownerWindow.setTimeout(() => {\n\t\t\t\t\tif (node.style.animationFillMode === \"forwards\") {\n\t\t\t\t\t\tnode.style.animationFillMode = currentFillMode;\n\t\t\t\t\t}\n\t\t\t\t}) as never;\n\t\t\t}\n\t\t};\n\n\t\tconst handleTransitionRun = (event: TransitionEvent) => {\n\t\t\tconst isTargetTransitioningNode = event.target === node;\n\n\t\t\tif (!isTargetTransitioningNode) return;\n\n\t\t\tsend(\"ANIMATION_OUT\");\n\t\t};\n\n\t\tconst handleTransitionEnd = (event: TransitionEvent) => {\n\t\t\tconst isTargetTransitioningNode = event.target === node && !prevNodeStateRef.current.prevPresent;\n\n\t\t\tif (!isTargetTransitioningNode) return;\n\n\t\t\tsend(\"ANIMATION_END\");\n\t\t};\n\n\t\tconst onAnimationStartCleanup = on(\"animationstart\", node, handleAnimationStart);\n\t\tconst onAnimationEndCleanup = on(\"animationend\", node, handleAnimationEnd);\n\t\tconst onAnimationCancelCleanup = on(\"animationcancel\", node, handleAnimationEnd);\n\n\t\tconst onTransitionRunCleanup = on(\"transitionrun\", node, handleTransitionRun);\n\t\tconst onTransitionEndCleanup = on(\"transitionend\", node, handleTransitionEnd);\n\t\tconst onTransitionCancelCleanup = on(\"transitioncancel\", node, handleTransitionEnd);\n\n\t\treturn () => {\n\t\t\townerWindow.clearTimeout(timeoutId);\n\t\t\tonAnimationStartCleanup();\n\t\t\tonAnimationEndCleanup();\n\t\t\tonAnimationCancelCleanup();\n\n\t\t\tonTransitionRunCleanup();\n\t\t\tonTransitionEndCleanup();\n\t\t\tonTransitionCancelCleanup();\n\t\t};\n\t}, [node, send]);\n\n\tuseEffect(() => {\n\t\tconst isExitCompleted = state === \"unmounted\" && !presentProp;\n\n\t\tif (isExitCompleted) {\n\t\t\ttoggleHasTransitioned(false);\n\t\t\tstableOnExitComplete();\n\t\t}\n\t}, [state, presentProp, stableOnExitComplete, toggleHasTransitioned]);\n\n\tconst ref = useCallbackRef((refNode: HTMLElement | null) => {\n\t\tsetNode(refNode);\n\n\t\tif (refNode) {\n\t\t\tstylesRef.current = getComputedStyle(refNode);\n\t\t}\n\t});\n\n\tconst MOUNTED_STATES = [\"mounted\", \"unmountSuspended\"] satisfies Array<typeof state>;\n\tconst isPresent = MOUNTED_STATES.includes(state);\n\tconst isPresentOrIsTransitionComplete = isPresent || hasTransitioned;\n\tconst shouldStartTransition = presentProp && hasTransitioned;\n\n\tconst getPresenceProps: UsePresenceResult[\"propGetters\"][\"getPresenceProps\"] = useCallback(\n\t\t(innerProps) => {\n\t\t\tconst transitionState = shouldStartTransition ? \"active\" : \"inactive\";\n\n\t\t\treturn {\n\t\t\t\t\"data-present\": dataAttr(isPresent),\n\t\t\t\t\"data-present-or-transition-complete\": dataAttr(isPresentOrIsTransitionComplete),\n\t\t\t\t\"data-state\": state,\n\t\t\t\t...(variant === \"transition\" && { \"data-transition\": transitionState }),\n\t\t\t\t...innerProps,\n\t\t\t\tclassName: innerProps.className,\n\t\t\t};\n\t\t},\n\t\t[isPresent, isPresentOrIsTransitionComplete, shouldStartTransition, state, variant]\n\t);\n\n\tconst propGetters = useMemo(() => ({ getPresenceProps }), [getPresenceProps]);\n\n\tconst result = useMemo<UsePresenceResult>(\n\t\t() =>\n\t\t\t({\n\t\t\t\tisPresent,\n\t\t\t\tisPresentOrIsTransitionComplete,\n\t\t\t\tpropGetters,\n\t\t\t\tref,\n\t\t\t\tshouldStartTransition,\n\t\t\t}) satisfies UsePresenceResult,\n\t\t[isPresent, isPresentOrIsTransitionComplete, propGetters, ref, shouldStartTransition]\n\t);\n\n\treturn result;\n};\n\nexport { usePresence };\n","\"use client\";\n\nimport { useComposeRefs } from \"@zayne-labs/toolkit-react\";\nimport { isFunction, type UnknownObject } from \"@zayne-labs/toolkit-type-helpers\";\n\nimport { Slot } from \"../slot\";\nimport { usePresence, type UsePresenceOptions, type UsePresenceResult } from \"./use-presence\";\n\ntype RefProp = { ref?: React.Ref<HTMLElement> };\n\ntype RenderPropContext = Omit<UsePresenceResult, \"propGetters\" | \"ref\">;\n\ntype PresenceProps = UsePresenceOptions & {\n\tchildren?: React.ReactElement<RefProp> | ((props: RenderPropContext) => React.ReactElement<RefProp>);\n\tclassName?: string;\n\tforceMount?: boolean;\n};\n\nfunction Presence(props: PresenceProps) {\n\tconst { children, className, forceMount = false, onExitComplete, present, variant } = props;\n\n\tconst {\n\t\tisPresent,\n\t\tisPresentOrIsTransitionComplete,\n\t\tpropGetters,\n\t\tref: presenceRef,\n\t\tshouldStartTransition,\n\t} = usePresence({ onExitComplete, present, variant });\n\n\tconst context = {\n\t\tisPresent,\n\t\tisPresentOrIsTransitionComplete,\n\t\tshouldStartTransition,\n\t} satisfies RenderPropContext;\n\n\tconst resolvedChild = isFunction(children) ? children(context) : children;\n\n\tconst childRef = (resolvedChild?.props.ref\n\t\t?? (resolvedChild as unknown as UnknownObject).ref) as React.Ref<HTMLElement>;\n\n\tconst ref = useComposeRefs(presenceRef, childRef);\n\n\tconst shouldRender =\n\t\tforceMount || (variant === \"transition\" ? isPresentOrIsTransitionComplete : isPresent);\n\n\tif (!shouldRender) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Slot.Root ref={ref} {...propGetters.getPresenceProps({ className })}>\n\t\t\t{resolvedChild}\n\t\t</Slot.Root>\n\t);\n}\n\nexport { Presence };\n"],"mappings":";;;;;;;;AAUA,MAAM,mBACL,WACI;CACJ,MAAM,WAAW,WAAmB,UAA0B;AAG7D,SAFiB,OAAO,OAAO,WAAW,UAAU;;AAKrD,QAAO,WAAW,SAAS,OAAO,QAAQ;;AAG3C,MAAM,oBAAoB,WAAuC,QAAQ,iBAAiB;;;;;AA0B1F,MAAM,eAAe,YAAmD;CACvE,MAAM,EAAE,gBAAgB,SAAS,aAAa,UAAU,gBAAgB;CAExE,MAAM,uBAAuB,eAAe,eAAe;CAE3D,MAAM,CAAC,MAAM,WAAW,SAA6B,KAAK;CAE1D,MAAM,CAAC,iBAAiB,yBAAyB,UAAU,MAAM;CAEjE,MAAM,YAAY,OAAmC,KAAK;CAE1D,MAAM,mBAAmB,OAGtB;EACF,mBAAmB;EACnB,aAAa;EACb,CAAC;CAIF,MAAM,CAAC,OAAO,QAAQ,gBAAgB;EACrC,SAHoB,cAAc,YAAY;EAI9C,QAAQ;GACP,SAAS;IACR,eAAe;IACf,SAAS;IACT;GACD,WAAW,EACV,OAAO,WACP;GACD,kBAAkB;IACjB,eAAe;IACf,OAAO;IACP;GACD;EACD,CAAC;AAEF,iBAAgB;EACf,MAAM,uBAAuB,iBAAiB,UAAU,QAAQ;AAEhE,mBAAiB,QAAQ,oBAAoB,UAAU,YAAY,uBAAuB;IACxF,CAAC,MAAM,CAAC;AAEX,uB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AO;EAAQ,CACnF;CAED,MAAM,cAAc,eAAe,EAAE,kBAAkB,GAAG,CAAC,iBAAiB,CAAC;AAc7E,QAZe,eAEZ;EACA;EACA;EACA;EACA;EACA;EACA,GACF;EAAC;EAAW;EAAiC;EAAa;EAAK;EAAsB,CACrF;;;;;AC9QF,SAAS,SAAS,OAAsB;CACvC,MAAM,EAAE,UAAU,WAAW,aAAa,OAAO,gBAAgB,SAAS,YAAY;CAEtF,MAAM,EACL,WACA,iCACA,aACA,KAAK,aACL,0BACG,YAAY;EAAE;EAAgB;EAAS;EAAS,CAAC;CAErD,MAAM,UAAU;EACf;EACA;EACA;EACA;CAED,MAAM,gBAAgB,WAAW,SAAS,GAAG,SAAS,QAAQ,GAAG;CAKjE,MAAM,MAAM,eAAe,aAHT,eAAe,MAAM,OAClC,cAA2C,IAEC;AAKjD,KAAI,EAFH,eAAe,YAAY,eAAe,kCAAkC,YAG5E,QAAO;AAGR,QACC,oBAACC;EAAe;EAAK,GAAI,YAAY,iBAAiB,EAAE,WAAW,CAAC;YAClE;GACU"}
1
+ {"version":3,"file":"presence-DNwNWipt.js","names":["timeoutId: number","getPresenceProps: UsePresenceResult[\"propGetters\"][\"getPresenceProps\"]","Slot.Root"],"sources":["../../src/components/common/presence/use-presence.ts","../../src/components/common/presence/presence.tsx"],"sourcesContent":["import { dataAttr, on } from \"@zayne-labs/toolkit-core\";\nimport { useCallbackRef, useToggle } from \"@zayne-labs/toolkit-react\";\nimport type { InferProps } from \"@zayne-labs/toolkit-react/utils\";\nimport { useCallback, useEffect, useLayoutEffect, useMemo, useReducer, useRef, useState } from \"react\";\n\ntype StateMachineConfig<TState extends string, TEvent extends string> = {\n\tinitial: TState;\n\tstates: Record<TState, Partial<Record<TEvent, TState>>>;\n};\n\nconst useStateMachine = <TState extends string, TEvent extends string>(\n\tconfig: StateMachineConfig<TState, TEvent>\n) => {\n\tconst reducer = (prevState: TState, event: TEvent): TState => {\n\t\tconst newState = config.states[prevState][event] ?? prevState;\n\n\t\treturn newState;\n\t};\n\n\treturn useReducer(reducer, config.initial);\n};\n\nconst getAnimationName = (styles: CSSStyleDeclaration | null) => styles?.animationName ?? \"none\";\n\nexport type UsePresenceOptions = {\n\tonExitComplete?: () => void;\n\tpresent: boolean;\n\t/**\n\t * @default \"animation\"\n\t */\n\tvariant?: \"animation\" | \"transition\";\n};\n\nexport type UsePresenceResult = {\n\tisPresent: boolean;\n\tisPresentOrIsTransitionComplete: boolean;\n\tpropGetters: {\n\t\tgetPresenceProps: (innerProps: InferProps<HTMLElement>) => InferProps<HTMLElement>;\n\t};\n\tref: React.Ref<HTMLElement>;\n\tshouldStartTransition: boolean;\n};\n\n/**\n * React hook that provides the ability to animate the mount/unmount of a component.\n * @see https://github.com/radix-ui/primitives/blob/main/packages/react/presence/src/presence.tsx\n */\n\nconst usePresence = (options: UsePresenceOptions): UsePresenceResult => {\n\tconst { onExitComplete, present: presentProp, variant = \"animation\" } = options;\n\n\tconst stableOnExitComplete = useCallbackRef(onExitComplete);\n\n\tconst [node, setNode] = useState<HTMLElement | null>(null);\n\n\tconst [hasTransitioned, toggleHasTransitioned] = useToggle(false);\n\n\tconst stylesRef = useRef<CSSStyleDeclaration | null>(null);\n\n\tconst prevNodeStateRef = useRef<{\n\t\tprevAnimationName: string;\n\t\tprevPresent: boolean;\n\t}>({\n\t\tprevAnimationName: \"none\",\n\t\tprevPresent: presentProp,\n\t});\n\n\tconst initialState = presentProp ? \"mounted\" : \"unmounted\";\n\n\tconst [state, send] = useStateMachine({\n\t\tinitial: initialState,\n\t\tstates: {\n\t\t\tmounted: {\n\t\t\t\tANIMATION_OUT: \"unmountSuspended\",\n\t\t\t\tUNMOUNT: \"unmounted\",\n\t\t\t},\n\t\t\tunmounted: {\n\t\t\t\tMOUNT: \"mounted\",\n\t\t\t},\n\t\t\tunmountSuspended: {\n\t\t\t\tANIMATION_END: \"unmounted\",\n\t\t\t\tMOUNT: \"mounted\",\n\t\t\t},\n\t\t},\n\t});\n\n\tuseEffect(() => {\n\t\tconst currentAnimationName = getAnimationName(stylesRef.current);\n\n\t\tprevNodeStateRef.current.prevAnimationName = state === \"mounted\" ? currentAnimationName : \"none\";\n\t}, [state]);\n\n\tuseLayoutEffect(() => {\n\t\tconst styles = stylesRef.current;\n\t\tconst wasPresent = prevNodeStateRef.current.prevPresent;\n\t\tconst hasPresentChanged = wasPresent !== presentProp;\n\n\t\tif (!hasPresentChanged) return;\n\n\t\tconst prevAnimationName = prevNodeStateRef.current.prevAnimationName;\n\t\tconst currentAnimationName = getAnimationName(styles);\n\n\t\tswitch (true) {\n\t\t\tcase presentProp: {\n\t\t\t\tsend(\"MOUNT\");\n\n\t\t\t\tif (variant === \"transition\") {\n\t\t\t\t\trequestAnimationFrame(() => toggleHasTransitioned(true));\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcase Boolean(node) && variant === \"animation\": {\n\t\t\t\tconst hasAnimation = currentAnimationName !== \"none\" && styles?.display !== \"none\";\n\n\t\t\t\t/**\n\t\t\t\t * When `present` changes to `false`, we check changes to animation-name to\n\t\t\t\t * determine whether an animation has started. We chose this approach (reading\n\t\t\t\t * computed styles) because there is no `animationrun` event (like the `transitionrun` event) and `animationstart`\n\t\t\t\t * fires after `animation-delay` has expired which would be too late.\n\t\t\t\t */\n\n\t\t\t\tconst isAnimationStarted = hasAnimation && prevAnimationName !== currentAnimationName;\n\n\t\t\t\tconst isAnimatingOut = wasPresent && isAnimationStarted;\n\n\t\t\t\tsend(isAnimatingOut ? \"ANIMATION_OUT\" : \"UNMOUNT\");\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tdefault: {\n\t\t\t\tsend(\"UNMOUNT\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tprevNodeStateRef.current.prevPresent = presentProp;\n\t}, [presentProp, node, send, variant, toggleHasTransitioned]);\n\n\tuseLayoutEffect(() => {\n\t\tif (!node) {\n\t\t\t// Transition to the unmounted state if the node is removed prematurely.\n\t\t\t// We avoid doing so during cleanup as the node may change but still exist.\n\t\t\tsend(\"ANIMATION_END\");\n\t\t\treturn;\n\t\t}\n\n\t\tlet timeoutId: number;\n\n\t\tconst ownerWindow = node.ownerDocument.defaultView ?? globalThis;\n\n\t\tconst handleAnimationStart = (event: AnimationEvent) => {\n\t\t\tconst isTargetAnimatingNode = event.target === node;\n\n\t\t\tif (!isTargetAnimatingNode) return;\n\n\t\t\tprevNodeStateRef.current.prevAnimationName = getAnimationName(stylesRef.current);\n\t\t};\n\n\t\t/**\n\t\t * @description Triggering an ANIMATION_OUT during an ANIMATION_IN will fire an `animationcancel`\n\t\t * event for ANIMATION_IN after we have entered `unmountSuspended` state. So, we\n\t\t * make sure we only trigger ANIMATION_END for the currently active animation.\n\t\t */\n\t\tconst handleAnimationEnd = (event: AnimationEvent) => {\n\t\t\tconst currentAnimationName = getAnimationName(stylesRef.current);\n\n\t\t\t// The event.animationName is unescaped for CSS syntax, so we need to escape it to compare with the animationName computed from the style.\n\t\t\tconst isCurrentAnimation = currentAnimationName.includes(CSS.escape(event.animationName));\n\n\t\t\tconst isTargetAnimatingNode = event.target === node && isCurrentAnimation;\n\n\t\t\tif (!isTargetAnimatingNode) return;\n\n\t\t\t// With React 18 concurrency this update is applied a frame after the\n\t\t\t// animation ends, creating a flash of visible content. By setting the\n\t\t\t// animation fill mode to \"forwards\", we force the node to keep the\n\t\t\t// styles of the last keyframe, removing the flash.\n\n\t\t\t// Previously we flushed the update via ReactDom.flushSync, but with\n\t\t\t// exit animations this resulted in the node being removed from the\n\t\t\t// DOM before the synthetic animationEnd event was dispatched, meaning\n\t\t\t// user-provided event handlers would not be called.\n\t\t\t// https://github.com/radix-ui/primitives/pull/1849\n\t\t\tsend(\"ANIMATION_END\");\n\n\t\t\tif (!prevNodeStateRef.current.prevPresent) {\n\t\t\t\tconst currentFillMode = node.style.animationFillMode;\n\t\t\t\tnode.style.animationFillMode = \"forwards\";\n\n\t\t\t\t// Reset the style after the node had time to unmount (for cases\n\t\t\t\t// where the component chooses not to unmount). Doing this any\n\t\t\t\t// sooner than `setTimeout` (e.g. with `requestAnimationFrame`)\n\t\t\t\t// still causes a flash.\n\t\t\t\ttimeoutId = ownerWindow.setTimeout(() => {\n\t\t\t\t\tif (node.style.animationFillMode === \"forwards\") {\n\t\t\t\t\t\tnode.style.animationFillMode = currentFillMode;\n\t\t\t\t\t}\n\t\t\t\t}) as never;\n\t\t\t}\n\t\t};\n\n\t\tconst handleTransitionRun = (event: TransitionEvent) => {\n\t\t\tconst isTargetTransitioningNode = event.target === node;\n\n\t\t\tif (!isTargetTransitioningNode) return;\n\n\t\t\tsend(\"ANIMATION_OUT\");\n\t\t};\n\n\t\tconst handleTransitionEnd = (event: TransitionEvent) => {\n\t\t\tconst isTargetTransitioningNode = event.target === node && !prevNodeStateRef.current.prevPresent;\n\n\t\t\tif (!isTargetTransitioningNode) return;\n\n\t\t\tsend(\"ANIMATION_END\");\n\t\t};\n\n\t\tconst onAnimationStartCleanup = on(\"animationstart\", node, handleAnimationStart);\n\t\tconst onAnimationEndCleanup = on(\"animationend\", node, handleAnimationEnd);\n\t\tconst onAnimationCancelCleanup = on(\"animationcancel\", node, handleAnimationEnd);\n\n\t\tconst onTransitionRunCleanup = on(\"transitionrun\", node, handleTransitionRun);\n\t\tconst onTransitionEndCleanup = on(\"transitionend\", node, handleTransitionEnd);\n\t\tconst onTransitionCancelCleanup = on(\"transitioncancel\", node, handleTransitionEnd);\n\n\t\treturn () => {\n\t\t\townerWindow.clearTimeout(timeoutId);\n\t\t\tonAnimationStartCleanup();\n\t\t\tonAnimationEndCleanup();\n\t\t\tonAnimationCancelCleanup();\n\n\t\t\tonTransitionRunCleanup();\n\t\t\tonTransitionEndCleanup();\n\t\t\tonTransitionCancelCleanup();\n\t\t};\n\t}, [node, send]);\n\n\tuseEffect(() => {\n\t\tconst isExitCompleted = state === \"unmounted\" && !presentProp;\n\n\t\tif (isExitCompleted) {\n\t\t\ttoggleHasTransitioned(false);\n\t\t\tstableOnExitComplete?.();\n\t\t}\n\t}, [state, presentProp, stableOnExitComplete, toggleHasTransitioned]);\n\n\tconst ref = useCallbackRef((refNode: HTMLElement | null) => {\n\t\tsetNode(refNode);\n\n\t\tif (refNode) {\n\t\t\tstylesRef.current = getComputedStyle(refNode);\n\t\t}\n\t});\n\n\tconst MOUNTED_STATES = [\"mounted\", \"unmountSuspended\"] satisfies Array<typeof state>;\n\tconst isPresent = MOUNTED_STATES.includes(state);\n\tconst isPresentOrIsTransitionComplete = isPresent || hasTransitioned;\n\tconst shouldStartTransition = presentProp && hasTransitioned;\n\n\tconst getPresenceProps: UsePresenceResult[\"propGetters\"][\"getPresenceProps\"] = useCallback(\n\t\t(innerProps) => {\n\t\t\tconst transitionState = shouldStartTransition ? \"active\" : \"inactive\";\n\n\t\t\treturn {\n\t\t\t\t\"data-present\": dataAttr(isPresent),\n\t\t\t\t\"data-present-or-transition-complete\": dataAttr(isPresentOrIsTransitionComplete),\n\t\t\t\t\"data-state\": state,\n\t\t\t\t...(variant === \"transition\" && { \"data-transition\": transitionState }),\n\t\t\t\t...innerProps,\n\t\t\t\tclassName: innerProps.className,\n\t\t\t};\n\t\t},\n\t\t[isPresent, isPresentOrIsTransitionComplete, shouldStartTransition, state, variant]\n\t);\n\n\tconst propGetters = useMemo(() => ({ getPresenceProps }), [getPresenceProps]);\n\n\tconst result = useMemo<UsePresenceResult>(\n\t\t() =>\n\t\t\t({\n\t\t\t\tisPresent,\n\t\t\t\tisPresentOrIsTransitionComplete,\n\t\t\t\tpropGetters,\n\t\t\t\tref,\n\t\t\t\tshouldStartTransition,\n\t\t\t}) satisfies UsePresenceResult,\n\t\t[isPresent, isPresentOrIsTransitionComplete, propGetters, ref, shouldStartTransition]\n\t);\n\n\treturn result;\n};\n\nexport { usePresence };\n","\"use client\";\n\nimport { useComposeRefs } from \"@zayne-labs/toolkit-react\";\nimport { isFunction, type UnknownObject } from \"@zayne-labs/toolkit-type-helpers\";\n\nimport { Slot } from \"../slot\";\nimport { usePresence, type UsePresenceOptions, type UsePresenceResult } from \"./use-presence\";\n\ntype RefProp = { ref?: React.Ref<HTMLElement> };\n\ntype RenderPropContext = Omit<UsePresenceResult, \"propGetters\" | \"ref\">;\n\ntype PresenceProps = UsePresenceOptions & {\n\tchildren?: React.ReactElement<RefProp> | ((props: RenderPropContext) => React.ReactElement<RefProp>);\n\tclassName?: string;\n\tforceMount?: boolean;\n};\n\nfunction Presence(props: PresenceProps) {\n\tconst { children, className, forceMount = false, onExitComplete, present, variant } = props;\n\n\tconst {\n\t\tisPresent,\n\t\tisPresentOrIsTransitionComplete,\n\t\tpropGetters,\n\t\tref: presenceRef,\n\t\tshouldStartTransition,\n\t} = usePresence({ onExitComplete, present, variant });\n\n\tconst context = {\n\t\tisPresent,\n\t\tisPresentOrIsTransitionComplete,\n\t\tshouldStartTransition,\n\t} satisfies RenderPropContext;\n\n\tconst resolvedChild = isFunction(children) ? children(context) : children;\n\n\tconst childRef = (resolvedChild?.props.ref\n\t\t?? (resolvedChild as unknown as UnknownObject).ref) as React.Ref<HTMLElement>;\n\n\tconst ref = useComposeRefs(presenceRef, childRef);\n\n\tconst shouldRender =\n\t\tforceMount || (variant === \"transition\" ? isPresentOrIsTransitionComplete : isPresent);\n\n\tif (!shouldRender) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Slot.Root ref={ref} {...propGetters.getPresenceProps({ className })}>\n\t\t\t{resolvedChild}\n\t\t</Slot.Root>\n\t);\n}\n\nexport { Presence };\n"],"mappings":";;;;;;;;AAUA,MAAM,mBACL,WACI;CACJ,MAAM,WAAW,WAAmB,UAA0B;AAG7D,SAFiB,OAAO,OAAO,WAAW,UAAU;;AAKrD,QAAO,WAAW,SAAS,OAAO,QAAQ;;AAG3C,MAAM,oBAAoB,WAAuC,QAAQ,iBAAiB;;;;;AA0B1F,MAAM,eAAe,YAAmD;CACvE,MAAM,EAAE,gBAAgB,SAAS,aAAa,UAAU,gBAAgB;CAExE,MAAM,uBAAu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olymorphicProps } from "@zayne-labs/toolkit-react/utils";
2
- import * as react_jsx_runtime21 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime11 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/components/ui/card/card.d.ts
5
- declare function CardRoot<TElement extends React.ElementType = "article">(props: PolymorphicProps<TElement>): react_jsx_runtime21.JSX.Element;
6
- declare function CardHeader<TElement extends React.ElementType = "header">(props: PolymorphicProps<TElement>): react_jsx_runtime21.JSX.Element;
7
- declare function CardTitle<TElement extends React.ElementType = "h3">(props: PolymorphicProps<TElement>): react_jsx_runtime21.JSX.Element;
8
- declare function CardDescription<TElement extends React.ElementType = "p">(props: PolymorphicProps<TElement>): react_jsx_runtime21.JSX.Element;
9
- declare function CardContent<TElement extends React.ElementType = "div">(props: PolymorphicProps<TElement>): react_jsx_runtime21.JSX.Element;
10
- declare function CardAction<TElement extends React.ElementType = "div">(props: PolymorphicProps<TElement>): react_jsx_runtime21.JSX.Element;
5
+ declare function CardRoot<TElement extends React.ElementType = "article">(props: PolymorphicProps<TElement>): react_jsx_runtime11.JSX.Element;
6
+ declare function CardHeader<TElement extends React.ElementType = "header">(props: PolymorphicProps<TElement>): react_jsx_runtime11.JSX.Element;
7
+ declare function CardTitle<TElement extends React.ElementType = "h3">(props: PolymorphicProps<TElement>): react_jsx_runtime11.JSX.Element;
8
+ declare function CardDescription<TElement extends React.ElementType = "p">(props: PolymorphicProps<TElement>): react_jsx_runtime11.JSX.Element;
9
+ declare function CardContent<TElement extends React.ElementType = "div">(props: PolymorphicProps<TElement>): react_jsx_runtime11.JSX.Element;
10
+ declare function CardAction<TElement extends React.ElementType = "div">(props: PolymorphicProps<TElement>): react_jsx_runtime11.JSX.Element;
11
11
  declare function CardFooter<TElement extends React.ElementType = "footer">(props: PolymorphicProps<TElement, {
12
12
  asChild?: boolean;
13
- }>): react_jsx_runtime21.JSX.Element;
13
+ }>): react_jsx_runtime11.JSX.Element;
14
14
  declare namespace card_parts_d_exports {
15
15
  export { CardAction as Action, CardContent as Content, CardDescription as Description, CardFooter as Footer, CardHeader as Header, CardRoot as Root, CardTitle as Title };
16
16
  }
@@ -1,6 +1,6 @@
1
1
  import { PolymorphicPropsStrict } from "@zayne-labs/toolkit-react/utils";
2
2
  import { UnionDiscriminator } from "@zayne-labs/toolkit-type-helpers";
3
- import * as react_jsx_runtime13 from "react/jsx-runtime";
3
+ import * as react_jsx_runtime2 from "react/jsx-runtime";
4
4
  import { StoreApi } from "@zayne-labs/toolkit-core";
5
5
 
6
6
  //#region src/components/ui/carousel/types.d.ts
@@ -78,14 +78,14 @@ type OtherCarouselProps = {
78
78
  };
79
79
  //#endregion
80
80
  //#region src/components/ui/carousel/carousel.d.ts
81
- declare function CarouselRoot<TImages extends ImagesType, TElement extends React.ElementType = "div">(props: PolymorphicPropsStrict<TElement, CarouselRootProps<TImages>>): react_jsx_runtime13.JSX.Element;
82
- declare function CarouselButton(props: CarouselButtonsProps): react_jsx_runtime13.JSX.Element;
83
- declare function CarouselControls(props: CarouselControlProps): react_jsx_runtime13.JSX.Element;
84
- declare function CarouselItemList<TArray extends unknown[]>(props: CarouselWrapperProps<TArray[number]>): react_jsx_runtime13.JSX.Element;
85
- declare function CarouselItem(props: OtherCarouselProps): react_jsx_runtime13.JSX.Element;
86
- declare function CarouselCaption<TElement extends React.ElementType = "div">(props: PolymorphicPropsStrict<TElement, OtherCarouselProps>): react_jsx_runtime13.JSX.Element;
87
- declare function CarouselIndicatorList<TArray extends unknown[]>(props: CarouselWrapperProps<TArray[number]>): react_jsx_runtime13.JSX.Element;
88
- declare function CarouselIndicator(props: CarouselIndicatorProps): react_jsx_runtime13.JSX.Element;
81
+ declare function CarouselRoot<TImages extends ImagesType, TElement extends React.ElementType = "div">(props: PolymorphicPropsStrict<TElement, CarouselRootProps<TImages>>): react_jsx_runtime2.JSX.Element;
82
+ declare function CarouselButton(props: CarouselButtonsProps): react_jsx_runtime2.JSX.Element;
83
+ declare function CarouselControls(props: CarouselControlProps): react_jsx_runtime2.JSX.Element;
84
+ declare function CarouselItemList<TArray extends unknown[]>(props: CarouselWrapperProps<TArray[number]>): react_jsx_runtime2.JSX.Element;
85
+ declare function CarouselItem(props: OtherCarouselProps): react_jsx_runtime2.JSX.Element;
86
+ declare function CarouselCaption<TElement extends React.ElementType = "div">(props: PolymorphicPropsStrict<TElement, OtherCarouselProps>): react_jsx_runtime2.JSX.Element;
87
+ declare function CarouselIndicatorList<TArray extends unknown[]>(props: CarouselWrapperProps<TArray[number]>): react_jsx_runtime2.JSX.Element;
88
+ declare function CarouselIndicator(props: CarouselIndicatorProps): react_jsx_runtime2.JSX.Element;
89
89
  declare namespace carousel_parts_d_exports {
90
90
  export { CarouselButton as Button, CarouselCaption as Caption, CarouselControls as Controls, CarouselIndicator as Indicator, CarouselIndicatorList as IndicatorList, CarouselItem as Item, CarouselItemList as ItemList, CarouselRoot as Root };
91
91
  }
@@ -1,9 +1,9 @@
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 react0 from "react";
4
+ import * as react16 from "react";
5
5
  import "@zayne-labs/toolkit-react";
6
- import * as react_jsx_runtime0 from "react/jsx-runtime";
6
+ import * as react_jsx_runtime18 from "react/jsx-runtime";
7
7
  import * as _zayne_labs_toolkit_core1 from "@zayne-labs/toolkit-core";
8
8
  import { FileMeta, FileOrFileMeta, FileValidationErrorContextEach, FileValidationHooksAsync, FileValidationSettingsAsync } from "@zayne-labs/toolkit-core";
9
9
 
@@ -223,7 +223,7 @@ interface UseDropZoneProps extends FileValidationSettingsAsync {
223
223
  declare const DropZoneStoreContextProvider: (props: {
224
224
  children: React.ReactNode;
225
225
  store: _zayne_labs_toolkit_core1.StoreApi<DropZoneStore>;
226
- }) => react0.FunctionComponentElement<react0.ProviderProps<_zayne_labs_toolkit_core1.StoreApi<DropZoneStore>>>, useDropZoneStoreContext: <TResult = DropZoneStore>(selector?: _zayne_labs_toolkit_type_helpers0.SelectorFn<DropZoneStore, TResult> | undefined) => TResult;
226
+ }) => react16.FunctionComponentElement<react16.ProviderProps<_zayne_labs_toolkit_core1.StoreApi<DropZoneStore>>>, useDropZoneStoreContext: <TResult = DropZoneStore>(selector?: _zayne_labs_toolkit_type_helpers0.SelectorFn<DropZoneStore, TResult> | undefined) => TResult;
227
227
  type FileItemContextType = {
228
228
  fileState: FileState;
229
229
  };
@@ -232,29 +232,29 @@ type FileItemContextType = {
232
232
  type DropZoneRootProps = UseDropZoneProps & {
233
233
  children: React.ReactNode;
234
234
  };
235
- declare function DropZoneRoot(props: DropZoneRootProps): react_jsx_runtime0.JSX.Element;
235
+ declare function DropZoneRoot(props: DropZoneRootProps): react_jsx_runtime18.JSX.Element;
236
236
  type DropZoneContextProps<TSlice> = {
237
237
  children: React.ReactNode | ((context: TSlice) => React.ReactNode);
238
238
  selector?: SelectorFn<DropZoneStore, TSlice>;
239
239
  };
240
- declare function DropZoneContext<TSlice = DropZoneStore>(props: DropZoneContextProps<TSlice>): react0.ReactNode;
240
+ declare function DropZoneContext<TSlice = DropZoneStore>(props: DropZoneContextProps<TSlice>): react16.ReactNode;
241
241
  type DropZoneContainerProps = PartInputProps["container"] & {
242
242
  asChild?: boolean;
243
243
  };
244
- declare function DropZoneContainer<TElement extends React.ElementType = "div">(props: PolymorphicPropsStrict<TElement, DropZoneContainerProps>): react_jsx_runtime0.JSX.Element;
244
+ declare function DropZoneContainer<TElement extends React.ElementType = "div">(props: PolymorphicPropsStrict<TElement, DropZoneContainerProps>): react_jsx_runtime18.JSX.Element;
245
245
  type DropZoneInputProps = PartInputProps["input"] & {
246
246
  asChild?: boolean;
247
247
  };
248
- declare function DropZoneInput(props: DropZoneInputProps): react_jsx_runtime0.JSX.Element;
248
+ declare function DropZoneInput(props: DropZoneInputProps): react_jsx_runtime18.JSX.Element;
249
249
  type DropZoneAreaProps<TSlice> = DropZoneContextProps<TSlice> & PartInputProps["container"] & {
250
250
  classNames?: Partial<Record<Extract<keyof PartInputProps, "container" | "input">, string>>;
251
251
  extraProps?: Partial<Pick<PartInputProps, "container" | "input">>;
252
252
  };
253
- declare function DropZoneArea<TSlice = DropZoneStore>(props: DropZoneAreaProps<TSlice>): react_jsx_runtime0.JSX.Element;
253
+ declare function DropZoneArea<TSlice = DropZoneStore>(props: DropZoneAreaProps<TSlice>): react_jsx_runtime18.JSX.Element;
254
254
  type DropZoneTriggerProps = PartInputProps["trigger"] & {
255
255
  asChild?: boolean;
256
256
  };
257
- declare function DropZoneTrigger(props: DropZoneTriggerProps): react_jsx_runtime0.JSX.Element;
257
+ declare function DropZoneTrigger(props: DropZoneTriggerProps): react_jsx_runtime18.JSX.Element;
258
258
  type ListPerItemContext = Pick<DropZoneStore, "actions"> & {
259
259
  array: DropZoneStore["fileStateArray"];
260
260
  fileState: DropZoneStore["fileStateArray"][number];
@@ -273,21 +273,21 @@ type DropZoneFileListProps = Omit<PartInputProps["fileList"], "children"> & {
273
273
  asChild?: boolean;
274
274
  forceMount?: boolean;
275
275
  } & (FileListManualListVariant | FileListPerItemVariant);
276
- declare function DropZoneFileList<TElement extends React.ElementType = "ul">(props: PolymorphicPropsStrict<TElement, DropZoneFileListProps>): react_jsx_runtime0.JSX.Element;
276
+ declare function DropZoneFileList<TElement extends React.ElementType = "ul">(props: PolymorphicPropsStrict<TElement, DropZoneFileListProps>): react_jsx_runtime18.JSX.Element;
277
277
  type DropZoneFileItemProps = FileItemContextType & PartInputProps["fileItem"] & {
278
278
  asChild?: boolean;
279
279
  };
280
- declare function DropZoneFileItem<TElement extends React.ElementType = "li">(props: PolymorphicPropsStrict<TElement, DropZoneFileItemProps>): react_jsx_runtime0.JSX.Element;
280
+ declare function DropZoneFileItem<TElement extends React.ElementType = "li">(props: PolymorphicPropsStrict<TElement, DropZoneFileItemProps>): react_jsx_runtime18.JSX.Element;
281
281
  type DropZoneFileItemDeleteProps = PartInputProps["fileItemDelete"] & {
282
282
  asChild?: boolean;
283
283
  };
284
- declare function DropZoneFileItemDelete(props: DropZoneFileItemDeleteProps): react_jsx_runtime0.JSX.Element;
284
+ declare function DropZoneFileItemDelete(props: DropZoneFileItemDeleteProps): react_jsx_runtime18.JSX.Element;
285
285
  type DropZoneFileItemProgressProps = PartInputProps["fileItemProgress"] & {
286
286
  asChild?: boolean;
287
287
  forceMount?: boolean;
288
288
  size?: number;
289
289
  };
290
- declare function DropZoneFileItemProgress<TElement extends React.ElementType = "span">(props: PolymorphicPropsStrict<TElement, DropZoneFileItemProgressProps>): react_jsx_runtime0.JSX.Element | null;
290
+ declare function DropZoneFileItemProgress<TElement extends React.ElementType = "span">(props: PolymorphicPropsStrict<TElement, DropZoneFileItemProgressProps>): react_jsx_runtime18.JSX.Element | null;
291
291
  type RenderPreviewDetails<TElement extends React.ElementType = "svg"> = {
292
292
  node?: React.ReactNode;
293
293
  } & {
@@ -316,7 +316,7 @@ type DropZoneFileItemPreviewProps = Omit<PartInputProps["fileItemPreview"], "chi
316
316
  }) => React.ReactNode);
317
317
  renderPreview?: boolean | RenderPreview;
318
318
  };
319
- declare function DropZoneFileItemPreview<TElement extends React.ElementType>(props: PolymorphicPropsStrict<TElement, DropZoneFileItemPreviewProps>): react_jsx_runtime0.JSX.Element | null;
319
+ declare function DropZoneFileItemPreview<TElement extends React.ElementType>(props: PolymorphicPropsStrict<TElement, DropZoneFileItemPreviewProps>): react_jsx_runtime18.JSX.Element | null;
320
320
  type DropZoneFileItemMetadataProps = Omit<PartInputProps["fileItemMetadata"], "children"> & Partial<Pick<FileItemContextType, "fileState">> & {
321
321
  asChild?: boolean;
322
322
  children?: React.ReactNode | ((context: Pick<FileItemContextType, "fileState">) => React.ReactNode);
@@ -326,12 +326,12 @@ type DropZoneFileItemMetadataProps = Omit<PartInputProps["fileItemMetadata"], "c
326
326
  };
327
327
  size?: "default" | "sm";
328
328
  };
329
- declare function DropZoneFileItemMetadata(props: DropZoneFileItemMetadataProps): react_jsx_runtime0.JSX.Element | null;
329
+ declare function DropZoneFileItemMetadata(props: DropZoneFileItemMetadataProps): react_jsx_runtime18.JSX.Element | null;
330
330
  type DropZoneFileClearProps = PartInputProps["fileItemClear"] & {
331
331
  asChild?: boolean;
332
332
  forceMount?: boolean;
333
333
  };
334
- declare function DropZoneFileClear(props: DropZoneFileClearProps): react_jsx_runtime0.JSX.Element | null;
334
+ declare function DropZoneFileClear(props: DropZoneFileClearProps): react_jsx_runtime18.JSX.Element | null;
335
335
  declare namespace drop_zone_parts_d_exports {
336
336
  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
337
  }
@@ -3,7 +3,7 @@
3
3
  import { t as __export } from "../../chunk-BL-4obUL.js";
4
4
  import { n as SlotRoot } from "../../slot--lEkrAQf.js";
5
5
  import { n as For } from "../../for-DsdwXl8s.js";
6
- import { t as Presence } from "../../presence-C2VQITU0.js";
6
+ import { t as Presence } from "../../presence-DNwNWipt.js";
7
7
  import { t as cnMerge } from "../../cn-Ba8kxuby.js";
8
8
  import { composeRefs, composeTwoEventHandlers } from "@zayne-labs/toolkit-react/utils";
9
9
  import { isBoolean, isFile, isFunction, isNumber, isObject, isString } from "@zayne-labs/toolkit-type-helpers";
@@ -441,7 +441,6 @@ const createDropZoneStore = (initStoreValues) => {
441
441
  const useDropZone = (props) => {
442
442
  const { allowedFileTypes, disabled = false, disableFilePickerOpenOnAreaClick = false, disableInternalStateSubscription = false, disablePreviewGenForNonImageFiles = true, initialFiles, maxFileCount, maxFileSize, multiple, onFilesChange, onUpload, onValidationError, onValidationSuccess, rejectDuplicateFiles = true, validator } = props ?? {};
443
443
  const inputRef = useRef(null);
444
- const isOnUploadFnProvided = onUpload !== void 0;
445
444
  const stableOnFilesChange = useCallbackRef(onFilesChange);
446
445
  const stableOnUpload = useCallbackRef(onUpload);
447
446
  const stableOnUploadError = useCallbackRef(onValidationError);
@@ -460,7 +459,7 @@ const useDropZone = (props) => {
460
459
  maxFileSize: shallowComparedMaxFileSize,
461
460
  multiple,
462
461
  onFilesChange: stableOnFilesChange,
463
- onUpload: isOnUploadFnProvided ? stableOnUpload : void 0,
462
+ onUpload: stableOnUpload,
464
463
  onValidationError: stableOnUploadError,
465
464
  onValidationSuccess: stableOnUploadSuccess,
466
465
  rejectDuplicateFiles,
@@ -474,7 +473,6 @@ const useDropZone = (props) => {
474
473
  shallowComparedMaxFileSize,
475
474
  multiple,
476
475
  stableOnFilesChange,
477
- isOnUploadFnProvided,
478
476
  stableOnUpload,
479
477
  stableOnUploadError,
480
478
  stableOnUploadSuccess,
@@ -508,8 +506,8 @@ const useDropZone = (props) => {
508
506
  ...innerProps,
509
507
  className: cnMerge(`relative flex flex-col items-center justify-center gap-2 rounded-lg border-2 border-dashed
510
508
  p-6 transition-colors duration-250 ease-out outline-none select-none
511
- focus-visible:border-zu-ring/50`, `data-[disabled]:pointer-events-none data-[drag-over]:opacity-60
512
- data-[invalid]:border-zu-destructive data-[invalid]:ring-zu-destructive/20`, innerProps.className),
509
+ focus-visible:border-zu-ring/50`, `data-disabled:pointer-events-none data-drag-over:opacity-60
510
+ data-invalid:border-zu-destructive data-invalid:ring-zu-destructive/20`, innerProps.className),
513
511
  "data-disabled": dataAttr(isDisabled),
514
512
  onClick: composeTwoEventHandlers(onAreaClick, innerProps.onClick),
515
513
  onDragEnter: composeTwoEventHandlers(actions.handleDragEnter, innerProps.onDragEnter),
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["generateFileID","generateFileIDPrimitive","initFileStateArray: DropZoneState[\"fileStateArray\"]","newFileStateArray: DropZoneState[\"fileStateArray\"]","generateFileID","useDropZoneStore: UseDropZoneResult[\"useDropZoneStore\"]","getContainerProps: UseDropZoneResult[\"propGetters\"][\"getContainerProps\"]","getInputProps: UseDropZoneResult[\"propGetters\"][\"getInputProps\"]","getTriggerProps: UseDropZoneResult[\"propGetters\"][\"getTriggerProps\"]","getFileListProps: UseDropZoneResult[\"propGetters\"][\"getFileListProps\"]","getFileItemProps: UseDropZoneResult[\"propGetters\"][\"getFileItemProps\"]","getFileItemProgressProps: UseDropZoneResult[\"propGetters\"][\"getFileItemProgressProps\"]","getFileItemDeleteProps: UseDropZoneResult[\"propGetters\"][\"getFileItemDeleteProps\"]","getFileItemPreviewProps: UseDropZoneResult[\"propGetters\"][\"getFileItemPreviewProps\"]","getFileItemMetadataProps: UseDropZoneResult[\"propGetters\"][\"getFileItemMetadataProps\"]","getFileItemClearProps: UseDropZoneResult[\"propGetters\"][\"getFileItemClearProps\"]","Slot.Root","Component"],"sources":["../../../../src/components/ui/drop-zone/drop-zone-context.ts","../../../../src/components/ui/drop-zone/icons.tsx","../../../../src/components/ui/drop-zone/utils.ts","../../../../src/components/ui/drop-zone/drop-zone-store.ts","../../../../src/components/ui/drop-zone/use-drop-zone.ts","../../../../src/components/ui/drop-zone/drop-zone.tsx","../../../../src/components/ui/drop-zone/drop-zone-parts.ts"],"sourcesContent":["import { createCustomContext } from \"@zayne-labs/toolkit-react\";\nimport { createReactStoreContext } from \"@zayne-labs/toolkit-react/zustand\";\nimport type { DropZoneStore, FileState, UseDropZoneResult } from \"./types\";\n\nconst [DropZoneStoreContextProvider, useDropZoneStoreContext] = createReactStoreContext<DropZoneStore>({\n\thookName: \"useDropZoneStoreContext\",\n\tname: \"DropZoneStoreContext\",\n\tproviderName: \"DropZoneRoot\",\n});\n\nexport type DropZoneRootContextType = Pick<\n\tUseDropZoneResult,\n\t\"disabled\" | \"disableInternalStateSubscription\" | \"inputRef\" | \"propGetters\"\n>;\n\nconst [DropZoneRootContextProvider, useDropZoneRootContext] = createCustomContext<DropZoneRootContextType>(\n\t{\n\t\thookName: \"useDropZoneRootContext\",\n\t\tname: \"DropZoneRootContext\",\n\t\tproviderName: \"DropZoneRoot\",\n\t}\n);\n\nexport type FileItemContextType = {\n\tfileState: FileState;\n};\n\nconst [FileItemContextProvider, useFileItemContext] = createCustomContext({\n\tdefaultValue: null as unknown as FileItemContextType,\n\thookName: \"useFileItemContext\",\n\tname: \"FileItemContext\",\n\tproviderName: \"FileItem\",\n\tstrict: false,\n});\n\nexport {\n\tDropZoneRootContextProvider,\n\tDropZoneStoreContextProvider,\n\tFileItemContextProvider,\n\tuseDropZoneRootContext,\n\tuseDropZoneStoreContext,\n\tuseFileItemContext,\n};\n","export const FileVideoIcon = (props: React.SVGProps<SVGSVGElement>) => (\n\t<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1em\" height=\"1em\" viewBox=\"0 0 24 24\" {...props}>\n\t\t{/* Icon from Lucide by Lucide Contributors - https://github.com/lucide-icons/lucide/blob/main/LICENSE */}\n\t\t<g fill=\"none\" stroke=\"currentColor\" strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth=\"2\">\n\t\t\t<path d=\"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z\" />\n\t\t\t<path d=\"M14 2v4a2 2 0 0 0 2 2h4m-10 3l5 3l-5 3z\" />\n\t\t</g>\n\t</svg>\n);\n\nexport const FileAudioIcon = (props: React.SVGProps<SVGSVGElement>) => (\n\t<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1em\" height=\"1em\" viewBox=\"0 0 24 24\" {...props}>\n\t\t{/* Icon from Lucide by Lucide Contributors - https://github.com/lucide-icons/lucide/blob/main/LICENSE */}\n\t\t<g fill=\"none\" stroke=\"currentColor\" strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth=\"2\">\n\t\t\t<path d=\"M17.5 22h.5a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v3\" />\n\t\t\t<path d=\"M14 2v4a2 2 0 0 0 2 2h4M2 19a2 2 0 1 1 4 0v1a2 2 0 1 1-4 0v-4a6 6 0 0 1 12 0v4a2 2 0 1 1-4 0v-1a2 2 0 1 1 4 0\" />\n\t\t</g>\n\t</svg>\n);\n\nexport const FileTextIcon = (props: React.SVGProps<SVGSVGElement>) => (\n\t<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1em\" height=\"1em\" viewBox=\"0 0 24 24\" {...props}>\n\t\t{/* Icon from Lucide by Lucide Contributors - https://github.com/lucide-icons/lucide/blob/main/LICENSE */}\n\t\t<g fill=\"none\" stroke=\"currentColor\" strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth=\"2\">\n\t\t\t<path d=\"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z\" />\n\t\t\t<path d=\"M14 2v4a2 2 0 0 0 2 2h4M10 9H8m8 4H8m8 4H8\" />\n\t\t</g>\n\t</svg>\n);\n\nexport const FileCodeIcon = (props: React.SVGProps<SVGSVGElement>) => (\n\t<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1em\" height=\"1em\" viewBox=\"0 0 24 24\" {...props}>\n\t\t{/* Icon from Lucide by Lucide Contributors - https://github.com/lucide-icons/lucide/blob/main/LICENSE */}\n\t\t<g fill=\"none\" stroke=\"currentColor\" strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth=\"2\">\n\t\t\t<path d=\"M10 12.5L8 15l2 2.5m4-5l2 2.5l-2 2.5M14 2v4a2 2 0 0 0 2 2h4\" />\n\t\t\t<path d=\"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z\" />\n\t\t</g>\n\t</svg>\n);\n\nexport const FileArchiveIcon = (props: React.SVGProps<SVGSVGElement>) => (\n\t<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1em\" height=\"1em\" viewBox=\"0 0 24 24\" {...props}>\n\t\t{/* Icon from Lucide by Lucide Contributors - https://github.com/lucide-icons/lucide/blob/main/LICENSE */}\n\t\t<g fill=\"none\" stroke=\"currentColor\" strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth=\"2\">\n\t\t\t<path d=\"M10 12v-1m0 7v-2m0-9V6m4-4v4a2 2 0 0 0 2 2h4\" />\n\t\t\t<path d=\"M15.5 22H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v16a2 2 0 0 0 .274 1.01\" />\n\t\t\t<circle cx=\"10\" cy=\"20\" r=\"2\" />\n\t\t</g>\n\t</svg>\n);\n\nexport const FileCogIcon = (props: React.SVGProps<SVGSVGElement>) => (\n\t<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1em\" height=\"1em\" viewBox=\"0 0 24 24\" {...props}>\n\t\t{/* Icon from Lucide by Lucide Contributors - https://github.com/lucide-icons/lucide/blob/main/LICENSE */}\n\t\t<g fill=\"none\" stroke=\"currentColor\" strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth=\"2\">\n\t\t\t<path d=\"M14 2v4a2 2 0 0 0 2 2h4M3.2 12.9l-.9-.4m.9 2.6l-.9.4\" />\n\t\t\t<path d=\"M4.677 21.5a2 2 0 0 0 1.313.5H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v2.5m.9 4.7l-.4-.9m.4 6.5l-.4.9m3-7.4l-.4.9m.4 6.5l-.4-.9m2.6-4.3l-.9.4m.9 2.6l-.9-.4\" />\n\t\t\t<circle cx=\"6\" cy=\"14\" r=\"3\" />\n\t\t</g>\n\t</svg>\n);\n\nexport const FileIcon = (props: React.SVGProps<SVGSVGElement>) => (\n\t<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1em\" height=\"1em\" viewBox=\"0 0 24 24\" {...props}>\n\t\t{/* Icon from Lucide by Lucide Contributors - https://github.com/lucide-icons/lucide/blob/main/LICENSE */}\n\t\t<g fill=\"none\" stroke=\"currentColor\" strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth=\"2\">\n\t\t\t<path d=\"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z\" />\n\t\t\t<path d=\"M14 2v4a2 2 0 0 0 2 2h4\" />\n\t\t</g>\n\t</svg>\n);\n","import {\n\tcreateFileURL,\n\ttype FileOrFileMeta,\n\ttype FileValidationErrorContextEach,\n\tgenerateFileID as generateFileIDPrimitive,\n} from \"@zayne-labs/toolkit-core\";\nimport { isFile, isObject, isString } from \"@zayne-labs/toolkit-type-helpers\";\nimport type { FileState, FileStateOrIDProp, PartProps } from \"./types\";\n\nexport const generateFileID = generateFileIDPrimitive;\n\nexport const createObjectURL = (\n\tfile: FileOrFileMeta,\n\tdisallowPreviewForNonImageFiles: boolean | undefined\n) => {\n\tif (disallowPreviewForNonImageFiles && !file.type?.startsWith(\"image/\")) return;\n\n\treturn createFileURL(file);\n};\n\nexport const clearObjectURL = (\n\tfileState: FileState | undefined,\n\tdisallowPreviewForNonImageFiles: boolean | undefined\n) => {\n\tif (!isFile(fileState?.file)) return;\n\n\tif (disallowPreviewForNonImageFiles && !fileState.file.type.startsWith(\"image/\")) return;\n\n\tif (!fileState.preview) return;\n\n\tURL.revokeObjectURL(fileState.preview);\n};\n\nexport const isMatchingFile = (\n\toptions: FileStateOrIDProp & {\n\t\tfileState: FileOrFileMeta | FileState;\n\t}\n) => {\n\tconst { fileState, fileStateOrID } = options;\n\n\tconst fileID = isFile(fileState) ? generateFileID(fileState) : fileState.id;\n\n\tif (isString(fileStateOrID)) {\n\t\treturn fileID === fileStateOrID;\n\t}\n\n\tif (isFile(fileStateOrID)) {\n\t\tconst generatedFileID = generateFileID(fileStateOrID);\n\t\treturn fileID === generatedFileID;\n\t}\n\n\treturn fileID === fileStateOrID.id;\n};\n\ntype FromCamelToKebabCase<TString extends string> =\n\tTString extends `${infer First}${infer Rest}` ?\n\t\tFirst extends Uppercase<First> ?\n\t\t\t`-${Lowercase<First>}${FromCamelToKebabCase<Rest>}`\n\t\t:\t`${First}${FromCamelToKebabCase<Rest>}`\n\t:\t\"\";\n\nexport const getScopeAttrs = (part: FromCamelToKebabCase<keyof PartProps>) => {\n\treturn {\n\t\t/* eslint-disable perfectionist/sort-objects -- I need this order to be maintained */\n\t\t\"data-slot\": `dropzone-${part}`,\n\t\t\"data-scope\": \"dropzone\",\n\t\t\"data-part\": part,\n\t\t/* eslint-enable perfectionist/sort-objects -- I need this order to be maintained */\n\t} as const;\n};\n\nconst dropZoneErrorSymbol = Symbol(\"DropZoneError\");\n\nexport class DropZoneError extends Error {\n\treadonly dropZoneErrorSymbol = dropZoneErrorSymbol;\n\tfile?: FileValidationErrorContextEach[\"file\"];\n\toverride name = \"DropZoneError\" as const;\n\n\tconstructor(\n\t\tctx: Pick<FileValidationErrorContextEach, \"message\"> & {\n\t\t\tfile?: FileValidationErrorContextEach[\"file\"];\n\t\t},\n\t\terrorOptions?: ErrorOptions\n\t) {\n\t\tconst { file, message } = ctx;\n\n\t\tsuper(message, errorOptions);\n\n\t\tthis.file = file;\n\t}\n\n\tstatic override isError(error: unknown): error is DropZoneError {\n\t\tif (!isObject<DropZoneError>(error)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (error instanceof DropZoneError) {\n\t\t\treturn true;\n\t\t}\n\n\t\tconst actualError = error as DropZoneError;\n\n\t\treturn (\n\t\t\tactualError.dropZoneErrorSymbol === dropZoneErrorSymbol\n\t\t\t// eslint-disable-next-line ts-eslint/no-unnecessary-condition -- Allow\n\t\t\t&& actualError.name === \"DropZoneError\"\n\t\t);\n\t}\n}\n\nexport const getErrorContext = (error: DropZoneError | Error): NonNullable<FileState[\"error\"]> => {\n\tif (DropZoneError.isError(error)) {\n\t\treturn {\n\t\t\tcause: \"custom-error\",\n\t\t\tcode: \"upload-error\",\n\t\t\tfile: error.file ?? ({} as never),\n\t\t\tmessage: error.message,\n\t\t\toriginalError: error.cause ?? error,\n\t\t};\n\t}\n\n\tconst actualError = Error.isError(error) ? error : new Error(\"File upload failed\", { cause: error });\n\n\treturn {\n\t\tcause: \"custom-error\",\n\t\tcode: \"upload-error\",\n\t\tfile: isFile(actualError.cause) ? actualError.cause : ({} as never),\n\t\tmessage: Error.isError(error) ? actualError.message : String(actualError),\n\t\toriginalError: actualError,\n\t};\n};\n","import { createStore, handleFileValidationAsync, toArray } from \"@zayne-labs/toolkit-core\";\nimport type { DropZoneState, DropZoneStore, UseDropZoneProps } from \"./types\";\nimport { clearObjectURL, createObjectURL, generateFileID, getErrorContext, isMatchingFile } from \"./utils\";\n\ntype RequiredUseDropZoneProps = {\n\t[Key in keyof Required<UseDropZoneProps>]: UseDropZoneProps[Key] | undefined;\n};\n\ntype InitStoreValues = Omit<\n\tRequiredUseDropZoneProps,\n\t\"disabled\" | \"disableFilePickerOpenOnAreaClick\" | \"disableInternalStateSubscription\" | \"extraProps\"\n> & { inputRef: React.RefObject<HTMLInputElement | null> };\n\nexport const createDropZoneStore = (initStoreValues: InitStoreValues) => {\n\tconst {\n\t\tallowedFileTypes,\n\t\tdisablePreviewGenForNonImageFiles,\n\t\tinitialFiles,\n\t\tinputRef,\n\t\tmaxFileCount,\n\t\tmaxFileSize,\n\t\tmultiple,\n\t\tonFilesChange,\n\t\tonUpload,\n\t\tonValidationError,\n\t\tonValidationSuccess,\n\t\trejectDuplicateFiles,\n\t\tvalidator,\n\t} = initStoreValues;\n\n\tconst initialFileArray = toArray(initialFiles).filter(Boolean);\n\n\tconst clearInputValue = () => {\n\t\tif (!inputRef.current) return;\n\n\t\tinputRef.current.value = \"\";\n\t};\n\n\tconst initFileStateArray: DropZoneState[\"fileStateArray\"] = initialFileArray.map((fileMeta) => ({\n\t\tfile: fileMeta,\n\t\tid: fileMeta.id,\n\t\tpreview: fileMeta.url,\n\t\tprogress: 0,\n\t\tstatus: \"idle\",\n\t}));\n\n\tconst store = createStore<DropZoneStore>((set, get) => ({\n\t\tdisabled: false,\n\t\terrors: [],\n\t\tfileStateArray: initFileStateArray,\n\t\tisDraggingOver: false,\n\t\tisInvalid: false,\n\n\t\t// eslint-disable-next-line perfectionist/sort-objects -- ignore\n\t\tactions: {\n\t\t\taddFiles: async (files) => {\n\t\t\t\tif (!files || files.length === 0) {\n\t\t\t\t\tconsole.warn(\"No file selected!\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst { actions, fileStateArray } = get();\n\n\t\t\t\t// == In single file mode, only use the first file\n\t\t\t\tconst resolvedNewFiles = !multiple ? [files[0]] : files;\n\n\t\t\t\tconst { errors, validFiles } = await handleFileValidationAsync({\n\t\t\t\t\texistingFiles: fileStateArray.map((fileWithPreview) => fileWithPreview.file),\n\t\t\t\t\thooks: {\n\t\t\t\t\t\tonErrorEach: onValidationError,\n\t\t\t\t\t\tonSuccessBatch: onValidationSuccess,\n\t\t\t\t\t},\n\t\t\t\t\tnewFiles: resolvedNewFiles,\n\t\t\t\t\tsettings: {\n\t\t\t\t\t\tallowedFileTypes,\n\t\t\t\t\t\tmaxFileCount,\n\t\t\t\t\t\tmaxFileSize,\n\t\t\t\t\t\trejectDuplicateFiles,\n\t\t\t\t\t\tvalidator,\n\t\t\t\t\t},\n\t\t\t\t});\n\n\t\t\t\tif (validFiles.length === 0) {\n\t\t\t\t\tset({ errors, isDraggingOver: false });\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst newFileStateArray: DropZoneState[\"fileStateArray\"] = validFiles.map((file) => ({\n\t\t\t\t\tfile,\n\t\t\t\t\tid: generateFileID(file),\n\t\t\t\t\tpreview: createObjectURL(file, disablePreviewGenForNonImageFiles),\n\t\t\t\t\tprogress: 0,\n\t\t\t\t\tstatus: \"idle\",\n\t\t\t\t}));\n\n\t\t\t\tset(\n\t\t\t\t\t{\n\t\t\t\t\t\terrors,\n\t\t\t\t\t\tfileStateArray:\n\t\t\t\t\t\t\t!multiple ? newFileStateArray : [...fileStateArray, ...newFileStateArray],\n\t\t\t\t\t\tisDraggingOver: false,\n\t\t\t\t\t},\n\t\t\t\t\t{ shouldNotifySync: true }\n\t\t\t\t);\n\n\t\t\t\tawait actions.handleFileUpload({ newFileStateArray });\n\t\t\t},\n\n\t\t\tclearErrors: () => {\n\t\t\t\tset({ errors: [], isInvalid: false });\n\t\t\t},\n\n\t\t\tclearFiles: () => {\n\t\t\t\tconst { actions } = get();\n\n\t\t\t\tactions.clearObjectURLs();\n\n\t\t\t\tset({ errors: [], fileStateArray: [], isInvalid: false });\n\t\t\t},\n\n\t\t\tclearObjectURLs: () => {\n\t\t\t\tconst { fileStateArray } = get();\n\n\t\t\t\tfor (const fileState of fileStateArray) {\n\t\t\t\t\tclearObjectURL(fileState, disablePreviewGenForNonImageFiles);\n\t\t\t\t}\n\t\t\t},\n\n\t\t\thandleChange: async (event) => {\n\t\t\t\tconst fileList = event.target.files;\n\n\t\t\t\tconst { actions } = get();\n\n\t\t\t\tawait actions.addFiles(fileList);\n\n\t\t\t\tclearInputValue();\n\t\t\t},\n\n\t\t\thandleDragEnter: (event) => {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tevent.stopPropagation();\n\n\t\t\t\tset({ isDraggingOver: true });\n\t\t\t},\n\n\t\t\thandleDragLeave: (event) => {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tevent.stopPropagation();\n\n\t\t\t\tset({ isDraggingOver: false });\n\t\t\t},\n\n\t\t\thandleDragOver: (event) => {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tevent.stopPropagation();\n\t\t\t},\n\n\t\t\thandleDrop: async (event) => {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tevent.stopPropagation();\n\n\t\t\t\tconst { actions } = get();\n\n\t\t\t\tconst fileList = event.dataTransfer.files;\n\n\t\t\t\tawait actions.addFiles(fileList);\n\t\t\t},\n\n\t\t\thandleFileUpload: async (context) => {\n\t\t\t\tconst { newFileStateArray } = context;\n\n\t\t\t\tconst { actions } = get();\n\n\t\t\t\tif (!onUpload) {\n\t\t\t\t\tfor (const fileState of newFileStateArray) {\n\t\t\t\t\t\tactions.updateFileState({ fileStateOrID: fileState, progress: 100, status: \"success\" });\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\ttry {\n\t\t\t\t\tawait onUpload({\n\t\t\t\t\t\tfileStateArray: newFileStateArray,\n\t\t\t\t\t\tonError: (ctx) => {\n\t\t\t\t\t\t\tconst { error, fileStateOrID } = ctx;\n\n\t\t\t\t\t\t\tconst errorContext = getErrorContext(error);\n\n\t\t\t\t\t\t\tactions.updateFileState({ error: errorContext, fileStateOrID, status: \"error\" });\n\t\t\t\t\t\t},\n\t\t\t\t\t\tonProgress: (ctx) => {\n\t\t\t\t\t\t\tconst { fileStateOrID, progress } = ctx;\n\n\t\t\t\t\t\t\tactions.updateFileState({ fileStateOrID, progress });\n\t\t\t\t\t\t},\n\t\t\t\t\t\tonSuccess: (ctx) => {\n\t\t\t\t\t\t\tconst { fileStateOrID } = ctx;\n\n\t\t\t\t\t\t\tactions.updateFileState({ fileStateOrID, progress: 100, status: \"success\" });\n\t\t\t\t\t\t},\n\t\t\t\t\t});\n\n\t\t\t\t\t// Handle Errors\n\t\t\t\t} catch (error) {\n\t\t\t\t\tconst errorContext = getErrorContext(error as Error);\n\n\t\t\t\t\tfor (const fileState of newFileStateArray) {\n\t\t\t\t\t\tactions.updateFileState({\n\t\t\t\t\t\t\terror: errorContext,\n\t\t\t\t\t\t\tfileStateOrID: fileState,\n\t\t\t\t\t\t\tstatus: \"error\",\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\t// set((prevState) => ({ errors: [...prevState.errors, errorContext] }));\n\t\t\t\t}\n\t\t\t},\n\n\t\t\thandleKeyDown: (event) => {\n\t\t\t\tconst isEnterKey = event.key === \"Enter\";\n\t\t\t\tconst isSpaceKey = event.key === \" \";\n\n\t\t\t\tconst isAllowedKey = isEnterKey || isSpaceKey;\n\n\t\t\t\tif (!isAllowedKey) return;\n\n\t\t\t\tevent.preventDefault();\n\n\t\t\t\tconst { actions } = get();\n\n\t\t\t\tactions.openFilePicker();\n\t\t\t},\n\n\t\t\thandlePaste: async (event) => {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tevent.stopPropagation();\n\n\t\t\t\tconst { actions } = get();\n\n\t\t\t\tconst fileList = event.clipboardData.files;\n\n\t\t\t\tawait actions.addFiles(fileList);\n\t\t\t},\n\n\t\t\topenFilePicker: () => {\n\t\t\t\tinputRef.current?.click();\n\t\t\t},\n\n\t\t\tremoveFile: (ctx) => {\n\t\t\t\tconst { fileStateOrID } = ctx;\n\n\t\t\t\tconst { fileStateArray } = get();\n\n\t\t\t\tconst updatedFileStateArray = fileStateArray.filter((fileState) => {\n\t\t\t\t\tif (!isMatchingFile({ fileState, fileStateOrID })) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\n\t\t\t\t\tclearObjectURL(fileState, disablePreviewGenForNonImageFiles);\n\n\t\t\t\t\treturn false;\n\t\t\t\t});\n\n\t\t\t\tset({ errors: [], fileStateArray: updatedFileStateArray });\n\t\t\t},\n\n\t\t\tupdateFileState: (ctx) => {\n\t\t\t\tconst { fileStateOrID, ...updatedFileState } = ctx;\n\n\t\t\t\tconst { fileStateArray } = get();\n\n\t\t\t\tconst updatedFileStateArray: DropZoneState[\"fileStateArray\"] = fileStateArray.map(\n\t\t\t\t\t(fileState) => {\n\t\t\t\t\t\tif (isMatchingFile({ fileState, fileStateOrID })) {\n\t\t\t\t\t\t\treturn { ...fileState, ...updatedFileState };\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn fileState;\n\t\t\t\t\t}\n\t\t\t\t);\n\n\t\t\t\t// const updatedErrorsState =\n\t\t\t\t// \tupdatedFileState.error ?\n\t\t\t\t// \t\t{ errors: [...errors, updatedFileState.error] satisfies DropZoneState[\"errors\"] }\n\t\t\t\t// \t:\tnull;\n\n\t\t\t\tset({ fileStateArray: updatedFileStateArray }, { shouldNotifySync: true });\n\t\t\t},\n\t\t},\n\t}));\n\n\t// == File change subscription\n\tstore.subscribe.withSelector(\n\t\t(state) => state.fileStateArray,\n\t\t(fileStateArray) => onFilesChange?.({ fileStateArray })\n\t);\n\n\t// == Set `isInvalid` to true if there are errors\n\tstore.subscribe.withSelector(\n\t\t(state) => state.errors,\n\t\t(errors) => {\n\t\t\tif (errors.length === 0) return;\n\n\t\t\tstore.setState({ isInvalid: true });\n\n\t\t\t// == Reset to false after 1.5 seconds\n\t\t\tsetTimeout(() => store.setState({ isInvalid: false }), 1500);\n\t\t}\n\t);\n\n\treturn store;\n};\n","import { dataAttr } from \"@zayne-labs/toolkit-core\";\nimport {\n\tuseCallbackRef,\n\tuseConstant,\n\tuseShallowCompValue,\n\tuseStore,\n\tuseUnmountEffect,\n} from \"@zayne-labs/toolkit-react\";\nimport { composeRefs, composeTwoEventHandlers } from \"@zayne-labs/toolkit-react/utils\";\nimport { useCallback, useMemo, useRef } from \"react\";\nimport { cnMerge } from \"@/lib/utils/cn\";\nimport { createDropZoneStore } from \"./drop-zone-store\";\nimport type { DropZonePropGetters, UseDropZoneProps, UseDropZoneResult } from \"./types\";\nimport { getScopeAttrs } from \"./utils\";\n\nexport const useDropZone = (props?: UseDropZoneProps): UseDropZoneResult => {\n\tconst {\n\t\tallowedFileTypes,\n\t\tdisabled = false,\n\t\tdisableFilePickerOpenOnAreaClick = false,\n\t\tdisableInternalStateSubscription = false,\n\t\tdisablePreviewGenForNonImageFiles = true,\n\t\tinitialFiles,\n\t\tmaxFileCount,\n\t\tmaxFileSize,\n\t\tmultiple,\n\t\tonFilesChange,\n\t\tonUpload,\n\t\tonValidationError,\n\t\tonValidationSuccess,\n\t\trejectDuplicateFiles = true,\n\t\tvalidator,\n\t} = props ?? {};\n\n\tconst inputRef = useRef<HTMLInputElement>(null);\n\n\tconst isOnUploadFnProvided = onUpload !== undefined;\n\tconst stableOnFilesChange = useCallbackRef(onFilesChange);\n\tconst stableOnUpload = useCallbackRef(onUpload);\n\tconst stableOnUploadError = useCallbackRef(onValidationError);\n\tconst stableOnUploadSuccess = useCallbackRef(onValidationSuccess);\n\tconst stableValidator = useCallbackRef(validator);\n\n\tconst constantInitialFiles = useConstant(() => initialFiles);\n\tconst shallowComparedMaxFileSize = useShallowCompValue(maxFileSize);\n\tconst shallowComparedAllowedFileTypes = useShallowCompValue(allowedFileTypes);\n\n\tconst storeApi = useMemo(() => {\n\t\treturn createDropZoneStore({\n\t\t\tallowedFileTypes: shallowComparedAllowedFileTypes,\n\t\t\tdisablePreviewGenForNonImageFiles,\n\t\t\tinitialFiles: constantInitialFiles,\n\t\t\tinputRef,\n\t\t\tmaxFileCount,\n\t\t\tmaxFileSize: shallowComparedMaxFileSize,\n\t\t\tmultiple,\n\t\t\tonFilesChange: stableOnFilesChange,\n\t\t\tonUpload: isOnUploadFnProvided ? stableOnUpload : undefined,\n\t\t\tonValidationError: stableOnUploadError,\n\t\t\tonValidationSuccess: stableOnUploadSuccess,\n\t\t\trejectDuplicateFiles,\n\t\t\tvalidator: stableValidator,\n\t\t});\n\t}, [\n\t\tshallowComparedAllowedFileTypes,\n\t\tdisablePreviewGenForNonImageFiles,\n\t\tconstantInitialFiles,\n\t\tmaxFileCount,\n\t\tshallowComparedMaxFileSize,\n\t\tmultiple,\n\t\tstableOnFilesChange,\n\t\tisOnUploadFnProvided,\n\t\tstableOnUpload,\n\t\tstableOnUploadError,\n\t\tstableOnUploadSuccess,\n\t\trejectDuplicateFiles,\n\t\tstableValidator,\n\t]);\n\n\tconst actions = storeApi.getState().actions;\n\n\tuseUnmountEffect(() => {\n\t\tactions.clearObjectURLs();\n\t});\n\n\tconst useDropZoneStore: UseDropZoneResult[\"useDropZoneStore\"] = (selector) => {\n\t\treturn useStore(storeApi, selector);\n\t};\n\n\tconst isDraggingOver = useDropZoneStore((state) =>\n\t\t!disableInternalStateSubscription ? state.isDraggingOver : null\n\t);\n\n\tconst hasFiles = useDropZoneStore((state) =>\n\t\t!disableInternalStateSubscription ? state.fileStateArray.length > 0 : null\n\t);\n\n\tconst isInvalid = useDropZoneStore((state) =>\n\t\t!disableInternalStateSubscription ? state.isInvalid : null\n\t);\n\n\tconst getContainerProps: UseDropZoneResult[\"propGetters\"][\"getContainerProps\"] = useCallback(\n\t\t(innerProps) => {\n\t\t\tconst isDisabled = disabled;\n\t\t\tconst onFileDrop = !isDisabled ? actions.handleDrop : undefined;\n\t\t\tconst onFilePaste = !isDisabled ? actions.handlePaste : undefined;\n\t\t\tconst tabIndex = !isDisabled ? 0 : undefined;\n\t\t\tconst onAreaClick =\n\t\t\t\t!isDisabled && !disableFilePickerOpenOnAreaClick ? actions.openFilePicker : undefined;\n\t\t\tconst onKeyDown =\n\t\t\t\t!isDisabled && !disableFilePickerOpenOnAreaClick ? actions.handleKeyDown : undefined;\n\n\t\t\treturn {\n\t\t\t\t...getScopeAttrs(\"container\"),\n\t\t\t\trole: \"region\",\n\t\t\t\t...(!disableInternalStateSubscription && {\n\t\t\t\t\t\"data-drag-over\": dataAttr(isDraggingOver),\n\t\t\t\t\t\"data-invalid\": dataAttr(isInvalid),\n\t\t\t\t}),\n\t\t\t\t...innerProps,\n\t\t\t\tclassName: cnMerge(\n\t\t\t\t\t`relative flex flex-col items-center justify-center gap-2 rounded-lg border-2 border-dashed\n\t\t\t\t\tp-6 transition-colors duration-250 ease-out outline-none select-none\n\t\t\t\t\tfocus-visible:border-zu-ring/50`,\n\t\t\t\t\t`data-[disabled]:pointer-events-none data-[drag-over]:opacity-60\n\t\t\t\t\tdata-[invalid]:border-zu-destructive data-[invalid]:ring-zu-destructive/20`,\n\t\t\t\t\tinnerProps.className\n\t\t\t\t),\n\t\t\t\t\"data-disabled\": dataAttr(isDisabled),\n\t\t\t\tonClick: composeTwoEventHandlers(onAreaClick, innerProps.onClick),\n\t\t\t\tonDragEnter: composeTwoEventHandlers(actions.handleDragEnter, innerProps.onDragEnter),\n\t\t\t\tonDragLeave: composeTwoEventHandlers(actions.handleDragLeave, innerProps.onDragLeave),\n\t\t\t\tonDragOver: composeTwoEventHandlers(actions.handleDragOver, innerProps.onDragOver),\n\t\t\t\tonDrop: composeTwoEventHandlers(onFileDrop, innerProps.onDrop),\n\t\t\t\tonKeyDown: composeTwoEventHandlers(onKeyDown, innerProps.onKeyDown),\n\t\t\t\tonPaste: composeTwoEventHandlers(onFilePaste, innerProps.onPaste),\n\t\t\t\ttabIndex,\n\t\t\t};\n\t\t},\n\t\t[\n\t\t\tactions.handleDragEnter,\n\t\t\tactions.handleDragLeave,\n\t\t\tactions.handleDragOver,\n\t\t\tactions.handleDrop,\n\t\t\tactions.handleKeyDown,\n\t\t\tactions.handlePaste,\n\t\t\tactions.openFilePicker,\n\t\t\tdisableInternalStateSubscription,\n\t\t\tdisabled,\n\t\t\tisDraggingOver,\n\t\t\tisInvalid,\n\t\t\tdisableFilePickerOpenOnAreaClick,\n\t\t]\n\t);\n\n\tconst getInputProps: UseDropZoneResult[\"propGetters\"][\"getInputProps\"] = useCallback(\n\t\t(innerProps) => {\n\t\t\tconst isDisabled = innerProps.disabled ?? disabled;\n\n\t\t\tconst onFileChange = !isDisabled ? actions.handleChange : undefined;\n\n\t\t\treturn {\n\t\t\t\t...getScopeAttrs(\"input\"),\n\t\t\t\t...(!disableInternalStateSubscription && { \"data-drag-over\": dataAttr(isDraggingOver) }),\n\t\t\t\t...innerProps,\n\t\t\t\taccept: allowedFileTypes ? allowedFileTypes.join(\", \") : innerProps.accept,\n\t\t\t\tclassName: cnMerge(\"hidden\", innerProps.className),\n\t\t\t\t\"data-disabled\": dataAttr(isDisabled),\n\t\t\t\tdisabled: isDisabled,\n\t\t\t\tmultiple: multiple ?? innerProps.multiple,\n\t\t\t\tonChange: composeTwoEventHandlers(onFileChange, innerProps.onChange),\n\t\t\t\tref: composeRefs(inputRef, innerProps.ref),\n\t\t\t\ttype: \"file\",\n\t\t\t};\n\t\t},\n\t\t[\n\t\t\tactions.handleChange,\n\t\t\tallowedFileTypes,\n\t\t\tdisableInternalStateSubscription,\n\t\t\tdisabled,\n\t\t\tisDraggingOver,\n\t\t\tmultiple,\n\t\t]\n\t);\n\n\tconst getTriggerProps: UseDropZoneResult[\"propGetters\"][\"getTriggerProps\"] = useCallback(\n\t\t(innerProps) => {\n\t\t\tconst isDisabled = innerProps.disabled ?? disabled;\n\n\t\t\treturn {\n\t\t\t\t...getScopeAttrs(\"trigger\"),\n\t\t\t\ttype: \"button\",\n\t\t\t\t...innerProps,\n\t\t\t\t\"data-disabled\": dataAttr(isDisabled),\n\t\t\t\tdisabled: isDisabled,\n\t\t\t\tonClick: composeTwoEventHandlers(actions.openFilePicker, innerProps.onClick),\n\t\t\t};\n\t\t},\n\t\t[actions.openFilePicker, disabled]\n\t);\n\n\tconst getFileListProps: UseDropZoneResult[\"propGetters\"][\"getFileListProps\"] = useCallback(\n\t\t(innerProps) => {\n\t\t\tconst { orientation = \"vertical\", ...restOfInnerProps } = innerProps;\n\n\t\t\treturn {\n\t\t\t\t...getScopeAttrs(\"file-list\"),\n\t\t\t\t\"data-orientation\": orientation,\n\t\t\t\t...(!disableInternalStateSubscription && { \"data-state\": hasFiles ? \"active\" : \"inactive\" }),\n\t\t\t\t...restOfInnerProps,\n\t\t\t\tclassName: cnMerge(\n\t\t\t\t\t\"flex flex-col gap-2 data-[state=active]:animate-files-in\",\n\t\t\t\t\torientation === \"horizontal\" && \"flex-row overflow-x-auto p-1.5\",\n\t\t\t\t\tinnerProps.className\n\t\t\t\t),\n\t\t\t};\n\t\t},\n\t\t[disableInternalStateSubscription, hasFiles]\n\t);\n\n\tconst getFileItemProps: UseDropZoneResult[\"propGetters\"][\"getFileItemProps\"] = useCallbackRef(\n\t\t(innerProps) => {\n\t\t\treturn {\n\t\t\t\t...getScopeAttrs(\"file-item\"),\n\t\t\t\t...innerProps,\n\t\t\t\tclassName: cnMerge(\n\t\t\t\t\t\"relative flex items-center gap-2.5 rounded-md border p-2\",\n\t\t\t\t\tinnerProps.className\n\t\t\t\t),\n\t\t\t};\n\t\t}\n\t);\n\n\tconst getFileItemProgressProps: UseDropZoneResult[\"propGetters\"][\"getFileItemProgressProps\"] =\n\t\tuseCallbackRef((innerProps) => {\n\t\t\tconst { variant = \"linear\", ...restOfInnerProps } = innerProps;\n\n\t\t\treturn {\n\t\t\t\t...getScopeAttrs(\"file-item-progress\"),\n\t\t\t\trole: \"progressbar\",\n\t\t\t\t...restOfInnerProps,\n\t\t\t\tclassName: cnMerge(\n\t\t\t\t\t\"inline-flex\",\n\t\t\t\t\tvariant === \"circular\" && \"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2\",\n\t\t\t\t\tvariant === \"fill\"\n\t\t\t\t\t\t&& `absolute inset-0 bg-zu-primary/50 transition-[clip-path] duration-300 ease-linear\n\t\t\t\t\t\t[clip-path:var(--clip-path)]`,\n\t\t\t\t\tvariant === \"linear\"\n\t\t\t\t\t\t&& \"relative h-1.5 w-full overflow-hidden rounded-full bg-zu-primary/20\",\n\t\t\t\t\trestOfInnerProps.className\n\t\t\t\t),\n\t\t\t};\n\t\t});\n\n\tconst getFileItemDeleteProps: UseDropZoneResult[\"propGetters\"][\"getFileItemDeleteProps\"] = useCallback(\n\t\t(innerProps) => {\n\t\t\tconst { fileStateOrID, ...restOfInnerProps } = innerProps;\n\n\t\t\tconst isDisabled = innerProps.disabled ?? disabled;\n\n\t\t\tconst onRemoveFile = () => fileStateOrID && actions.removeFile({ fileStateOrID });\n\n\t\t\treturn {\n\t\t\t\t...getScopeAttrs(\"file-item-delete\"),\n\t\t\t\ttype: \"button\",\n\t\t\t\t...restOfInnerProps,\n\t\t\t\t\"data-disabled\": dataAttr(isDisabled),\n\t\t\t\tdisabled: isDisabled,\n\t\t\t\tonClick: composeTwoEventHandlers(onRemoveFile, restOfInnerProps.onClick),\n\t\t\t};\n\t\t},\n\t\t[actions, disabled]\n\t);\n\n\tconst getFileItemPreviewProps: UseDropZoneResult[\"propGetters\"][\"getFileItemPreviewProps\"] =\n\t\tuseCallbackRef((innerProps) => {\n\t\t\treturn {\n\t\t\t\t...getScopeAttrs(\"file-item-preview\"),\n\t\t\t\t...innerProps,\n\t\t\t\tclassName: cnMerge(\n\t\t\t\t\t`relative flex size-10 shrink-0 items-center justify-center overflow-hidden rounded-md\n\t\t\t\t\tbg-zu-accent/50 [&>svg]:size-10`,\n\t\t\t\t\tinnerProps.className\n\t\t\t\t),\n\t\t\t};\n\t\t});\n\n\tconst getFileItemMetadataProps: UseDropZoneResult[\"propGetters\"][\"getFileItemMetadataProps\"] =\n\t\tuseCallbackRef((innerProps) => {\n\t\t\treturn {\n\t\t\t\t...getScopeAttrs(\"file-item-metadata\"),\n\t\t\t\t...innerProps,\n\t\t\t\tclassName: cnMerge(\"flex min-w-0 grow flex-col\", innerProps.className),\n\t\t\t};\n\t\t});\n\n\tconst getFileItemClearProps: UseDropZoneResult[\"propGetters\"][\"getFileItemClearProps\"] = useCallback(\n\t\t(innerProps) => {\n\t\t\tconst isDisabled = innerProps.disabled ?? disabled;\n\n\t\t\treturn {\n\t\t\t\t...getScopeAttrs(\"file-item-clear\"),\n\t\t\t\ttype: \"button\",\n\t\t\t\t...innerProps,\n\t\t\t\t\"data-disabled\": dataAttr(isDisabled),\n\t\t\t\tdisabled: isDisabled,\n\t\t\t\tonClick: composeTwoEventHandlers(actions.clearFiles, innerProps.onClick),\n\t\t\t};\n\t\t},\n\t\t[actions.clearFiles, disabled]\n\t);\n\n\tconst propGetters = useMemo<DropZonePropGetters>(\n\t\t() =>\n\t\t\t({\n\t\t\t\tgetContainerProps,\n\t\t\t\tgetFileItemClearProps,\n\t\t\t\tgetFileItemDeleteProps,\n\t\t\t\tgetFileItemMetadataProps,\n\t\t\t\tgetFileItemPreviewProps,\n\t\t\t\tgetFileItemProgressProps,\n\t\t\t\tgetFileItemProps,\n\t\t\t\tgetFileListProps,\n\t\t\t\tgetInputProps,\n\t\t\t\tgetTriggerProps,\n\t\t\t}) satisfies DropZonePropGetters,\n\t\t[\n\t\t\tgetContainerProps,\n\t\t\tgetFileListProps,\n\t\t\tgetFileItemClearProps,\n\t\t\tgetFileItemDeleteProps,\n\t\t\tgetFileItemMetadataProps,\n\t\t\tgetFileItemPreviewProps,\n\t\t\tgetFileItemProgressProps,\n\t\t\tgetFileItemProps,\n\t\t\tgetInputProps,\n\t\t\tgetTriggerProps,\n\t\t]\n\t);\n\n\tconst savedUseDropZoneStore = useCallbackRef(useDropZoneStore);\n\n\tconst result = useMemo<UseDropZoneResult>(\n\t\t() =>\n\t\t\t({\n\t\t\t\tdisabled,\n\t\t\t\tdisableInternalStateSubscription,\n\t\t\t\tinputRef,\n\t\t\t\tpropGetters,\n\t\t\t\tstoreApi,\n\t\t\t\tuseDropZoneStore: savedUseDropZoneStore,\n\t\t\t}) satisfies UseDropZoneResult,\n\t\t[disabled, disableInternalStateSubscription, propGetters, storeApi, savedUseDropZoneStore]\n\t);\n\n\treturn result;\n};\n","\"use client\";\n\nimport { dataAttr, formatBytes } from \"@zayne-labs/toolkit-core\";\nimport { useShallowCompSelector } from \"@zayne-labs/toolkit-react\";\nimport type {\n\tCssWithCustomProperties,\n\tInferProps,\n\tPolymorphicPropsStrict,\n} from \"@zayne-labs/toolkit-react/utils\";\nimport {\n\ttype AnyFunction,\n\tisBoolean,\n\tisFunction,\n\tisNumber,\n\ttype SelectorFn,\n} from \"@zayne-labs/toolkit-type-helpers\";\n\nimport { For } from \"@/components/common/for\";\nimport { Presence } from \"@/components/common/presence\";\nimport { Slot } from \"@/components/common/slot\";\nimport { cnMerge } from \"@/lib/utils/cn\";\nimport { useMemo } from \"react\";\nimport {\n\tDropZoneRootContextProvider,\n\ttype DropZoneRootContextType,\n\tDropZoneStoreContextProvider,\n\tFileItemContextProvider,\n\ttype FileItemContextType,\n\tuseDropZoneRootContext,\n\tuseDropZoneStoreContext,\n\tuseFileItemContext,\n} from \"./drop-zone-context\";\nimport {\n\tFileArchiveIcon,\n\tFileAudioIcon,\n\tFileCodeIcon,\n\tFileCogIcon,\n\tFileIcon,\n\tFileTextIcon,\n\tFileVideoIcon,\n} from \"./icons\";\nimport type { DropZoneStore, PartInputProps, UseDropZoneProps } from \"./types\";\nimport { useDropZone } from \"./use-drop-zone\";\n\ntype DropZoneRootProps = UseDropZoneProps & { children: React.ReactNode };\n\nexport function DropZoneRoot(props: DropZoneRootProps) {\n\tconst { children, ...restOfProps } = props;\n\n\tconst { disabled, disableInternalStateSubscription, inputRef, propGetters, storeApi } =\n\t\tuseDropZone(restOfProps);\n\n\tconst rootContextValue = useMemo<DropZoneRootContextType>(\n\t\t() =>\n\t\t\t({\n\t\t\t\tdisabled,\n\t\t\t\tdisableInternalStateSubscription,\n\t\t\t\tinputRef,\n\t\t\t\tpropGetters,\n\t\t\t}) satisfies DropZoneRootContextType,\n\t\t[disableInternalStateSubscription, disabled, inputRef, propGetters]\n\t);\n\n\treturn (\n\t\t<DropZoneStoreContextProvider store={storeApi}>\n\t\t\t<DropZoneRootContextProvider value={rootContextValue}>{children}</DropZoneRootContextProvider>\n\t\t</DropZoneStoreContextProvider>\n\t);\n}\n\ntype DropZoneContextProps<TSlice> = {\n\tchildren: React.ReactNode | ((context: TSlice) => React.ReactNode);\n\tselector?: SelectorFn<DropZoneStore, TSlice>;\n};\n\nexport function DropZoneContext<TSlice = DropZoneStore>(props: DropZoneContextProps<TSlice>) {\n\tconst { children, selector } = props;\n\n\tconst dropZoneCtx = useDropZoneStoreContext(useShallowCompSelector(selector));\n\n\tconst resolvedChildren = isFunction(children) ? children(dropZoneCtx) : children;\n\n\treturn resolvedChildren;\n}\n\ntype DropZoneContainerProps = PartInputProps[\"container\"] & { asChild?: boolean };\n\nexport function DropZoneContainer<TElement extends React.ElementType = \"div\">(\n\tprops: PolymorphicPropsStrict<TElement, DropZoneContainerProps>\n) {\n\tconst { as: Element = \"div\", asChild, ...restOfProps } = props;\n\n\tconst { disableInternalStateSubscription, propGetters } = useDropZoneRootContext();\n\n\tconst isDraggingOver = useDropZoneStoreContext((store) =>\n\t\tdisableInternalStateSubscription ? store.isDraggingOver : null\n\t);\n\n\tconst isInvalid = useDropZoneStoreContext((store) =>\n\t\tdisableInternalStateSubscription ? store.isInvalid : null\n\t);\n\n\tconst Component = asChild ? Slot.Root : Element;\n\n\treturn (\n\t\t<Component\n\t\t\t{...propGetters.getContainerProps({\n\t\t\t\t...(disableInternalStateSubscription && {\n\t\t\t\t\t\"data-drag-over\": dataAttr(isDraggingOver),\n\t\t\t\t\t\"data-invalid\": dataAttr(isInvalid),\n\t\t\t\t}),\n\t\t\t\t...restOfProps,\n\t\t\t})}\n\t\t/>\n\t);\n}\n\ntype DropZoneInputProps = PartInputProps[\"input\"] & { asChild?: boolean };\n\nexport function DropZoneInput(props: DropZoneInputProps) {\n\tconst { asChild, ...restOfProps } = props;\n\n\tconst { disableInternalStateSubscription, propGetters } = useDropZoneRootContext();\n\n\tconst isDraggingOver = useDropZoneStoreContext((store) =>\n\t\tdisableInternalStateSubscription ? store.isDraggingOver : null\n\t);\n\n\tconst Component = asChild ? Slot.Root : \"input\";\n\n\treturn (\n\t\t<Component\n\t\t\t{...propGetters.getInputProps({\n\t\t\t\t...(disableInternalStateSubscription && { \"data-drag-over\": dataAttr(isDraggingOver) }),\n\t\t\t\t...restOfProps,\n\t\t\t})}\n\t\t/>\n\t);\n}\n\ntype DropZoneAreaProps<TSlice> = DropZoneContextProps<TSlice>\n\t& PartInputProps[\"container\"] & {\n\t\tclassNames?: Partial<Record<Extract<keyof PartInputProps, \"container\" | \"input\">, string>>;\n\t\textraProps?: Partial<Pick<PartInputProps, \"container\" | \"input\">>;\n\t};\n\nexport function DropZoneArea<TSlice = DropZoneStore>(props: DropZoneAreaProps<TSlice>) {\n\tconst { children, className, classNames, extraProps, selector, ...restOfProps } = props;\n\n\treturn (\n\t\t<DropZoneContainer\n\t\t\t{...extraProps?.container}\n\t\t\t{...restOfProps}\n\t\t\tclassName={cnMerge(extraProps?.container?.className, className, classNames?.container)}\n\t\t>\n\t\t\t<DropZoneInput\n\t\t\t\t{...extraProps?.input}\n\t\t\t\tclassName={cnMerge(extraProps?.input?.className, classNames?.input)}\n\t\t\t/>\n\n\t\t\t<DropZoneContext selector={selector}>{children}</DropZoneContext>\n\t\t</DropZoneContainer>\n\t);\n}\n\ntype DropZoneTriggerProps = PartInputProps[\"trigger\"] & { asChild?: boolean };\n\nexport function DropZoneTrigger(props: DropZoneTriggerProps) {\n\tconst { asChild, ...restOfProps } = props;\n\n\tconst { propGetters } = useDropZoneRootContext();\n\n\tconst Component = asChild ? Slot.Root : \"button\";\n\n\treturn <Component {...propGetters.getTriggerProps(restOfProps)} />;\n}\n\ntype ListPerItemContext = Pick<DropZoneStore, \"actions\"> & {\n\tarray: DropZoneStore[\"fileStateArray\"];\n\tfileState: DropZoneStore[\"fileStateArray\"][number];\n\tindex: number;\n};\n\ntype FileListPerItemVariant = {\n\tchildren: React.ReactNode | ((context: ListPerItemContext) => React.ReactNode);\n\trenderMode?: \"per-item\";\n};\n\ntype ListManualListContext = Pick<DropZoneStore, \"actions\" | \"fileStateArray\">;\n\ntype FileListManualListVariant = {\n\tchildren: React.ReactNode | ((context: ListManualListContext) => React.ReactNode);\n\trenderMode: \"manual-list\";\n};\n\ntype DropZoneFileListProps = Omit<PartInputProps[\"fileList\"], \"children\"> & {\n\tasChild?: boolean;\n\tforceMount?: boolean;\n} & (FileListManualListVariant | FileListPerItemVariant);\n\nexport function DropZoneFileList<TElement extends React.ElementType = \"ul\">(\n\tprops: PolymorphicPropsStrict<TElement, DropZoneFileListProps>\n) {\n\tconst {\n\t\tas: Element = \"ul\",\n\t\tasChild,\n\t\tchildren,\n\t\tforceMount = false,\n\t\trenderMode = \"per-item\",\n\t\t...restOfProps\n\t} = props;\n\n\tconst fileStateArray = useDropZoneStoreContext((store) => store.fileStateArray);\n\tconst actions = useDropZoneStoreContext((store) => store.actions);\n\n\tconst { disableInternalStateSubscription, propGetters } = useDropZoneRootContext();\n\n\tconst childrenMap = {\n\t\t\"manual-list\": () => {\n\t\t\tconst childrenFn = children as Extract<FileListManualListVariant[\"children\"], AnyFunction>;\n\t\t\treturn childrenFn({ actions, fileStateArray });\n\t\t},\n\t\t\"per-item\": () => {\n\t\t\tconst childrenFn = children as Extract<FileListPerItemVariant[\"children\"], AnyFunction>;\n\n\t\t\treturn (\n\t\t\t\t<For\n\t\t\t\t\teach={fileStateArray}\n\t\t\t\t\trenderItem={(fileState, index, array) => childrenFn({ actions, array, fileState, index })}\n\t\t\t\t/>\n\t\t\t);\n\t\t},\n\t} satisfies Record<typeof renderMode, () => React.ReactNode>;\n\n\tconst hasFiles = fileStateArray.length > 0;\n\n\tconst Component = asChild ? Slot.Root : Element;\n\n\treturn (\n\t\t<Presence present={hasFiles} forceMount={forceMount}>\n\t\t\t<Component\n\t\t\t\t{...propGetters.getFileListProps({\n\t\t\t\t\t...(disableInternalStateSubscription && { \"data-state\": hasFiles ? \"active\" : \"inactive\" }),\n\t\t\t\t\t...restOfProps,\n\t\t\t\t})}\n\t\t\t>\n\t\t\t\t{isFunction(children) ? childrenMap[renderMode]() : children}\n\t\t\t</Component>\n\t\t</Presence>\n\t);\n}\n\ntype DropZoneFileItemProps = FileItemContextType & PartInputProps[\"fileItem\"] & { asChild?: boolean };\n\nexport function DropZoneFileItem<TElement extends React.ElementType = \"li\">(\n\tprops: PolymorphicPropsStrict<TElement, DropZoneFileItemProps>\n) {\n\tconst { as: Element = \"li\", asChild, fileState, ...restOfProps } = props;\n\n\tconst { propGetters } = useDropZoneRootContext();\n\n\tconst Component = asChild ? Slot.Root : Element;\n\n\tconst contextValue = useMemo<FileItemContextType>(\n\t\t() => ({ fileState }) satisfies FileItemContextType,\n\t\t[fileState]\n\t);\n\n\treturn (\n\t\t<FileItemContextProvider value={contextValue}>\n\t\t\t<Component {...propGetters.getFileItemProps(restOfProps)} />\n\t\t</FileItemContextProvider>\n\t);\n}\n\ntype DropZoneFileItemDeleteProps = PartInputProps[\"fileItemDelete\"] & { asChild?: boolean };\n\nexport function DropZoneFileItemDelete(props: DropZoneFileItemDeleteProps) {\n\tconst { asChild, fileStateOrID, ...restOfProps } = props;\n\n\tconst { propGetters } = useDropZoneRootContext();\n\n\tconst fileItemContextValue = useFileItemContext();\n\n\tconst Component = asChild ? Slot.Root : \"button\";\n\n\tconst resolvedFileStateOrID = fileStateOrID ?? fileItemContextValue?.fileState;\n\n\treturn (\n\t\t<Component\n\t\t\t{...propGetters.getFileItemDeleteProps({ fileStateOrID: resolvedFileStateOrID, ...restOfProps })}\n\t\t/>\n\t);\n}\n\ntype DropZoneFileItemProgressProps = PartInputProps[\"fileItemProgress\"] & {\n\tasChild?: boolean;\n\tforceMount?: boolean;\n\tsize?: number;\n};\n\nexport function DropZoneFileItemProgress<TElement extends React.ElementType = \"span\">(\n\tprops: PolymorphicPropsStrict<TElement, DropZoneFileItemProgressProps>\n) {\n\tconst {\n\t\tas: Element = \"span\",\n\t\tasChild,\n\t\tforceMount = false,\n\t\tsize = 40,\n\t\tvariant = \"linear\",\n\t\t...restOfProps\n\t} = props;\n\n\tconst fileItemContextValue = useFileItemContext();\n\n\tconst fileState = fileItemContextValue?.fileState;\n\n\tconst { propGetters } = useDropZoneRootContext();\n\n\tif (!fileState) {\n\t\treturn null;\n\t}\n\n\tconst currentProgress = fileState.progress;\n\n\tconst shouldRender = forceMount || fileState.progress !== 100;\n\n\tif (!shouldRender) {\n\t\treturn null;\n\t}\n\n\tconst Component = asChild ? Slot.Root : Element;\n\n\tconst componentProps = propGetters.getFileItemProgressProps({ variant, ...restOfProps });\n\n\tswitch (variant) {\n\t\tcase \"circular\": {\n\t\t\tconst circumference = 2 * Math.PI * ((size - 4) / 2);\n\t\t\tconst strokeDashoffset = circumference - (currentProgress / 100) * circumference;\n\n\t\t\treturn (\n\t\t\t\t<Component {...componentProps}>\n\t\t\t\t\t<svg\n\t\t\t\t\t\tclassName=\"-rotate-90\"\n\t\t\t\t\t\twidth={size}\n\t\t\t\t\t\theight={size}\n\t\t\t\t\t\tviewBox={`0 0 ${size} ${size}`}\n\t\t\t\t\t\tfill=\"none\"\n\t\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<circle\n\t\t\t\t\t\t\tclassName=\"text-zu-primary/20\"\n\t\t\t\t\t\t\tstrokeWidth=\"2\"\n\t\t\t\t\t\t\tcx={size / 2}\n\t\t\t\t\t\t\tcy={size / 2}\n\t\t\t\t\t\t\tr={(size - 4) / 2}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<circle\n\t\t\t\t\t\t\tclassName=\"text-zu-primary transition-[stroke-dashoffset] duration-300 ease-linear\"\n\t\t\t\t\t\t\tstrokeWidth=\"2\"\n\t\t\t\t\t\t\tstrokeLinecap=\"round\"\n\t\t\t\t\t\t\tstrokeDasharray={circumference}\n\t\t\t\t\t\t\tstrokeDashoffset={strokeDashoffset}\n\t\t\t\t\t\t\tcx={size / 2}\n\t\t\t\t\t\t\tcy={size / 2}\n\t\t\t\t\t\t\tr={(size - 4) / 2}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</svg>\n\t\t\t\t</Component>\n\t\t\t);\n\t\t}\n\n\t\tcase \"fill\": {\n\t\t\tconst topInset = 100 - currentProgress;\n\n\t\t\treturn (\n\t\t\t\t<Component\n\t\t\t\t\t{...componentProps}\n\t\t\t\t\tstyle={\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"--clip-path\": `inset(${topInset}% 0% 0% 0%)`,\n\t\t\t\t\t\t} satisfies CssWithCustomProperties as CssWithCustomProperties\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\n\t\tcase \"linear\": {\n\t\t\treturn (\n\t\t\t\t<Component {...componentProps}>\n\t\t\t\t\t<span\n\t\t\t\t\t\tclassName=\"inline-block size-full grow translate-x-(--translate-distance) bg-zu-primary transition-transform duration-300 ease-linear\"\n\t\t\t\t\t\tstyle={\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"--translate-distance\": `-${100 - currentProgress}%`,\n\t\t\t\t\t\t\t} satisfies CssWithCustomProperties as CssWithCustomProperties\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t</Component>\n\t\t\t);\n\t\t}\n\n\t\tdefault: {\n\t\t\tvariant satisfies never;\n\t\t\treturn null;\n\t\t}\n\t}\n}\n\ntype RenderPreviewDetails<TElement extends React.ElementType = \"svg\"> = { node?: React.ReactNode } & {\n\tprops?: InferProps<TElement>;\n};\n\ntype RenderPropContext = Pick<FileItemContextType, \"fileState\"> & {\n\tfileExtension: string;\n\tfileType: string;\n};\n\ntype RenderPreviewObject = {\n\tarchive?: RenderPreviewDetails;\n\taudio?: RenderPreviewDetails;\n\tcode?: RenderPreviewDetails;\n\tdefault?: RenderPreviewDetails;\n\texecutable?: RenderPreviewDetails;\n\timage?: RenderPreviewDetails<\"img\">;\n\ttext?: RenderPreviewDetails;\n\tvideo?: RenderPreviewDetails;\n};\ntype RenderPreviewFn = (context: RenderPropContext) => RenderPreviewObject;\n\ntype RenderPreview = RenderPreviewFn | RenderPreviewObject;\n\ntype DropZoneFileItemPreviewProps = Omit<PartInputProps[\"fileItemPreview\"], \"children\">\n\t& Partial<Pick<FileItemContextType, \"fileState\">> & {\n\t\tasChild?: boolean;\n\t\tchildren?:\n\t\t\t| React.ReactNode\n\t\t\t| ((context: RenderPropContext & { fallbackPreview: () => React.ReactNode }) => React.ReactNode);\n\t\trenderPreview?: boolean | RenderPreview;\n\t};\n\nexport function DropZoneFileItemPreview<TElement extends React.ElementType>(\n\tprops: PolymorphicPropsStrict<TElement, DropZoneFileItemPreviewProps>\n) {\n\tconst {\n\t\tas: Element = \"span\",\n\t\tasChild,\n\t\tchildren,\n\t\tfileState: fileStateProp,\n\t\trenderPreview = true,\n\t\t...restOfProps\n\t} = props;\n\n\tconst fileItemContextValue = useFileItemContext();\n\n\tconst { propGetters } = useDropZoneRootContext();\n\n\tconst fileState = fileStateProp ?? fileItemContextValue?.fileState;\n\n\tif (!fileState) {\n\t\treturn null;\n\t}\n\n\tconst fileType = fileState.file.type ?? \"\";\n\n\tconst fileExtension = fileState.file.name?.split(\".\").pop()?.toLowerCase() ?? \"\";\n\n\tconst Component = asChild ? Slot.Root : Element;\n\n\tconst fallbackPreview = () =>\n\t\tgetFilePreviewOrIcon({ fileExtension, fileState, fileType, renderPreview });\n\n\tconst resolvedChildren =\n\t\tisFunction(children) ? children({ fallbackPreview, fileExtension, fileState, fileType }) : children;\n\n\treturn (\n\t\t<Component {...propGetters.getFileItemPreviewProps(restOfProps)}>\n\t\t\t{renderPreview && fallbackPreview()}\n\t\t\t{resolvedChildren}\n\t\t</Component>\n\t);\n}\n\nconst getFilePreviewOrIcon = (\n\tcontext: Pick<Required<DropZoneFileItemPreviewProps>, \"renderPreview\"> & Required<RenderPropContext>\n) => {\n\tconst { fileExtension, fileState, fileType, renderPreview } = context;\n\n\tconst renderPreviewValue = isBoolean(renderPreview) ? {} : renderPreview;\n\n\tconst resolvedRenderPreviewObject =\n\t\tisFunction(renderPreviewValue) ?\n\t\t\trenderPreviewValue({ fileExtension, fileState, fileType })\n\t\t:\trenderPreviewValue;\n\n\tswitch (true) {\n\t\tcase fileType.startsWith(\"image/\"): {\n\t\t\treturn (\n\t\t\t\tresolvedRenderPreviewObject.image?.node ?? (\n\t\t\t\t\t<img\n\t\t\t\t\t\t{...resolvedRenderPreviewObject.image?.props}\n\t\t\t\t\t\tsrc={fileState.preview}\n\t\t\t\t\t\talt={fileState.file.name ?? \"\"}\n\t\t\t\t\t\tclassName={cnMerge(\n\t\t\t\t\t\t\t\"size-full object-cover\",\n\t\t\t\t\t\t\tresolvedRenderPreviewObject.image?.props?.className\n\t\t\t\t\t\t)}\n\t\t\t\t\t/>\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\tcase fileType.startsWith(\"video/\"): {\n\t\t\treturn (\n\t\t\t\tresolvedRenderPreviewObject.video?.node ?? (\n\t\t\t\t\t<FileVideoIcon\n\t\t\t\t\t\t{...resolvedRenderPreviewObject.video?.props}\n\t\t\t\t\t\tclassName={cnMerge(\n\t\t\t\t\t\t\t\"size-full object-cover\",\n\t\t\t\t\t\t\tresolvedRenderPreviewObject.video?.props?.className\n\t\t\t\t\t\t)}\n\t\t\t\t\t/>\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\tcase fileType.startsWith(\"audio/\"): {\n\t\t\treturn (\n\t\t\t\tresolvedRenderPreviewObject.audio?.node ?? (\n\t\t\t\t\t<FileAudioIcon\n\t\t\t\t\t\t{...resolvedRenderPreviewObject.audio?.props}\n\t\t\t\t\t\tclassName={cnMerge(\n\t\t\t\t\t\t\t\"size-full object-cover\",\n\t\t\t\t\t\t\tresolvedRenderPreviewObject.audio?.props?.className\n\t\t\t\t\t\t)}\n\t\t\t\t\t/>\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\tcase fileType.startsWith(\"text/\") || [\"md\", \"pdf\", \"rtf\", \"txt\"].includes(fileExtension): {\n\t\t\treturn (\n\t\t\t\tresolvedRenderPreviewObject.text?.node ?? (\n\t\t\t\t\t<FileTextIcon {...resolvedRenderPreviewObject.text?.props} />\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\tcase [\n\t\t\t\"c\",\n\t\t\t\"cpp\",\n\t\t\t\"cs\",\n\t\t\t\"css\",\n\t\t\t\"html\",\n\t\t\t\"java\",\n\t\t\t\"js\",\n\t\t\t\"json\",\n\t\t\t\"jsx\",\n\t\t\t\"php\",\n\t\t\t\"py\",\n\t\t\t\"rb\",\n\t\t\t\"ts\",\n\t\t\t\"tsx\",\n\t\t\t\"xml\",\n\t\t].includes(fileExtension): {\n\t\t\treturn (\n\t\t\t\tresolvedRenderPreviewObject.code?.node ?? (\n\t\t\t\t\t<FileCodeIcon {...resolvedRenderPreviewObject.code?.props} />\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\tcase [\"7z\", \"bz2\", \"gz\", \"rar\", \"tar\", \"zip\"].includes(fileExtension): {\n\t\t\treturn (\n\t\t\t\tresolvedRenderPreviewObject.archive?.node ?? (\n\t\t\t\t\t<FileArchiveIcon {...resolvedRenderPreviewObject.archive?.props} />\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\tcase [\"apk\", \"app\", \"deb\", \"exe\", \"msi\", \"rpm\"].includes(fileExtension): {\n\t\t\treturn (\n\t\t\t\tresolvedRenderPreviewObject.executable?.node ?? (\n\t\t\t\t\t<FileCogIcon {...resolvedRenderPreviewObject.executable?.props} />\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\tdefault: {\n\t\t\treturn (\n\t\t\t\tresolvedRenderPreviewObject.default?.node ?? (\n\t\t\t\t\t<FileIcon {...resolvedRenderPreviewObject.default?.props} />\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t}\n};\n\ntype DropZoneFileItemMetadataProps = Omit<PartInputProps[\"fileItemMetadata\"], \"children\">\n\t& Partial<Pick<FileItemContextType, \"fileState\">> & {\n\t\tasChild?: boolean;\n\t\tchildren?: React.ReactNode | ((context: Pick<FileItemContextType, \"fileState\">) => React.ReactNode);\n\t\tclassNames?: {\n\t\t\tname?: string;\n\t\t\tsize?: string;\n\t\t};\n\t\tsize?: \"default\" | \"sm\";\n\t};\n\nexport function DropZoneFileItemMetadata(props: DropZoneFileItemMetadataProps) {\n\tconst {\n\t\tasChild,\n\t\tchildren,\n\t\tclassNames,\n\t\tfileState: fileStateProp,\n\t\tsize = \"default\",\n\t\t...restOfProps\n\t} = props;\n\n\tconst fileItemContextValue = useFileItemContext();\n\n\tconst { propGetters } = useDropZoneRootContext();\n\n\tconst fileState = fileStateProp ?? fileItemContextValue?.fileState;\n\n\tif (!fileState) {\n\t\treturn null;\n\t}\n\n\tconst Component = asChild ? Slot.Root : \"div\";\n\n\tconst resolvedChildren = isFunction(children) ? children({ fileState }) : children;\n\n\tconst getDefaultMetadataChildren = () => {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<p\n\t\t\t\t\tclassName={cnMerge(\n\t\t\t\t\t\t\"truncate\",\n\t\t\t\t\t\tsize === \"default\" && \"text-[14px] font-medium\",\n\t\t\t\t\t\tsize === \"sm\" && \"text-[13px] leading-snug\",\n\t\t\t\t\t\tclassNames?.name\n\t\t\t\t\t)}\n\t\t\t\t>\n\t\t\t\t\t{fileState.file.name}\n\t\t\t\t</p>\n\t\t\t\t<p\n\t\t\t\t\tclassName={cnMerge(\n\t\t\t\t\t\t\"truncate text-zu-muted-foreground\",\n\t\t\t\t\t\tsize === \"default\" && \"text-[12px]\",\n\t\t\t\t\t\tsize === \"sm\" && \"text-[11px] leading-snug\",\n\t\t\t\t\t\tclassNames?.size\n\t\t\t\t\t)}\n\t\t\t\t>\n\t\t\t\t\t{isNumber(fileState.file.size) && formatBytes(fileState.file.size)}\n\t\t\t\t</p>\n\t\t\t\t{fileState.error && (\n\t\t\t\t\t<p className=\"text-[12px] text-zu-destructive\">{fileState.error.message}</p>\n\t\t\t\t)}\n\t\t\t</>\n\t\t);\n\t};\n\n\treturn (\n\t\t<Component {...propGetters.getFileItemMetadataProps(restOfProps)}>\n\t\t\t{resolvedChildren ?? getDefaultMetadataChildren()}\n\t\t</Component>\n\t);\n}\n\ntype DropZoneFileClearProps = PartInputProps[\"fileItemClear\"] & {\n\tasChild?: boolean;\n\tforceMount?: boolean;\n};\n\nexport function DropZoneFileClear(props: DropZoneFileClearProps) {\n\tconst { asChild, forceMount = false, ...restOfProps } = props;\n\n\tconst { propGetters } = useDropZoneRootContext();\n\n\tconst fileCount = useDropZoneStoreContext((state) => state.fileStateArray.length);\n\n\tconst shouldRender = forceMount || fileCount > 0;\n\n\tif (!shouldRender) {\n\t\treturn null;\n\t}\n\n\tconst Component = asChild ? Slot.Root : \"button\";\n\n\treturn <Component {...propGetters.getFileItemClearProps(restOfProps)} />;\n}\n","export {\n\tDropZoneArea as Area,\n\tDropZoneContainer as Container,\n\tDropZoneContext as Context,\n\tDropZoneFileClear as FileClear,\n\tDropZoneFileItem as FileItem,\n\tDropZoneFileItemDelete as FileItemDelete,\n\tDropZoneFileItemMetadata as FileItemMetadata,\n\tDropZoneFileItemPreview as FileItemPreview,\n\tDropZoneFileItemProgress as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AAS,aAAa,OAAO,GAAG,gBAAgB;CAExD,MAAM,EAAE,gBAAgB,wBAAwB;CAEhD,MAAM,YAAY,yBAAyB,UAAU,MAAM,eAAe,OAAO;AAIjF,KAAI,EAFiB,cAAc,YAAY,GAG9C,QAAO;AAKR,QAAO,oBAFW,UAAUD,WAAY,YAEtB,GAAI,YAAY,sBAAsB,YAAY,GAAI"}
1
+ {"version":3,"file":"index.js","names":["generateFileID","generateFileIDPrimitive","initFileStateArray: DropZoneState[\"fileStateArray\"]","newFileStateArray: DropZoneState[\"fileStateArray\"]","generateFileID","useDropZoneStore: UseDropZoneResult[\"useDropZoneStore\"]","getContainerProps: UseDropZoneResult[\"propGetters\"][\"getContainerProps\"]","getInputProps: UseDropZoneResult[\"propGetters\"][\"getInputProps\"]","getTriggerProps: UseDropZoneResult[\"propGetters\"][\"getTriggerProps\"]","getFileListProps: UseDropZoneResult[\"propGetters\"][\"getFileListProps\"]","getFileItemProps: UseDropZoneResult[\"propGetters\"][\"getFileItemProps\"]","getFileItemProgressProps: UseDropZoneResult[\"propGetters\"][\"getFileItemProgressProps\"]","getFileItemDeleteProps: UseDropZoneResult[\"propGetters\"][\"getFileItemDeleteProps\"]","getFileItemPreviewProps: UseDropZoneResult[\"propGetters\"][\"getFileItemPreviewProps\"]","getFileItemMetadataProps: UseDropZoneResult[\"propGetters\"][\"getFileItemMetadataProps\"]","getFileItemClearProps: UseDropZoneResult[\"propGetters\"][\"getFileItemClearProps\"]","Slot.Root","Component"],"sources":["../../../../src/components/ui/drop-zone/drop-zone-context.ts","../../../../src/components/ui/drop-zone/icons.tsx","../../../../src/components/ui/drop-zone/utils.ts","../../../../src/components/ui/drop-zone/drop-zone-store.ts","../../../../src/components/ui/drop-zone/use-drop-zone.ts","../../../../src/components/ui/drop-zone/drop-zone.tsx","../../../../src/components/ui/drop-zone/drop-zone-parts.ts"],"sourcesContent":["import { createCustomContext } from \"@zayne-labs/toolkit-react\";\nimport { createReactStoreContext } from \"@zayne-labs/toolkit-react/zustand\";\nimport type { DropZoneStore, FileState, UseDropZoneResult } from \"./types\";\n\nconst [DropZoneStoreContextProvider, useDropZoneStoreContext] = createReactStoreContext<DropZoneStore>({\n\thookName: \"useDropZoneStoreContext\",\n\tname: \"DropZoneStoreContext\",\n\tproviderName: \"DropZoneRoot\",\n});\n\nexport type DropZoneRootContextType = Pick<\n\tUseDropZoneResult,\n\t\"disabled\" | \"disableInternalStateSubscription\" | \"inputRef\" | \"propGetters\"\n>;\n\nconst [DropZoneRootContextProvider, useDropZoneRootContext] = createCustomContext<DropZoneRootContextType>(\n\t{\n\t\thookName: \"useDropZoneRootContext\",\n\t\tname: \"DropZoneRootContext\",\n\t\tproviderName: \"DropZoneRoot\",\n\t}\n);\n\nexport type FileItemContextType = {\n\tfileState: FileState;\n};\n\nconst [FileItemContextProvider, useFileItemContext] = createCustomContext({\n\tdefaultValue: null as unknown as FileItemContextType,\n\thookName: \"useFileItemContext\",\n\tname: \"FileItemContext\",\n\tproviderName: \"FileItem\",\n\tstrict: false,\n});\n\nexport {\n\tDropZoneRootContextProvider,\n\tDropZoneStoreContextProvider,\n\tFileItemContextProvider,\n\tuseDropZoneRootContext,\n\tuseDropZoneStoreContext,\n\tuseFileItemContext,\n};\n","export const FileVideoIcon = (props: React.SVGProps<SVGSVGElement>) => (\n\t<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1em\" height=\"1em\" viewBox=\"0 0 24 24\" {...props}>\n\t\t{/* Icon from Lucide by Lucide Contributors - https://github.com/lucide-icons/lucide/blob/main/LICENSE */}\n\t\t<g fill=\"none\" stroke=\"currentColor\" strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth=\"2\">\n\t\t\t<path d=\"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z\" />\n\t\t\t<path d=\"M14 2v4a2 2 0 0 0 2 2h4m-10 3l5 3l-5 3z\" />\n\t\t</g>\n\t</svg>\n);\n\nexport const FileAudioIcon = (props: React.SVGProps<SVGSVGElement>) => (\n\t<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1em\" height=\"1em\" viewBox=\"0 0 24 24\" {...props}>\n\t\t{/* Icon from Lucide by Lucide Contributors - https://github.com/lucide-icons/lucide/blob/main/LICENSE */}\n\t\t<g fill=\"none\" stroke=\"currentColor\" strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth=\"2\">\n\t\t\t<path d=\"M17.5 22h.5a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v3\" />\n\t\t\t<path d=\"M14 2v4a2 2 0 0 0 2 2h4M2 19a2 2 0 1 1 4 0v1a2 2 0 1 1-4 0v-4a6 6 0 0 1 12 0v4a2 2 0 1 1-4 0v-1a2 2 0 1 1 4 0\" />\n\t\t</g>\n\t</svg>\n);\n\nexport const FileTextIcon = (props: React.SVGProps<SVGSVGElement>) => (\n\t<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1em\" height=\"1em\" viewBox=\"0 0 24 24\" {...props}>\n\t\t{/* Icon from Lucide by Lucide Contributors - https://github.com/lucide-icons/lucide/blob/main/LICENSE */}\n\t\t<g fill=\"none\" stroke=\"currentColor\" strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth=\"2\">\n\t\t\t<path d=\"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z\" />\n\t\t\t<path d=\"M14 2v4a2 2 0 0 0 2 2h4M10 9H8m8 4H8m8 4H8\" />\n\t\t</g>\n\t</svg>\n);\n\nexport const FileCodeIcon = (props: React.SVGProps<SVGSVGElement>) => (\n\t<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1em\" height=\"1em\" viewBox=\"0 0 24 24\" {...props}>\n\t\t{/* Icon from Lucide by Lucide Contributors - https://github.com/lucide-icons/lucide/blob/main/LICENSE */}\n\t\t<g fill=\"none\" stroke=\"currentColor\" strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth=\"2\">\n\t\t\t<path d=\"M10 12.5L8 15l2 2.5m4-5l2 2.5l-2 2.5M14 2v4a2 2 0 0 0 2 2h4\" />\n\t\t\t<path d=\"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z\" />\n\t\t</g>\n\t</svg>\n);\n\nexport const FileArchiveIcon = (props: React.SVGProps<SVGSVGElement>) => (\n\t<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1em\" height=\"1em\" viewBox=\"0 0 24 24\" {...props}>\n\t\t{/* Icon from Lucide by Lucide Contributors - https://github.com/lucide-icons/lucide/blob/main/LICENSE */}\n\t\t<g fill=\"none\" stroke=\"currentColor\" strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth=\"2\">\n\t\t\t<path d=\"M10 12v-1m0 7v-2m0-9V6m4-4v4a2 2 0 0 0 2 2h4\" />\n\t\t\t<path d=\"M15.5 22H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v16a2 2 0 0 0 .274 1.01\" />\n\t\t\t<circle cx=\"10\" cy=\"20\" r=\"2\" />\n\t\t</g>\n\t</svg>\n);\n\nexport const FileCogIcon = (props: React.SVGProps<SVGSVGElement>) => (\n\t<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1em\" height=\"1em\" viewBox=\"0 0 24 24\" {...props}>\n\t\t{/* Icon from Lucide by Lucide Contributors - https://github.com/lucide-icons/lucide/blob/main/LICENSE */}\n\t\t<g fill=\"none\" stroke=\"currentColor\" strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth=\"2\">\n\t\t\t<path d=\"M14 2v4a2 2 0 0 0 2 2h4M3.2 12.9l-.9-.4m.9 2.6l-.9.4\" />\n\t\t\t<path d=\"M4.677 21.5a2 2 0 0 0 1.313.5H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v2.5m.9 4.7l-.4-.9m.4 6.5l-.4.9m3-7.4l-.4.9m.4 6.5l-.4-.9m2.6-4.3l-.9.4m.9 2.6l-.9-.4\" />\n\t\t\t<circle cx=\"6\" cy=\"14\" r=\"3\" />\n\t\t</g>\n\t</svg>\n);\n\nexport const FileIcon = (props: React.SVGProps<SVGSVGElement>) => (\n\t<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1em\" height=\"1em\" viewBox=\"0 0 24 24\" {...props}>\n\t\t{/* Icon from Lucide by Lucide Contributors - https://github.com/lucide-icons/lucide/blob/main/LICENSE */}\n\t\t<g fill=\"none\" stroke=\"currentColor\" strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth=\"2\">\n\t\t\t<path d=\"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z\" />\n\t\t\t<path d=\"M14 2v4a2 2 0 0 0 2 2h4\" />\n\t\t</g>\n\t</svg>\n);\n","import {\n\tcreateFileURL,\n\ttype FileOrFileMeta,\n\ttype FileValidationErrorContextEach,\n\tgenerateFileID as generateFileIDPrimitive,\n} from \"@zayne-labs/toolkit-core\";\nimport { isFile, isObject, isString } from \"@zayne-labs/toolkit-type-helpers\";\nimport type { FileState, FileStateOrIDProp, PartProps } from \"./types\";\n\nexport const generateFileID = generateFileIDPrimitive;\n\nexport const createObjectURL = (\n\tfile: FileOrFileMeta,\n\tdisallowPreviewForNonImageFiles: boolean | undefined\n) => {\n\tif (disallowPreviewForNonImageFiles && !file.type?.startsWith(\"image/\")) return;\n\n\treturn createFileURL(file);\n};\n\nexport const clearObjectURL = (\n\tfileState: FileState | undefined,\n\tdisallowPreviewForNonImageFiles: boolean | undefined\n) => {\n\tif (!isFile(fileState?.file)) return;\n\n\tif (disallowPreviewForNonImageFiles && !fileState.file.type.startsWith(\"image/\")) return;\n\n\tif (!fileState.preview) return;\n\n\tURL.revokeObjectURL(fileState.preview);\n};\n\nexport const isMatchingFile = (\n\toptions: FileStateOrIDProp & {\n\t\tfileState: FileOrFileMeta | FileState;\n\t}\n) => {\n\tconst { fileState, fileStateOrID } = options;\n\n\tconst fileID = isFile(fileState) ? generateFileID(fileState) : fileState.id;\n\n\tif (isString(fileStateOrID)) {\n\t\treturn fileID === fileStateOrID;\n\t}\n\n\tif (isFile(fileStateOrID)) {\n\t\tconst generatedFileID = generateFileID(fileStateOrID);\n\t\treturn fileID === generatedFileID;\n\t}\n\n\treturn fileID === fileStateOrID.id;\n};\n\ntype FromCamelToKebabCase<TString extends string> =\n\tTString extends `${infer First}${infer Rest}` ?\n\t\tFirst extends Uppercase<First> ?\n\t\t\t`-${Lowercase<First>}${FromCamelToKebabCase<Rest>}`\n\t\t:\t`${First}${FromCamelToKebabCase<Rest>}`\n\t:\t\"\";\n\nexport const getScopeAttrs = (part: FromCamelToKebabCase<keyof PartProps>) => {\n\treturn {\n\t\t/* eslint-disable perfectionist/sort-objects -- I need this order to be maintained */\n\t\t\"data-slot\": `dropzone-${part}`,\n\t\t\"data-scope\": \"dropzone\",\n\t\t\"data-part\": part,\n\t\t/* eslint-enable perfectionist/sort-objects -- I need this order to be maintained */\n\t} as const;\n};\n\nconst dropZoneErrorSymbol = Symbol(\"DropZoneError\");\n\nexport class DropZoneError extends Error {\n\treadonly dropZoneErrorSymbol = dropZoneErrorSymbol;\n\tfile?: FileValidationErrorContextEach[\"file\"];\n\toverride name = \"DropZoneError\" as const;\n\n\tconstructor(\n\t\tctx: Pick<FileValidationErrorContextEach, \"message\"> & {\n\t\t\tfile?: FileValidationErrorContextEach[\"file\"];\n\t\t},\n\t\terrorOptions?: ErrorOptions\n\t) {\n\t\tconst { file, message } = ctx;\n\n\t\tsuper(message, errorOptions);\n\n\t\tthis.file = file;\n\t}\n\n\tstatic override isError(error: unknown): error is DropZoneError {\n\t\tif (!isObject<DropZoneError>(error)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (error instanceof DropZoneError) {\n\t\t\treturn true;\n\t\t}\n\n\t\tconst actualError = error as DropZoneError;\n\n\t\treturn (\n\t\t\tactualError.dropZoneErrorSymbol === dropZoneErrorSymbol\n\t\t\t// eslint-disable-next-line ts-eslint/no-unnecessary-condition -- Allow\n\t\t\t&& actualError.name === \"DropZoneError\"\n\t\t);\n\t}\n}\n\nexport const getErrorContext = (error: DropZoneError | Error): NonNullable<FileState[\"error\"]> => {\n\tif (DropZoneError.isError(error)) {\n\t\treturn {\n\t\t\tcause: \"custom-error\",\n\t\t\tcode: \"upload-error\",\n\t\t\tfile: error.file ?? ({} as never),\n\t\t\tmessage: error.message,\n\t\t\toriginalError: error.cause ?? error,\n\t\t};\n\t}\n\n\tconst actualError = Error.isError(error) ? error : new Error(\"File upload failed\", { cause: error });\n\n\treturn {\n\t\tcause: \"custom-error\",\n\t\tcode: \"upload-error\",\n\t\tfile: isFile(actualError.cause) ? actualError.cause : ({} as never),\n\t\tmessage: Error.isError(error) ? actualError.message : String(actualError),\n\t\toriginalError: actualError,\n\t};\n};\n","import { createStore, handleFileValidationAsync, toArray } from \"@zayne-labs/toolkit-core\";\nimport type { DropZoneState, DropZoneStore, UseDropZoneProps } from \"./types\";\nimport { clearObjectURL, createObjectURL, generateFileID, getErrorContext, isMatchingFile } from \"./utils\";\n\ntype RequiredUseDropZoneProps = {\n\t[Key in keyof Required<UseDropZoneProps>]: UseDropZoneProps[Key] | undefined;\n};\n\ntype InitStoreValues = Omit<\n\tRequiredUseDropZoneProps,\n\t\"disabled\" | \"disableFilePickerOpenOnAreaClick\" | \"disableInternalStateSubscription\" | \"extraProps\"\n> & { inputRef: React.RefObject<HTMLInputElement | null> };\n\nexport const createDropZoneStore = (initStoreValues: InitStoreValues) => {\n\tconst {\n\t\tallowedFileTypes,\n\t\tdisablePreviewGenForNonImageFiles,\n\t\tinitialFiles,\n\t\tinputRef,\n\t\tmaxFileCount,\n\t\tmaxFileSize,\n\t\tmultiple,\n\t\tonFilesChange,\n\t\tonUpload,\n\t\tonValidationError,\n\t\tonValidationSuccess,\n\t\trejectDuplicateFiles,\n\t\tvalidator,\n\t} = initStoreValues;\n\n\tconst initialFileArray = toArray(initialFiles).filter(Boolean);\n\n\tconst clearInputValue = () => {\n\t\tif (!inputRef.current) return;\n\n\t\tinputRef.current.value = \"\";\n\t};\n\n\tconst initFileStateArray: DropZoneState[\"fileStateArray\"] = initialFileArray.map((fileMeta) => ({\n\t\tfile: fileMeta,\n\t\tid: fileMeta.id,\n\t\tpreview: fileMeta.url,\n\t\tprogress: 0,\n\t\tstatus: \"idle\",\n\t}));\n\n\tconst store = createStore<DropZoneStore>((set, get) => ({\n\t\tdisabled: false,\n\t\terrors: [],\n\t\tfileStateArray: initFileStateArray,\n\t\tisDraggingOver: false,\n\t\tisInvalid: false,\n\n\t\t// eslint-disable-next-line perfectionist/sort-objects -- ignore\n\t\tactions: {\n\t\t\taddFiles: async (files) => {\n\t\t\t\tif (!files || files.length === 0) {\n\t\t\t\t\tconsole.warn(\"No file selected!\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst { actions, fileStateArray } = get();\n\n\t\t\t\t// == In single file mode, only use the first file\n\t\t\t\tconst resolvedNewFiles = !multiple ? [files[0]] : files;\n\n\t\t\t\tconst { errors, validFiles } = await handleFileValidationAsync({\n\t\t\t\t\texistingFiles: fileStateArray.map((fileWithPreview) => fileWithPreview.file),\n\t\t\t\t\thooks: {\n\t\t\t\t\t\tonErrorEach: onValidationError,\n\t\t\t\t\t\tonSuccessBatch: onValidationSuccess,\n\t\t\t\t\t},\n\t\t\t\t\tnewFiles: resolvedNewFiles,\n\t\t\t\t\tsettings: {\n\t\t\t\t\t\tallowedFileTypes,\n\t\t\t\t\t\tmaxFileCount,\n\t\t\t\t\t\tmaxFileSize,\n\t\t\t\t\t\trejectDuplicateFiles,\n\t\t\t\t\t\tvalidator,\n\t\t\t\t\t},\n\t\t\t\t});\n\n\t\t\t\tif (validFiles.length === 0) {\n\t\t\t\t\tset({ errors, isDraggingOver: false });\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst newFileStateArray: DropZoneState[\"fileStateArray\"] = validFiles.map((file) => ({\n\t\t\t\t\tfile,\n\t\t\t\t\tid: generateFileID(file),\n\t\t\t\t\tpreview: createObjectURL(file, disablePreviewGenForNonImageFiles),\n\t\t\t\t\tprogress: 0,\n\t\t\t\t\tstatus: \"idle\",\n\t\t\t\t}));\n\n\t\t\t\tset(\n\t\t\t\t\t{\n\t\t\t\t\t\terrors,\n\t\t\t\t\t\tfileStateArray:\n\t\t\t\t\t\t\t!multiple ? newFileStateArray : [...fileStateArray, ...newFileStateArray],\n\t\t\t\t\t\tisDraggingOver: false,\n\t\t\t\t\t},\n\t\t\t\t\t{ shouldNotifySync: true }\n\t\t\t\t);\n\n\t\t\t\tawait actions.handleFileUpload({ newFileStateArray });\n\t\t\t},\n\n\t\t\tclearErrors: () => {\n\t\t\t\tset({ errors: [], isInvalid: false });\n\t\t\t},\n\n\t\t\tclearFiles: () => {\n\t\t\t\tconst { actions } = get();\n\n\t\t\t\tactions.clearObjectURLs();\n\n\t\t\t\tset({ errors: [], fileStateArray: [], isInvalid: false });\n\t\t\t},\n\n\t\t\tclearObjectURLs: () => {\n\t\t\t\tconst { fileStateArray } = get();\n\n\t\t\t\tfor (const fileState of fileStateArray) {\n\t\t\t\t\tclearObjectURL(fileState, disablePreviewGenForNonImageFiles);\n\t\t\t\t}\n\t\t\t},\n\n\t\t\thandleChange: async (event) => {\n\t\t\t\tconst fileList = event.target.files;\n\n\t\t\t\tconst { actions } = get();\n\n\t\t\t\tawait actions.addFiles(fileList);\n\n\t\t\t\tclearInputValue();\n\t\t\t},\n\n\t\t\thandleDragEnter: (event) => {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tevent.stopPropagation();\n\n\t\t\t\tset({ isDraggingOver: true });\n\t\t\t},\n\n\t\t\thandleDragLeave: (event) => {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tevent.stopPropagation();\n\n\t\t\t\tset({ isDraggingOver: false });\n\t\t\t},\n\n\t\t\thandleDragOver: (event) => {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tevent.stopPropagation();\n\t\t\t},\n\n\t\t\thandleDrop: async (event) => {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tevent.stopPropagation();\n\n\t\t\t\tconst { actions } = get();\n\n\t\t\t\tconst fileList = event.dataTransfer.files;\n\n\t\t\t\tawait actions.addFiles(fileList);\n\t\t\t},\n\n\t\t\thandleFileUpload: async (context) => {\n\t\t\t\tconst { newFileStateArray } = context;\n\n\t\t\t\tconst { actions } = get();\n\n\t\t\t\tif (!onUpload) {\n\t\t\t\t\tfor (const fileState of newFileStateArray) {\n\t\t\t\t\t\tactions.updateFileState({ fileStateOrID: fileState, progress: 100, status: \"success\" });\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\ttry {\n\t\t\t\t\tawait onUpload({\n\t\t\t\t\t\tfileStateArray: newFileStateArray,\n\t\t\t\t\t\tonError: (ctx) => {\n\t\t\t\t\t\t\tconst { error, fileStateOrID } = ctx;\n\n\t\t\t\t\t\t\tconst errorContext = getErrorContext(error);\n\n\t\t\t\t\t\t\tactions.updateFileState({ error: errorContext, fileStateOrID, status: \"error\" });\n\t\t\t\t\t\t},\n\t\t\t\t\t\tonProgress: (ctx) => {\n\t\t\t\t\t\t\tconst { fileStateOrID, progress } = ctx;\n\n\t\t\t\t\t\t\tactions.updateFileState({ fileStateOrID, progress });\n\t\t\t\t\t\t},\n\t\t\t\t\t\tonSuccess: (ctx) => {\n\t\t\t\t\t\t\tconst { fileStateOrID } = ctx;\n\n\t\t\t\t\t\t\tactions.updateFileState({ fileStateOrID, progress: 100, status: \"success\" });\n\t\t\t\t\t\t},\n\t\t\t\t\t});\n\n\t\t\t\t\t// Handle Errors\n\t\t\t\t} catch (error) {\n\t\t\t\t\tconst errorContext = getErrorContext(error as Error);\n\n\t\t\t\t\tfor (const fileState of newFileStateArray) {\n\t\t\t\t\t\tactions.updateFileState({\n\t\t\t\t\t\t\terror: errorContext,\n\t\t\t\t\t\t\tfileStateOrID: fileState,\n\t\t\t\t\t\t\tstatus: \"error\",\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\t// set((prevState) => ({ errors: [...prevState.errors, errorContext] }));\n\t\t\t\t}\n\t\t\t},\n\n\t\t\thandleKeyDown: (event) => {\n\t\t\t\tconst isEnterKey = event.key === \"Enter\";\n\t\t\t\tconst isSpaceKey = event.key === \" \";\n\n\t\t\t\tconst isAllowedKey = isEnterKey || isSpaceKey;\n\n\t\t\t\tif (!isAllowedKey) return;\n\n\t\t\t\tevent.preventDefault();\n\n\t\t\t\tconst { actions } = get();\n\n\t\t\t\tactions.openFilePicker();\n\t\t\t},\n\n\t\t\thandlePaste: async (event) => {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tevent.stopPropagation();\n\n\t\t\t\tconst { actions } = get();\n\n\t\t\t\tconst fileList = event.clipboardData.files;\n\n\t\t\t\tawait actions.addFiles(fileList);\n\t\t\t},\n\n\t\t\topenFilePicker: () => {\n\t\t\t\tinputRef.current?.click();\n\t\t\t},\n\n\t\t\tremoveFile: (ctx) => {\n\t\t\t\tconst { fileStateOrID } = ctx;\n\n\t\t\t\tconst { fileStateArray } = get();\n\n\t\t\t\tconst updatedFileStateArray = fileStateArray.filter((fileState) => {\n\t\t\t\t\tif (!isMatchingFile({ fileState, fileStateOrID })) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\n\t\t\t\t\tclearObjectURL(fileState, disablePreviewGenForNonImageFiles);\n\n\t\t\t\t\treturn false;\n\t\t\t\t});\n\n\t\t\t\tset({ errors: [], fileStateArray: updatedFileStateArray });\n\t\t\t},\n\n\t\t\tupdateFileState: (ctx) => {\n\t\t\t\tconst { fileStateOrID, ...updatedFileState } = ctx;\n\n\t\t\t\tconst { fileStateArray } = get();\n\n\t\t\t\tconst updatedFileStateArray: DropZoneState[\"fileStateArray\"] = fileStateArray.map(\n\t\t\t\t\t(fileState) => {\n\t\t\t\t\t\tif (isMatchingFile({ fileState, fileStateOrID })) {\n\t\t\t\t\t\t\treturn { ...fileState, ...updatedFileState };\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn fileState;\n\t\t\t\t\t}\n\t\t\t\t);\n\n\t\t\t\t// const updatedErrorsState =\n\t\t\t\t// \tupdatedFileState.error ?\n\t\t\t\t// \t\t{ errors: [...errors, updatedFileState.error] satisfies DropZoneState[\"errors\"] }\n\t\t\t\t// \t:\tnull;\n\n\t\t\t\tset({ fileStateArray: updatedFileStateArray }, { shouldNotifySync: true });\n\t\t\t},\n\t\t},\n\t}));\n\n\t// == File change subscription\n\tstore.subscribe.withSelector(\n\t\t(state) => state.fileStateArray,\n\t\t(fileStateArray) => onFilesChange?.({ fileStateArray })\n\t);\n\n\t// == Set `isInvalid` to true if there are errors\n\tstore.subscribe.withSelector(\n\t\t(state) => state.errors,\n\t\t(errors) => {\n\t\t\tif (errors.length === 0) return;\n\n\t\t\tstore.setState({ isInvalid: true });\n\n\t\t\t// == Reset to false after 1.5 seconds\n\t\t\tsetTimeout(() => store.setState({ isInvalid: false }), 1500);\n\t\t}\n\t);\n\n\treturn store;\n};\n","import { cnMerge } from \"@/lib/utils/cn\";\nimport { dataAttr } from \"@zayne-labs/toolkit-core\";\nimport {\n\tuseCallbackRef,\n\tuseConstant,\n\tuseShallowCompValue,\n\tuseStore,\n\tuseUnmountEffect,\n} from \"@zayne-labs/toolkit-react\";\nimport { composeRefs, composeTwoEventHandlers } from \"@zayne-labs/toolkit-react/utils\";\nimport { useCallback, useMemo, useRef } from \"react\";\nimport { createDropZoneStore } from \"./drop-zone-store\";\nimport type { DropZonePropGetters, UseDropZoneProps, UseDropZoneResult } from \"./types\";\nimport { getScopeAttrs } from \"./utils\";\n\nexport const useDropZone = (props?: UseDropZoneProps): UseDropZoneResult => {\n\tconst {\n\t\tallowedFileTypes,\n\t\tdisabled = false,\n\t\tdisableFilePickerOpenOnAreaClick = false,\n\t\tdisableInternalStateSubscription = false,\n\t\tdisablePreviewGenForNonImageFiles = true,\n\t\tinitialFiles,\n\t\tmaxFileCount,\n\t\tmaxFileSize,\n\t\tmultiple,\n\t\tonFilesChange,\n\t\tonUpload,\n\t\tonValidationError,\n\t\tonValidationSuccess,\n\t\trejectDuplicateFiles = true,\n\t\tvalidator,\n\t} = props ?? {};\n\n\tconst inputRef = useRef<HTMLInputElement>(null);\n\n\tconst stableOnFilesChange = useCallbackRef(onFilesChange);\n\tconst stableOnUpload = useCallbackRef(onUpload);\n\tconst stableOnUploadError = useCallbackRef(onValidationError);\n\tconst stableOnUploadSuccess = useCallbackRef(onValidationSuccess);\n\tconst stableValidator = useCallbackRef(validator);\n\n\tconst constantInitialFiles = useConstant(() => initialFiles);\n\tconst shallowComparedMaxFileSize = useShallowCompValue(maxFileSize);\n\tconst shallowComparedAllowedFileTypes = useShallowCompValue(allowedFileTypes);\n\n\tconst storeApi = useMemo(() => {\n\t\treturn createDropZoneStore({\n\t\t\tallowedFileTypes: shallowComparedAllowedFileTypes,\n\t\t\tdisablePreviewGenForNonImageFiles,\n\t\t\tinitialFiles: constantInitialFiles,\n\t\t\tinputRef,\n\t\t\tmaxFileCount,\n\t\t\tmaxFileSize: shallowComparedMaxFileSize,\n\t\t\tmultiple,\n\t\t\tonFilesChange: stableOnFilesChange,\n\t\t\tonUpload: stableOnUpload,\n\t\t\tonValidationError: stableOnUploadError,\n\t\t\tonValidationSuccess: stableOnUploadSuccess,\n\t\t\trejectDuplicateFiles,\n\t\t\tvalidator: stableValidator,\n\t\t});\n\t}, [\n\t\tshallowComparedAllowedFileTypes,\n\t\tdisablePreviewGenForNonImageFiles,\n\t\tconstantInitialFiles,\n\t\tmaxFileCount,\n\t\tshallowComparedMaxFileSize,\n\t\tmultiple,\n\t\tstableOnFilesChange,\n\t\tstableOnUpload,\n\t\tstableOnUploadError,\n\t\tstableOnUploadSuccess,\n\t\trejectDuplicateFiles,\n\t\tstableValidator,\n\t]);\n\n\tconst actions = storeApi.getState().actions;\n\n\tuseUnmountEffect(() => {\n\t\tactions.clearObjectURLs();\n\t});\n\n\tconst useDropZoneStore: UseDropZoneResult[\"useDropZoneStore\"] = (selector) => {\n\t\treturn useStore(storeApi, selector);\n\t};\n\n\tconst isDraggingOver = useDropZoneStore((state) =>\n\t\t!disableInternalStateSubscription ? state.isDraggingOver : null\n\t);\n\n\tconst hasFiles = useDropZoneStore((state) =>\n\t\t!disableInternalStateSubscription ? state.fileStateArray.length > 0 : null\n\t);\n\n\tconst isInvalid = useDropZoneStore((state) =>\n\t\t!disableInternalStateSubscription ? state.isInvalid : null\n\t);\n\n\tconst getContainerProps: UseDropZoneResult[\"propGetters\"][\"getContainerProps\"] = useCallback(\n\t\t(innerProps) => {\n\t\t\tconst isDisabled = disabled;\n\t\t\tconst onFileDrop = !isDisabled ? actions.handleDrop : undefined;\n\t\t\tconst onFilePaste = !isDisabled ? actions.handlePaste : undefined;\n\t\t\tconst tabIndex = !isDisabled ? 0 : undefined;\n\t\t\tconst onAreaClick =\n\t\t\t\t!isDisabled && !disableFilePickerOpenOnAreaClick ? actions.openFilePicker : undefined;\n\t\t\tconst onKeyDown =\n\t\t\t\t!isDisabled && !disableFilePickerOpenOnAreaClick ? actions.handleKeyDown : undefined;\n\n\t\t\treturn {\n\t\t\t\t...getScopeAttrs(\"container\"),\n\t\t\t\trole: \"region\",\n\t\t\t\t...(!disableInternalStateSubscription && {\n\t\t\t\t\t\"data-drag-over\": dataAttr(isDraggingOver),\n\t\t\t\t\t\"data-invalid\": dataAttr(isInvalid),\n\t\t\t\t}),\n\t\t\t\t...innerProps,\n\t\t\t\tclassName: cnMerge(\n\t\t\t\t\t`relative flex flex-col items-center justify-center gap-2 rounded-lg border-2 border-dashed\n\t\t\t\t\tp-6 transition-colors duration-250 ease-out outline-none select-none\n\t\t\t\t\tfocus-visible:border-zu-ring/50`,\n\t\t\t\t\t`data-disabled:pointer-events-none data-drag-over:opacity-60\n\t\t\t\t\tdata-invalid:border-zu-destructive data-invalid:ring-zu-destructive/20`,\n\t\t\t\t\tinnerProps.className\n\t\t\t\t),\n\t\t\t\t\"data-disabled\": dataAttr(isDisabled),\n\t\t\t\tonClick: composeTwoEventHandlers(onAreaClick, innerProps.onClick),\n\t\t\t\tonDragEnter: composeTwoEventHandlers(actions.handleDragEnter, innerProps.onDragEnter),\n\t\t\t\tonDragLeave: composeTwoEventHandlers(actions.handleDragLeave, innerProps.onDragLeave),\n\t\t\t\tonDragOver: composeTwoEventHandlers(actions.handleDragOver, innerProps.onDragOver),\n\t\t\t\tonDrop: composeTwoEventHandlers(onFileDrop, innerProps.onDrop),\n\t\t\t\tonKeyDown: composeTwoEventHandlers(onKeyDown, innerProps.onKeyDown),\n\t\t\t\tonPaste: composeTwoEventHandlers(onFilePaste, innerProps.onPaste),\n\t\t\t\ttabIndex,\n\t\t\t};\n\t\t},\n\t\t[\n\t\t\tactions.handleDragEnter,\n\t\t\tactions.handleDragLeave,\n\t\t\tactions.handleDragOver,\n\t\t\tactions.handleDrop,\n\t\t\tactions.handleKeyDown,\n\t\t\tactions.handlePaste,\n\t\t\tactions.openFilePicker,\n\t\t\tdisableInternalStateSubscription,\n\t\t\tdisabled,\n\t\t\tisDraggingOver,\n\t\t\tisInvalid,\n\t\t\tdisableFilePickerOpenOnAreaClick,\n\t\t]\n\t);\n\n\tconst getInputProps: UseDropZoneResult[\"propGetters\"][\"getInputProps\"] = useCallback(\n\t\t(innerProps) => {\n\t\t\tconst isDisabled = innerProps.disabled ?? disabled;\n\n\t\t\tconst onFileChange = !isDisabled ? actions.handleChange : undefined;\n\n\t\t\treturn {\n\t\t\t\t...getScopeAttrs(\"input\"),\n\t\t\t\t...(!disableInternalStateSubscription && { \"data-drag-over\": dataAttr(isDraggingOver) }),\n\t\t\t\t...innerProps,\n\t\t\t\taccept: allowedFileTypes ? allowedFileTypes.join(\", \") : innerProps.accept,\n\t\t\t\tclassName: cnMerge(\"hidden\", innerProps.className),\n\t\t\t\t\"data-disabled\": dataAttr(isDisabled),\n\t\t\t\tdisabled: isDisabled,\n\t\t\t\tmultiple: multiple ?? innerProps.multiple,\n\t\t\t\tonChange: composeTwoEventHandlers(onFileChange, innerProps.onChange),\n\t\t\t\tref: composeRefs(inputRef, innerProps.ref),\n\t\t\t\ttype: \"file\",\n\t\t\t};\n\t\t},\n\t\t[\n\t\t\tactions.handleChange,\n\t\t\tallowedFileTypes,\n\t\t\tdisableInternalStateSubscription,\n\t\t\tdisabled,\n\t\t\tisDraggingOver,\n\t\t\tmultiple,\n\t\t]\n\t);\n\n\tconst getTriggerProps: UseDropZoneResult[\"propGetters\"][\"getTriggerProps\"] = useCallback(\n\t\t(innerProps) => {\n\t\t\tconst isDisabled = innerProps.disabled ?? disabled;\n\n\t\t\treturn {\n\t\t\t\t...getScopeAttrs(\"trigger\"),\n\t\t\t\ttype: \"button\",\n\t\t\t\t...innerProps,\n\t\t\t\t\"data-disabled\": dataAttr(isDisabled),\n\t\t\t\tdisabled: isDisabled,\n\t\t\t\tonClick: composeTwoEventHandlers(actions.openFilePicker, innerProps.onClick),\n\t\t\t};\n\t\t},\n\t\t[actions.openFilePicker, disabled]\n\t);\n\n\tconst getFileListProps: UseDropZoneResult[\"propGetters\"][\"getFileListProps\"] = useCallback(\n\t\t(innerProps) => {\n\t\t\tconst { orientation = \"vertical\", ...restOfInnerProps } = innerProps;\n\n\t\t\treturn {\n\t\t\t\t...getScopeAttrs(\"file-list\"),\n\t\t\t\t\"data-orientation\": orientation,\n\t\t\t\t...(!disableInternalStateSubscription && { \"data-state\": hasFiles ? \"active\" : \"inactive\" }),\n\t\t\t\t...restOfInnerProps,\n\t\t\t\tclassName: cnMerge(\n\t\t\t\t\t\"flex flex-col gap-2 data-[state=active]:animate-files-in\",\n\t\t\t\t\torientation === \"horizontal\" && \"flex-row overflow-x-auto p-1.5\",\n\t\t\t\t\tinnerProps.className\n\t\t\t\t),\n\t\t\t};\n\t\t},\n\t\t[disableInternalStateSubscription, hasFiles]\n\t);\n\n\tconst getFileItemProps: UseDropZoneResult[\"propGetters\"][\"getFileItemProps\"] = useCallbackRef(\n\t\t(innerProps) => {\n\t\t\treturn {\n\t\t\t\t...getScopeAttrs(\"file-item\"),\n\t\t\t\t...innerProps,\n\t\t\t\tclassName: cnMerge(\n\t\t\t\t\t\"relative flex items-center gap-2.5 rounded-md border p-2\",\n\t\t\t\t\tinnerProps.className\n\t\t\t\t),\n\t\t\t};\n\t\t}\n\t);\n\n\tconst getFileItemProgressProps: UseDropZoneResult[\"propGetters\"][\"getFileItemProgressProps\"] =\n\t\tuseCallbackRef((innerProps) => {\n\t\t\tconst { variant = \"linear\", ...restOfInnerProps } = innerProps;\n\n\t\t\treturn {\n\t\t\t\t...getScopeAttrs(\"file-item-progress\"),\n\t\t\t\trole: \"progressbar\",\n\t\t\t\t...restOfInnerProps,\n\t\t\t\tclassName: cnMerge(\n\t\t\t\t\t\"inline-flex\",\n\t\t\t\t\tvariant === \"circular\" && \"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2\",\n\t\t\t\t\tvariant === \"fill\"\n\t\t\t\t\t\t&& `absolute inset-0 bg-zu-primary/50 transition-[clip-path] duration-300 ease-linear\n\t\t\t\t\t\t[clip-path:var(--clip-path)]`,\n\t\t\t\t\tvariant === \"linear\"\n\t\t\t\t\t\t&& \"relative h-1.5 w-full overflow-hidden rounded-full bg-zu-primary/20\",\n\t\t\t\t\trestOfInnerProps.className\n\t\t\t\t),\n\t\t\t};\n\t\t});\n\n\tconst getFileItemDeleteProps: UseDropZoneResult[\"propGetters\"][\"getFileItemDeleteProps\"] = useCallback(\n\t\t(innerProps) => {\n\t\t\tconst { fileStateOrID, ...restOfInnerProps } = innerProps;\n\n\t\t\tconst isDisabled = innerProps.disabled ?? disabled;\n\n\t\t\tconst onRemoveFile = () => fileStateOrID && actions.removeFile({ fileStateOrID });\n\n\t\t\treturn {\n\t\t\t\t...getScopeAttrs(\"file-item-delete\"),\n\t\t\t\ttype: \"button\",\n\t\t\t\t...restOfInnerProps,\n\t\t\t\t\"data-disabled\": dataAttr(isDisabled),\n\t\t\t\tdisabled: isDisabled,\n\t\t\t\tonClick: composeTwoEventHandlers(onRemoveFile, restOfInnerProps.onClick),\n\t\t\t};\n\t\t},\n\t\t[actions, disabled]\n\t);\n\n\tconst getFileItemPreviewProps: UseDropZoneResult[\"propGetters\"][\"getFileItemPreviewProps\"] =\n\t\tuseCallbackRef((innerProps) => {\n\t\t\treturn {\n\t\t\t\t...getScopeAttrs(\"file-item-preview\"),\n\t\t\t\t...innerProps,\n\t\t\t\tclassName: cnMerge(\n\t\t\t\t\t`relative flex size-10 shrink-0 items-center justify-center overflow-hidden rounded-md\n\t\t\t\t\tbg-zu-accent/50 [&>svg]:size-10`,\n\t\t\t\t\tinnerProps.className\n\t\t\t\t),\n\t\t\t};\n\t\t});\n\n\tconst getFileItemMetadataProps: UseDropZoneResult[\"propGetters\"][\"getFileItemMetadataProps\"] =\n\t\tuseCallbackRef((innerProps) => {\n\t\t\treturn {\n\t\t\t\t...getScopeAttrs(\"file-item-metadata\"),\n\t\t\t\t...innerProps,\n\t\t\t\tclassName: cnMerge(\"flex min-w-0 grow flex-col\", innerProps.className),\n\t\t\t};\n\t\t});\n\n\tconst getFileItemClearProps: UseDropZoneResult[\"propGetters\"][\"getFileItemClearProps\"] = useCallback(\n\t\t(innerProps) => {\n\t\t\tconst isDisabled = innerProps.disabled ?? disabled;\n\n\t\t\treturn {\n\t\t\t\t...getScopeAttrs(\"file-item-clear\"),\n\t\t\t\ttype: \"button\",\n\t\t\t\t...innerProps,\n\t\t\t\t\"data-disabled\": dataAttr(isDisabled),\n\t\t\t\tdisabled: isDisabled,\n\t\t\t\tonClick: composeTwoEventHandlers(actions.clearFiles, innerProps.onClick),\n\t\t\t};\n\t\t},\n\t\t[actions.clearFiles, disabled]\n\t);\n\n\tconst propGetters = useMemo<DropZonePropGetters>(\n\t\t() =>\n\t\t\t({\n\t\t\t\tgetContainerProps,\n\t\t\t\tgetFileItemClearProps,\n\t\t\t\tgetFileItemDeleteProps,\n\t\t\t\tgetFileItemMetadataProps,\n\t\t\t\tgetFileItemPreviewProps,\n\t\t\t\tgetFileItemProgressProps,\n\t\t\t\tgetFileItemProps,\n\t\t\t\tgetFileListProps,\n\t\t\t\tgetInputProps,\n\t\t\t\tgetTriggerProps,\n\t\t\t}) satisfies DropZonePropGetters,\n\t\t[\n\t\t\tgetContainerProps,\n\t\t\tgetFileListProps,\n\t\t\tgetFileItemClearProps,\n\t\t\tgetFileItemDeleteProps,\n\t\t\tgetFileItemMetadataProps,\n\t\t\tgetFileItemPreviewProps,\n\t\t\tgetFileItemProgressProps,\n\t\t\tgetFileItemProps,\n\t\t\tgetInputProps,\n\t\t\tgetTriggerProps,\n\t\t]\n\t);\n\n\tconst savedUseDropZoneStore = useCallbackRef(useDropZoneStore);\n\n\tconst result = useMemo<UseDropZoneResult>(\n\t\t() =>\n\t\t\t({\n\t\t\t\tdisabled,\n\t\t\t\tdisableInternalStateSubscription,\n\t\t\t\tinputRef,\n\t\t\t\tpropGetters,\n\t\t\t\tstoreApi,\n\t\t\t\tuseDropZoneStore: savedUseDropZoneStore,\n\t\t\t}) satisfies UseDropZoneResult,\n\t\t[disabled, disableInternalStateSubscription, propGetters, storeApi, savedUseDropZoneStore]\n\t);\n\n\treturn result;\n};\n","\"use client\";\n\nimport { dataAttr, formatBytes } from \"@zayne-labs/toolkit-core\";\nimport { useShallowCompSelector } from \"@zayne-labs/toolkit-react\";\nimport type {\n\tCssWithCustomProperties,\n\tInferProps,\n\tPolymorphicPropsStrict,\n} from \"@zayne-labs/toolkit-react/utils\";\nimport {\n\ttype AnyFunction,\n\tisBoolean,\n\tisFunction,\n\tisNumber,\n\ttype SelectorFn,\n} from \"@zayne-labs/toolkit-type-helpers\";\n\nimport { For } from \"@/components/common/for\";\nimport { Presence } from \"@/components/common/presence\";\nimport { Slot } from \"@/components/common/slot\";\nimport { cnMerge } from \"@/lib/utils/cn\";\nimport { useMemo } from \"react\";\nimport {\n\tDropZoneRootContextProvider,\n\ttype DropZoneRootContextType,\n\tDropZoneStoreContextProvider,\n\tFileItemContextProvider,\n\ttype FileItemContextType,\n\tuseDropZoneRootContext,\n\tuseDropZoneStoreContext,\n\tuseFileItemContext,\n} from \"./drop-zone-context\";\nimport {\n\tFileArchiveIcon,\n\tFileAudioIcon,\n\tFileCodeIcon,\n\tFileCogIcon,\n\tFileIcon,\n\tFileTextIcon,\n\tFileVideoIcon,\n} from \"./icons\";\nimport type { DropZoneStore, PartInputProps, UseDropZoneProps } from \"./types\";\nimport { useDropZone } from \"./use-drop-zone\";\n\ntype DropZoneRootProps = UseDropZoneProps & { children: React.ReactNode };\n\nexport function DropZoneRoot(props: DropZoneRootProps) {\n\tconst { children, ...restOfProps } = props;\n\n\tconst { disabled, disableInternalStateSubscription, inputRef, propGetters, storeApi } =\n\t\tuseDropZone(restOfProps);\n\n\tconst rootContextValue = useMemo<DropZoneRootContextType>(\n\t\t() =>\n\t\t\t({\n\t\t\t\tdisabled,\n\t\t\t\tdisableInternalStateSubscription,\n\t\t\t\tinputRef,\n\t\t\t\tpropGetters,\n\t\t\t}) satisfies DropZoneRootContextType,\n\t\t[disableInternalStateSubscription, disabled, inputRef, propGetters]\n\t);\n\n\treturn (\n\t\t<DropZoneStoreContextProvider store={storeApi}>\n\t\t\t<DropZoneRootContextProvider value={rootContextValue}>{children}</DropZoneRootContextProvider>\n\t\t</DropZoneStoreContextProvider>\n\t);\n}\n\ntype DropZoneContextProps<TSlice> = {\n\tchildren: React.ReactNode | ((context: TSlice) => React.ReactNode);\n\tselector?: SelectorFn<DropZoneStore, TSlice>;\n};\n\nexport function DropZoneContext<TSlice = DropZoneStore>(props: DropZoneContextProps<TSlice>) {\n\tconst { children, selector } = props;\n\n\tconst dropZoneCtx = useDropZoneStoreContext(useShallowCompSelector(selector));\n\n\tconst resolvedChildren = isFunction(children) ? children(dropZoneCtx) : children;\n\n\treturn resolvedChildren;\n}\n\ntype DropZoneContainerProps = PartInputProps[\"container\"] & { asChild?: boolean };\n\nexport function DropZoneContainer<TElement extends React.ElementType = \"div\">(\n\tprops: PolymorphicPropsStrict<TElement, DropZoneContainerProps>\n) {\n\tconst { as: Element = \"div\", asChild, ...restOfProps } = props;\n\n\tconst { disableInternalStateSubscription, propGetters } = useDropZoneRootContext();\n\n\tconst isDraggingOver = useDropZoneStoreContext((store) =>\n\t\tdisableInternalStateSubscription ? store.isDraggingOver : null\n\t);\n\n\tconst isInvalid = useDropZoneStoreContext((store) =>\n\t\tdisableInternalStateSubscription ? store.isInvalid : null\n\t);\n\n\tconst Component = asChild ? Slot.Root : Element;\n\n\treturn (\n\t\t<Component\n\t\t\t{...propGetters.getContainerProps({\n\t\t\t\t...(disableInternalStateSubscription && {\n\t\t\t\t\t\"data-drag-over\": dataAttr(isDraggingOver),\n\t\t\t\t\t\"data-invalid\": dataAttr(isInvalid),\n\t\t\t\t}),\n\t\t\t\t...restOfProps,\n\t\t\t})}\n\t\t/>\n\t);\n}\n\ntype DropZoneInputProps = PartInputProps[\"input\"] & { asChild?: boolean };\n\nexport function DropZoneInput(props: DropZoneInputProps) {\n\tconst { asChild, ...restOfProps } = props;\n\n\tconst { disableInternalStateSubscription, propGetters } = useDropZoneRootContext();\n\n\tconst isDraggingOver = useDropZoneStoreContext((store) =>\n\t\tdisableInternalStateSubscription ? store.isDraggingOver : null\n\t);\n\n\tconst Component = asChild ? Slot.Root : \"input\";\n\n\treturn (\n\t\t<Component\n\t\t\t{...propGetters.getInputProps({\n\t\t\t\t...(disableInternalStateSubscription && { \"data-drag-over\": dataAttr(isDraggingOver) }),\n\t\t\t\t...restOfProps,\n\t\t\t})}\n\t\t/>\n\t);\n}\n\ntype DropZoneAreaProps<TSlice> = DropZoneContextProps<TSlice>\n\t& PartInputProps[\"container\"] & {\n\t\tclassNames?: Partial<Record<Extract<keyof PartInputProps, \"container\" | \"input\">, string>>;\n\t\textraProps?: Partial<Pick<PartInputProps, \"container\" | \"input\">>;\n\t};\n\nexport function DropZoneArea<TSlice = DropZoneStore>(props: DropZoneAreaProps<TSlice>) {\n\tconst { children, className, classNames, extraProps, selector, ...restOfProps } = props;\n\n\treturn (\n\t\t<DropZoneContainer\n\t\t\t{...extraProps?.container}\n\t\t\t{...restOfProps}\n\t\t\tclassName={cnMerge(extraProps?.container?.className, className, classNames?.container)}\n\t\t>\n\t\t\t<DropZoneInput\n\t\t\t\t{...extraProps?.input}\n\t\t\t\tclassName={cnMerge(extraProps?.input?.className, classNames?.input)}\n\t\t\t/>\n\n\t\t\t<DropZoneContext selector={selector}>{children}</DropZoneContext>\n\t\t</DropZoneContainer>\n\t);\n}\n\ntype DropZoneTriggerProps = PartInputProps[\"trigger\"] & { asChild?: boolean };\n\nexport function DropZoneTrigger(props: DropZoneTriggerProps) {\n\tconst { asChild, ...restOfProps } = props;\n\n\tconst { propGetters } = useDropZoneRootContext();\n\n\tconst Component = asChild ? Slot.Root : \"button\";\n\n\treturn <Component {...propGetters.getTriggerProps(restOfProps)} />;\n}\n\ntype ListPerItemContext = Pick<DropZoneStore, \"actions\"> & {\n\tarray: DropZoneStore[\"fileStateArray\"];\n\tfileState: DropZoneStore[\"fileStateArray\"][number];\n\tindex: number;\n};\n\ntype FileListPerItemVariant = {\n\tchildren: React.ReactNode | ((context: ListPerItemContext) => React.ReactNode);\n\trenderMode?: \"per-item\";\n};\n\ntype ListManualListContext = Pick<DropZoneStore, \"actions\" | \"fileStateArray\">;\n\ntype FileListManualListVariant = {\n\tchildren: React.ReactNode | ((context: ListManualListContext) => React.ReactNode);\n\trenderMode: \"manual-list\";\n};\n\ntype DropZoneFileListProps = Omit<PartInputProps[\"fileList\"], \"children\"> & {\n\tasChild?: boolean;\n\tforceMount?: boolean;\n} & (FileListManualListVariant | FileListPerItemVariant);\n\nexport function DropZoneFileList<TElement extends React.ElementType = \"ul\">(\n\tprops: PolymorphicPropsStrict<TElement, DropZoneFileListProps>\n) {\n\tconst {\n\t\tas: Element = \"ul\",\n\t\tasChild,\n\t\tchildren,\n\t\tforceMount = false,\n\t\trenderMode = \"per-item\",\n\t\t...restOfProps\n\t} = props;\n\n\tconst fileStateArray = useDropZoneStoreContext((store) => store.fileStateArray);\n\tconst actions = useDropZoneStoreContext((store) => store.actions);\n\n\tconst { disableInternalStateSubscription, propGetters } = useDropZoneRootContext();\n\n\tconst childrenMap = {\n\t\t\"manual-list\": () => {\n\t\t\tconst childrenFn = children as Extract<FileListManualListVariant[\"children\"], AnyFunction>;\n\t\t\treturn childrenFn({ actions, fileStateArray });\n\t\t},\n\t\t\"per-item\": () => {\n\t\t\tconst childrenFn = children as Extract<FileListPerItemVariant[\"children\"], AnyFunction>;\n\n\t\t\treturn (\n\t\t\t\t<For\n\t\t\t\t\teach={fileStateArray}\n\t\t\t\t\trenderItem={(fileState, index, array) => childrenFn({ actions, array, fileState, index })}\n\t\t\t\t/>\n\t\t\t);\n\t\t},\n\t} satisfies Record<typeof renderMode, () => React.ReactNode>;\n\n\tconst hasFiles = fileStateArray.length > 0;\n\n\tconst Component = asChild ? Slot.Root : Element;\n\n\treturn (\n\t\t<Presence present={hasFiles} forceMount={forceMount}>\n\t\t\t<Component\n\t\t\t\t{...propGetters.getFileListProps({\n\t\t\t\t\t...(disableInternalStateSubscription && { \"data-state\": hasFiles ? \"active\" : \"inactive\" }),\n\t\t\t\t\t...restOfProps,\n\t\t\t\t})}\n\t\t\t>\n\t\t\t\t{isFunction(children) ? childrenMap[renderMode]() : children}\n\t\t\t</Component>\n\t\t</Presence>\n\t);\n}\n\ntype DropZoneFileItemProps = FileItemContextType & PartInputProps[\"fileItem\"] & { asChild?: boolean };\n\nexport function DropZoneFileItem<TElement extends React.ElementType = \"li\">(\n\tprops: PolymorphicPropsStrict<TElement, DropZoneFileItemProps>\n) {\n\tconst { as: Element = \"li\", asChild, fileState, ...restOfProps } = props;\n\n\tconst { propGetters } = useDropZoneRootContext();\n\n\tconst Component = asChild ? Slot.Root : Element;\n\n\tconst contextValue = useMemo<FileItemContextType>(\n\t\t() => ({ fileState }) satisfies FileItemContextType,\n\t\t[fileState]\n\t);\n\n\treturn (\n\t\t<FileItemContextProvider value={contextValue}>\n\t\t\t<Component {...propGetters.getFileItemProps(restOfProps)} />\n\t\t</FileItemContextProvider>\n\t);\n}\n\ntype DropZoneFileItemDeleteProps = PartInputProps[\"fileItemDelete\"] & { asChild?: boolean };\n\nexport function DropZoneFileItemDelete(props: DropZoneFileItemDeleteProps) {\n\tconst { asChild, fileStateOrID, ...restOfProps } = props;\n\n\tconst { propGetters } = useDropZoneRootContext();\n\n\tconst fileItemContextValue = useFileItemContext();\n\n\tconst Component = asChild ? Slot.Root : \"button\";\n\n\tconst resolvedFileStateOrID = fileStateOrID ?? fileItemContextValue?.fileState;\n\n\treturn (\n\t\t<Component\n\t\t\t{...propGetters.getFileItemDeleteProps({ fileStateOrID: resolvedFileStateOrID, ...restOfProps })}\n\t\t/>\n\t);\n}\n\ntype DropZoneFileItemProgressProps = PartInputProps[\"fileItemProgress\"] & {\n\tasChild?: boolean;\n\tforceMount?: boolean;\n\tsize?: number;\n};\n\nexport function DropZoneFileItemProgress<TElement extends React.ElementType = \"span\">(\n\tprops: PolymorphicPropsStrict<TElement, DropZoneFileItemProgressProps>\n) {\n\tconst {\n\t\tas: Element = \"span\",\n\t\tasChild,\n\t\tforceMount = false,\n\t\tsize = 40,\n\t\tvariant = \"linear\",\n\t\t...restOfProps\n\t} = props;\n\n\tconst fileItemContextValue = useFileItemContext();\n\n\tconst fileState = fileItemContextValue?.fileState;\n\n\tconst { propGetters } = useDropZoneRootContext();\n\n\tif (!fileState) {\n\t\treturn null;\n\t}\n\n\tconst currentProgress = fileState.progress;\n\n\tconst shouldRender = forceMount || fileState.progress !== 100;\n\n\tif (!shouldRender) {\n\t\treturn null;\n\t}\n\n\tconst Component = asChild ? Slot.Root : Element;\n\n\tconst componentProps = propGetters.getFileItemProgressProps({ variant, ...restOfProps });\n\n\tswitch (variant) {\n\t\tcase \"circular\": {\n\t\t\tconst circumference = 2 * Math.PI * ((size - 4) / 2);\n\t\t\tconst strokeDashoffset = circumference - (currentProgress / 100) * circumference;\n\n\t\t\treturn (\n\t\t\t\t<Component {...componentProps}>\n\t\t\t\t\t<svg\n\t\t\t\t\t\tclassName=\"-rotate-90\"\n\t\t\t\t\t\twidth={size}\n\t\t\t\t\t\theight={size}\n\t\t\t\t\t\tviewBox={`0 0 ${size} ${size}`}\n\t\t\t\t\t\tfill=\"none\"\n\t\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<circle\n\t\t\t\t\t\t\tclassName=\"text-zu-primary/20\"\n\t\t\t\t\t\t\tstrokeWidth=\"2\"\n\t\t\t\t\t\t\tcx={size / 2}\n\t\t\t\t\t\t\tcy={size / 2}\n\t\t\t\t\t\t\tr={(size - 4) / 2}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<circle\n\t\t\t\t\t\t\tclassName=\"text-zu-primary transition-[stroke-dashoffset] duration-300 ease-linear\"\n\t\t\t\t\t\t\tstrokeWidth=\"2\"\n\t\t\t\t\t\t\tstrokeLinecap=\"round\"\n\t\t\t\t\t\t\tstrokeDasharray={circumference}\n\t\t\t\t\t\t\tstrokeDashoffset={strokeDashoffset}\n\t\t\t\t\t\t\tcx={size / 2}\n\t\t\t\t\t\t\tcy={size / 2}\n\t\t\t\t\t\t\tr={(size - 4) / 2}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</svg>\n\t\t\t\t</Component>\n\t\t\t);\n\t\t}\n\n\t\tcase \"fill\": {\n\t\t\tconst topInset = 100 - currentProgress;\n\n\t\t\treturn (\n\t\t\t\t<Component\n\t\t\t\t\t{...componentProps}\n\t\t\t\t\tstyle={\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"--clip-path\": `inset(${topInset}% 0% 0% 0%)`,\n\t\t\t\t\t\t} satisfies CssWithCustomProperties as CssWithCustomProperties\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\n\t\tcase \"linear\": {\n\t\t\treturn (\n\t\t\t\t<Component {...componentProps}>\n\t\t\t\t\t<span\n\t\t\t\t\t\tclassName=\"inline-block size-full grow translate-x-(--translate-distance) bg-zu-primary transition-transform duration-300 ease-linear\"\n\t\t\t\t\t\tstyle={\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"--translate-distance\": `-${100 - currentProgress}%`,\n\t\t\t\t\t\t\t} satisfies CssWithCustomProperties as CssWithCustomProperties\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t</Component>\n\t\t\t);\n\t\t}\n\n\t\tdefault: {\n\t\t\tvariant satisfies never;\n\t\t\treturn null;\n\t\t}\n\t}\n}\n\ntype RenderPreviewDetails<TElement extends React.ElementType = \"svg\"> = { node?: React.ReactNode } & {\n\tprops?: InferProps<TElement>;\n};\n\ntype RenderPropContext = Pick<FileItemContextType, \"fileState\"> & {\n\tfileExtension: string;\n\tfileType: string;\n};\n\ntype RenderPreviewObject = {\n\tarchive?: RenderPreviewDetails;\n\taudio?: RenderPreviewDetails;\n\tcode?: RenderPreviewDetails;\n\tdefault?: RenderPreviewDetails;\n\texecutable?: RenderPreviewDetails;\n\timage?: RenderPreviewDetails<\"img\">;\n\ttext?: RenderPreviewDetails;\n\tvideo?: RenderPreviewDetails;\n};\ntype RenderPreviewFn = (context: RenderPropContext) => RenderPreviewObject;\n\ntype RenderPreview = RenderPreviewFn | RenderPreviewObject;\n\ntype DropZoneFileItemPreviewProps = Omit<PartInputProps[\"fileItemPreview\"], \"children\">\n\t& Partial<Pick<FileItemContextType, \"fileState\">> & {\n\t\tasChild?: boolean;\n\t\tchildren?:\n\t\t\t| React.ReactNode\n\t\t\t| ((context: RenderPropContext & { fallbackPreview: () => React.ReactNode }) => React.ReactNode);\n\t\trenderPreview?: boolean | RenderPreview;\n\t};\n\nexport function DropZoneFileItemPreview<TElement extends React.ElementType>(\n\tprops: PolymorphicPropsStrict<TElement, DropZoneFileItemPreviewProps>\n) {\n\tconst {\n\t\tas: Element = \"span\",\n\t\tasChild,\n\t\tchildren,\n\t\tfileState: fileStateProp,\n\t\trenderPreview = true,\n\t\t...restOfProps\n\t} = props;\n\n\tconst fileItemContextValue = useFileItemContext();\n\n\tconst { propGetters } = useDropZoneRootContext();\n\n\tconst fileState = fileStateProp ?? fileItemContextValue?.fileState;\n\n\tif (!fileState) {\n\t\treturn null;\n\t}\n\n\tconst fileType = fileState.file.type ?? \"\";\n\n\tconst fileExtension = fileState.file.name?.split(\".\").pop()?.toLowerCase() ?? \"\";\n\n\tconst Component = asChild ? Slot.Root : Element;\n\n\tconst fallbackPreview = () =>\n\t\tgetFilePreviewOrIcon({ fileExtension, fileState, fileType, renderPreview });\n\n\tconst resolvedChildren =\n\t\tisFunction(children) ? children({ fallbackPreview, fileExtension, fileState, fileType }) : children;\n\n\treturn (\n\t\t<Component {...propGetters.getFileItemPreviewProps(restOfProps)}>\n\t\t\t{renderPreview && fallbackPreview()}\n\t\t\t{resolvedChildren}\n\t\t</Component>\n\t);\n}\n\nconst getFilePreviewOrIcon = (\n\tcontext: Pick<Required<DropZoneFileItemPreviewProps>, \"renderPreview\"> & Required<RenderPropContext>\n) => {\n\tconst { fileExtension, fileState, fileType, renderPreview } = context;\n\n\tconst renderPreviewValue = isBoolean(renderPreview) ? {} : renderPreview;\n\n\tconst resolvedRenderPreviewObject =\n\t\tisFunction(renderPreviewValue) ?\n\t\t\trenderPreviewValue({ fileExtension, fileState, fileType })\n\t\t:\trenderPreviewValue;\n\n\tswitch (true) {\n\t\tcase fileType.startsWith(\"image/\"): {\n\t\t\treturn (\n\t\t\t\tresolvedRenderPreviewObject.image?.node ?? (\n\t\t\t\t\t<img\n\t\t\t\t\t\t{...resolvedRenderPreviewObject.image?.props}\n\t\t\t\t\t\tsrc={fileState.preview}\n\t\t\t\t\t\talt={fileState.file.name ?? \"\"}\n\t\t\t\t\t\tclassName={cnMerge(\n\t\t\t\t\t\t\t\"size-full object-cover\",\n\t\t\t\t\t\t\tresolvedRenderPreviewObject.image?.props?.className\n\t\t\t\t\t\t)}\n\t\t\t\t\t/>\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\tcase fileType.startsWith(\"video/\"): {\n\t\t\treturn (\n\t\t\t\tresolvedRenderPreviewObject.video?.node ?? (\n\t\t\t\t\t<FileVideoIcon\n\t\t\t\t\t\t{...resolvedRenderPreviewObject.video?.props}\n\t\t\t\t\t\tclassName={cnMerge(\n\t\t\t\t\t\t\t\"size-full object-cover\",\n\t\t\t\t\t\t\tresolvedRenderPreviewObject.video?.props?.className\n\t\t\t\t\t\t)}\n\t\t\t\t\t/>\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\tcase fileType.startsWith(\"audio/\"): {\n\t\t\treturn (\n\t\t\t\tresolvedRenderPreviewObject.audio?.node ?? (\n\t\t\t\t\t<FileAudioIcon\n\t\t\t\t\t\t{...resolvedRenderPreviewObject.audio?.props}\n\t\t\t\t\t\tclassName={cnMerge(\n\t\t\t\t\t\t\t\"size-full object-cover\",\n\t\t\t\t\t\t\tresolvedRenderPreviewObject.audio?.props?.className\n\t\t\t\t\t\t)}\n\t\t\t\t\t/>\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\tcase fileType.startsWith(\"text/\") || [\"md\", \"pdf\", \"rtf\", \"txt\"].includes(fileExtension): {\n\t\t\treturn (\n\t\t\t\tresolvedRenderPreviewObject.text?.node ?? (\n\t\t\t\t\t<FileTextIcon {...resolvedRenderPreviewObject.text?.props} />\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\tcase [\n\t\t\t\"c\",\n\t\t\t\"cpp\",\n\t\t\t\"cs\",\n\t\t\t\"css\",\n\t\t\t\"html\",\n\t\t\t\"java\",\n\t\t\t\"js\",\n\t\t\t\"json\",\n\t\t\t\"jsx\",\n\t\t\t\"php\",\n\t\t\t\"py\",\n\t\t\t\"rb\",\n\t\t\t\"ts\",\n\t\t\t\"tsx\",\n\t\t\t\"xml\",\n\t\t].includes(fileExtension): {\n\t\t\treturn (\n\t\t\t\tresolvedRenderPreviewObject.code?.node ?? (\n\t\t\t\t\t<FileCodeIcon {...resolvedRenderPreviewObject.code?.props} />\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\tcase [\"7z\", \"bz2\", \"gz\", \"rar\", \"tar\", \"zip\"].includes(fileExtension): {\n\t\t\treturn (\n\t\t\t\tresolvedRenderPreviewObject.archive?.node ?? (\n\t\t\t\t\t<FileArchiveIcon {...resolvedRenderPreviewObject.archive?.props} />\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\tcase [\"apk\", \"app\", \"deb\", \"exe\", \"msi\", \"rpm\"].includes(fileExtension): {\n\t\t\treturn (\n\t\t\t\tresolvedRenderPreviewObject.executable?.node ?? (\n\t\t\t\t\t<FileCogIcon {...resolvedRenderPreviewObject.executable?.props} />\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\tdefault: {\n\t\t\treturn (\n\t\t\t\tresolvedRenderPreviewObject.default?.node ?? (\n\t\t\t\t\t<FileIcon {...resolvedRenderPreviewObject.default?.props} />\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t}\n};\n\ntype DropZoneFileItemMetadataProps = Omit<PartInputProps[\"fileItemMetadata\"], \"children\">\n\t& Partial<Pick<FileItemContextType, \"fileState\">> & {\n\t\tasChild?: boolean;\n\t\tchildren?: React.ReactNode | ((context: Pick<FileItemContextType, \"fileState\">) => React.ReactNode);\n\t\tclassNames?: {\n\t\t\tname?: string;\n\t\t\tsize?: string;\n\t\t};\n\t\tsize?: \"default\" | \"sm\";\n\t};\n\nexport function DropZoneFileItemMetadata(props: DropZoneFileItemMetadataProps) {\n\tconst {\n\t\tasChild,\n\t\tchildren,\n\t\tclassNames,\n\t\tfileState: fileStateProp,\n\t\tsize = \"default\",\n\t\t...restOfProps\n\t} = props;\n\n\tconst fileItemContextValue = useFileItemContext();\n\n\tconst { propGetters } = useDropZoneRootContext();\n\n\tconst fileState = fileStateProp ?? fileItemContextValue?.fileState;\n\n\tif (!fileState) {\n\t\treturn null;\n\t}\n\n\tconst Component = asChild ? Slot.Root : \"div\";\n\n\tconst resolvedChildren = isFunction(children) ? children({ fileState }) : children;\n\n\tconst getDefaultMetadataChildren = () => {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<p\n\t\t\t\t\tclassName={cnMerge(\n\t\t\t\t\t\t\"truncate\",\n\t\t\t\t\t\tsize === \"default\" && \"text-[14px] font-medium\",\n\t\t\t\t\t\tsize === \"sm\" && \"text-[13px] leading-snug\",\n\t\t\t\t\t\tclassNames?.name\n\t\t\t\t\t)}\n\t\t\t\t>\n\t\t\t\t\t{fileState.file.name}\n\t\t\t\t</p>\n\t\t\t\t<p\n\t\t\t\t\tclassName={cnMerge(\n\t\t\t\t\t\t\"truncate text-zu-muted-foreground\",\n\t\t\t\t\t\tsize === \"default\" && \"text-[12px]\",\n\t\t\t\t\t\tsize === \"sm\" && \"text-[11px] leading-snug\",\n\t\t\t\t\t\tclassNames?.size\n\t\t\t\t\t)}\n\t\t\t\t>\n\t\t\t\t\t{isNumber(fileState.file.size) && formatBytes(fileState.file.size)}\n\t\t\t\t</p>\n\t\t\t\t{fileState.error && (\n\t\t\t\t\t<p className=\"text-[12px] text-zu-destructive\">{fileState.error.message}</p>\n\t\t\t\t)}\n\t\t\t</>\n\t\t);\n\t};\n\n\treturn (\n\t\t<Component {...propGetters.getFileItemMetadataProps(restOfProps)}>\n\t\t\t{resolvedChildren ?? getDefaultMetadataChildren()}\n\t\t</Component>\n\t);\n}\n\ntype DropZoneFileClearProps = PartInputProps[\"fileItemClear\"] & {\n\tasChild?: boolean;\n\tforceMount?: boolean;\n};\n\nexport function DropZoneFileClear(props: DropZoneFileClearProps) {\n\tconst { asChild, forceMount = false, ...restOfProps } = props;\n\n\tconst { propGetters } = useDropZoneRootContext();\n\n\tconst fileCount = useDropZoneStoreContext((state) => state.fileStateArray.length);\n\n\tconst shouldRender = forceMount || fileCount > 0;\n\n\tif (!shouldRender) {\n\t\treturn null;\n\t}\n\n\tconst Component = asChild ? Slot.Root : \"button\";\n\n\treturn <Component {...propGetters.getFileItemClearProps(restOfProps)} />;\n}\n","export {\n\tDropZoneArea as Area,\n\tDropZoneContainer as Container,\n\tDropZoneContext as Context,\n\tDropZoneFileClear as FileClear,\n\tDropZoneFileItem as FileItem,\n\tDropZoneFileItemDelete as FileItemDelete,\n\tDropZoneFileItemMetadata as FileItemMetadata,\n\tDropZoneFileItemPreview as FileItemPreview,\n\tDropZoneFileItemProgress as FileItemProgress,\n\tDropZoneFileList as FileList,\n\tDropZoneInput as Input,\n\tDropZoneRoot as Root,\n\tDropZoneTrigger as Trigger,\n} from \"./drop-zone\";\n"],"mappings":";;;;;;;;;;;;;;;;AAIA,MAAM,CAAC,8BAA8B,2BAA2B,wBAAuC;CACtG,UAAU;CACV,MAAM;CACN,cAAc;CACd,CAAC;AAOF,MAAM,CAAC,6BAA6B,0BAA0B,oBAC7D;CACC,UAAU;CACV,MAAM;CACN,cAAc;CACd,CACD;AAMD,MAAM,CAAC,yBAAyB,sBAAsB,oBAAoB;CACzE,cAAc;CACd,UAAU;CACV,MAAM;CACN,cAAc;CACd,QAAQ;CACR,CAAC;;;;ACjCF,MAAa,iBAAiB,UAC7B,oBAAC;CAAI,OAAM;CAA6B,OAAM;CAAM,QAAO;CAAM,SAAQ;CAAY,GAAI;WAExF,qBAAC;EAAE,MAAK;EAAO,QAAO;EAAe,eAAc;EAAQ,gBAAe;EAAQ,aAAY;aAC7F,oBAAC,UAAK,GAAE,+DAA+D,EACvE,oBAAC,UAAK,GAAE,4CAA4C;GACjD;EACC;AAGP,MAAa,iBAAiB,UAC7B,oBAAC;CAAI,OAAM;CAA6B,OAAM;CAAM,QAAO;CAAM,SAAQ;CAAY,GAAI;WAExF,qBAAC;EAAE,MAAK;EAAO,QAAO;EAAe,eAAc;EAAQ,gBAAe;EAAQ,aAAY;aAC7F,oBAAC,UAAK,GAAE,uDAAuD,EAC/D,oBAAC,UAAK,GAAE,kHAAkH;GACvH;EACC;AAGP,MAAa,gBAAgB,UA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,UAAU,KAAK,KAAK;KAC/D;GACH,UAAU,SACV,oBAAC;IAAE,WAAU;cAAmC,UAAU,MAAM;KAAY;MAE3E;;AAIL,QACC,oBAACC;EAAU,GAAI,YAAY,yBAAyB,YAAY;YAC9D,oBAAoB,4BAA4B;GACtC;;AASd,SAAgB,kBAAkB,OAA+B;CAChE,MAAM,EAAE,SAAS,aAAa,OAAO,GAAG,gBAAgB;CAExD,MAAM,EAAE,gBAAgB,wBAAwB;CAEhD,MAAM,YAAY,yBAAyB,UAAU,MAAM,eAAe,OAAO;AAIjF,KAAI,EAFiB,cAAc,YAAY,GAG9C,QAAO;AAKR,QAAO,oBAFW,UAAUD,WAAY,YAEtB,GAAI,YAAY,sBAAsB,YAAY,GAAI"}
@@ -1,8 +1,8 @@
1
1
  import { DiscriminatedRenderItemProps, DiscriminatedRenderProps, InferProps, PolymorphicPropsStrict } from "@zayne-labs/toolkit-react/utils";
2
2
  import { UnionDiscriminator } from "@zayne-labs/toolkit-type-helpers";
3
- import * as react37 from "react";
3
+ import * as react20 from "react";
4
4
  import "@zayne-labs/toolkit-react";
5
- import * as react_jsx_runtime32 from "react/jsx-runtime";
5
+ import * as react_jsx_runtime30 from "react/jsx-runtime";
6
6
  import { Control, ControllerFieldState, ControllerProps, ControllerRenderProps, FieldPath, FieldPathValue, FieldPathValues, RegisterOptions, UseFormReturn, UseFormStateReturn, useFormContext as useFormRootContext } from "react-hook-form";
7
7
 
8
8
  //#region src/components/ui/form/form-context.d.ts
@@ -38,7 +38,7 @@ type FormRootProps<TFieldValues extends FieldValues> = InferProps<"form"> & Part
38
38
  children: React.ReactNode;
39
39
  methods: UseFormReturn<TFieldValues>;
40
40
  };
41
- declare function FormRoot<TValues$1 extends FieldValues>(props: FormRootProps<TValues$1>): react_jsx_runtime32.JSX.Element;
41
+ declare function FormRoot<TValues$1 extends FieldValues>(props: FormRootProps<TValues$1>): react_jsx_runtime30.JSX.Element;
42
42
  type FormFieldProps<TControl, TFieldValues extends FieldValues> = (TControl extends (Control<infer TValues>) ? {
43
43
  control?: never;
44
44
  name: FieldPath<TValues>;
@@ -52,7 +52,7 @@ type FormFieldProps<TControl, TFieldValues extends FieldValues> = (TControl exte
52
52
  className?: never;
53
53
  withWrapper: false;
54
54
  });
55
- declare function FormField<TControl, TFieldValues extends FieldValues = FieldValues>(props: FormFieldProps<TControl, TFieldValues>): react_jsx_runtime32.JSX.Element;
55
+ declare function FormField<TControl, TFieldValues extends FieldValues = FieldValues>(props: FormFieldProps<TControl, TFieldValues>): react_jsx_runtime30.JSX.Element;
56
56
  type FormFieldControllerRenderFn = (props: {
57
57
  field: Omit<ControllerRenderProps, "value"> & {
58
58
  value: never;
@@ -63,20 +63,20 @@ type FormFieldControllerRenderFn = (props: {
63
63
  type FormFieldControllerProps = Omit<ControllerProps<FieldValues, FieldPath<FieldValues>>, "control" | "name" | "render"> & {
64
64
  render: FormFieldControllerRenderFn;
65
65
  };
66
- declare function FormFieldController(props: FormFieldControllerProps): react_jsx_runtime32.JSX.Element;
67
- declare function FormFieldControlledField<TFieldValues extends FieldValues>(props: ControllerProps<TFieldValues>): react_jsx_runtime32.JSX.Element;
68
- declare function FormFieldContext(props: FormFieldContextProps): react37.ReactNode;
69
- declare function FormLabel(props: InferProps<"label">): react_jsx_runtime32.JSX.Element;
70
- declare function FormInputGroup(props: InferProps<"div">): react_jsx_runtime32.JSX.Element;
66
+ declare function FormFieldController(props: FormFieldControllerProps): react_jsx_runtime30.JSX.Element;
67
+ declare function FormFieldControlledField<TFieldValues extends FieldValues>(props: ControllerProps<TFieldValues>): react_jsx_runtime30.JSX.Element;
68
+ declare function FormFieldContext(props: FormFieldContextProps): react20.ReactNode;
69
+ declare function FormLabel(props: InferProps<"label">): react_jsx_runtime30.JSX.Element;
70
+ declare function FormInputGroup(props: InferProps<"div">): react_jsx_runtime30.JSX.Element;
71
71
  type FormSideItemProps = {
72
72
  children?: React.ReactNode;
73
73
  className?: string;
74
74
  };
75
- declare function FormInputLeftItem<TElement extends React.ElementType = "span">(props: PolymorphicPropsStrict<TElement, FormSideItemProps>): react_jsx_runtime32.JSX.Element;
75
+ declare function FormInputLeftItem<TElement extends React.ElementType = "span">(props: PolymorphicPropsStrict<TElement, FormSideItemProps>): react_jsx_runtime30.JSX.Element;
76
76
  declare namespace FormInputLeftItem {
77
77
  var slotSymbol: symbol;
78
78
  }
79
- declare function FormInputRightItem<TElement extends React.ElementType = "span">(props: PolymorphicPropsStrict<TElement, FormSideItemProps>): react_jsx_runtime32.JSX.Element;
79
+ declare function FormInputRightItem<TElement extends React.ElementType = "span">(props: PolymorphicPropsStrict<TElement, FormSideItemProps>): react_jsx_runtime30.JSX.Element;
80
80
  declare namespace FormInputRightItem {
81
81
  var slotSymbol: symbol;
82
82
  }
@@ -112,13 +112,13 @@ type FormSelectPrimitiveProps<TFieldValues extends FieldValues = FieldValues> =
112
112
  };
113
113
  declare function FormInputPrimitive<TFieldValues extends FieldValues>(props: FormInputPrimitiveProps<TFieldValues> & {
114
114
  rules?: RegisterOptions;
115
- }): react_jsx_runtime32.JSX.Element;
115
+ }): react_jsx_runtime30.JSX.Element;
116
116
  declare function FormTextAreaPrimitive<TFieldValues extends FieldValues>(props: FormTextAreaPrimitiveProps<TFieldValues> & {
117
117
  rules?: RegisterOptions;
118
- }): react_jsx_runtime32.JSX.Element;
118
+ }): react_jsx_runtime30.JSX.Element;
119
119
  declare function FormSelectPrimitive<TFieldValues extends FieldValues>(props: FormSelectPrimitiveProps<TFieldValues> & {
120
120
  rules?: RegisterOptions;
121
- }): react_jsx_runtime32.JSX.Element;
121
+ }): react_jsx_runtime30.JSX.Element;
122
122
  type PrimitivePropsToOmit = "control" | "formState" | "name";
123
123
  type FormInputProps = Omit<FormInputPrimitiveProps, PrimitivePropsToOmit> & {
124
124
  rules?: RegisterOptions;
@@ -136,10 +136,10 @@ type CombinedFormInputProps = (FormSelectProps & {
136
136
  }) | FormInputProps;
137
137
  declare function FormInput(props: CombinedFormInputProps & {
138
138
  rules?: RegisterOptions;
139
- }): react_jsx_runtime32.JSX.Element;
140
- declare function FormTextArea(props: FormTextAreaProps): react_jsx_runtime32.JSX.Element;
141
- declare function FormSelect(props: FormSelectProps): react_jsx_runtime32.JSX.Element;
142
- declare function FormDescription(props: InferProps<"p">): react_jsx_runtime32.JSX.Element;
139
+ }): react_jsx_runtime30.JSX.Element;
140
+ declare function FormTextArea(props: FormTextAreaProps): react_jsx_runtime30.JSX.Element;
141
+ declare function FormSelect(props: FormSelectProps): react_jsx_runtime30.JSX.Element;
142
+ declare function FormDescription(props: InferProps<"p">): react_jsx_runtime30.JSX.Element;
143
143
  type ErrorMessageRenderProps = {
144
144
  className: string;
145
145
  "data-index": number;
@@ -199,11 +199,11 @@ type FormErrorMessageProps<TControl, TFieldValues extends FieldValues> = (TContr
199
199
  errorField: string;
200
200
  type: "root";
201
201
  };
202
- declare function FormErrorMessage<TControl, TFieldValues extends FieldValues = FieldValues>(props: FormErrorMessageProps<TControl, TFieldValues>): react_jsx_runtime32.JSX.Element;
202
+ declare function FormErrorMessage<TControl, TFieldValues extends FieldValues = FieldValues>(props: FormErrorMessageProps<TControl, TFieldValues>): react_jsx_runtime30.JSX.Element;
203
203
  type FormSubmitProps = InferProps<"button"> & {
204
204
  asChild?: boolean;
205
205
  };
206
- declare function FormSubmit<TElement extends React.ElementType = "button">(props: PolymorphicPropsStrict<TElement, FormSubmitProps>): react_jsx_runtime32.JSX.Element;
206
+ declare function FormSubmit<TElement extends React.ElementType = "button">(props: PolymorphicPropsStrict<TElement, FormSubmitProps>): react_jsx_runtime30.JSX.Element;
207
207
  type GetFieldValue<TFieldPathOrPaths, TFieldValues extends FieldValues> = TFieldPathOrPaths extends Array<FieldPath<TFieldValues>> ? FieldPathValues<TFieldValues, TFieldPathOrPaths> : TFieldPathOrPaths extends FieldPath<TFieldValues> ? FieldPathValue<TFieldValues, TFieldPathOrPaths> : unknown;
208
208
  type FormWatchRenderFn<TFieldValues extends FieldValues, TFieldPathOrPaths> = (props: {
209
209
  value: GetFieldValue<TFieldPathOrPaths, TFieldValues>;
@@ -212,13 +212,13 @@ type FormWatchProps<TFieldValues extends FieldValues, TFieldPathOrPaths> = Discr
212
212
  control: Control<TFieldValues>;
213
213
  name?: TFieldPathOrPaths;
214
214
  };
215
- declare function FormWatch<TFieldValues extends FieldValues, const TFieldPathOrPaths extends Array<FieldPath<TFieldValues>> | FieldPath<TFieldValues>>(props: FormWatchProps<TFieldValues, TFieldPathOrPaths>): react37.ReactNode;
215
+ declare function FormWatch<TFieldValues extends FieldValues, const TFieldPathOrPaths extends Array<FieldPath<TFieldValues>> | FieldPath<TFieldValues>>(props: FormWatchProps<TFieldValues, TFieldPathOrPaths>): react20.ReactNode;
216
216
  type FormWatchFormStateRenderFn<TFieldValues extends FieldValues> = (props: UseFormStateReturn<TFieldValues>) => React.ReactNode;
217
217
  type FormWatchFormStateProps<TFieldValues extends FieldValues> = DiscriminatedRenderProps<FormWatchFormStateRenderFn<TFieldValues>> & {
218
218
  control?: Control<TFieldValues>;
219
219
  name?: Array<FieldPath<TFieldValues>> | FieldPath<TFieldValues>;
220
220
  };
221
- declare function FormWatchFormState<TFieldValues extends FieldValues = FieldValues>(props: FormWatchFormStateProps<TFieldValues>): react37.ReactNode;
221
+ declare function FormWatchFormState<TFieldValues extends FieldValues = FieldValues>(props: FormWatchFormStateProps<TFieldValues>): react20.ReactNode;
222
222
  declare namespace form_parts_d_exports {
223
223
  export { FormFieldControlledField as ControlledField, FormDescription as Description, FormErrorMessage as ErrorMessage, FormErrorMessagePrimitive as ErrorMessagePrimitive, FormField as Field, FormFieldContext as FieldContext, FormFieldController as FieldController, FormInput as Input, FormInputGroup as InputGroup, FormInputLeftItem as InputLeftItem, FormInputPrimitive as InputPrimitive, FormInputRightItem as InputRightItem, FormLabel as Label, FormRoot as Root, FormSelect as Select, FormSubmit as Submit, FormTextArea as TextArea, FormTextAreaPrimitive as TextAreaPrimitive, FormWatch as Watch, FormWatchFormState as WatchFormState };
224
224
  }
package/dist/style.css CHANGED
@@ -654,27 +654,22 @@
654
654
  opacity: 50%;
655
655
  }
656
656
  }
657
- .data-\[disabled\]\:pointer-events-none {
657
+ .data-disabled\:pointer-events-none {
658
658
  &[data-disabled] {
659
659
  pointer-events: none;
660
660
  }
661
661
  }
662
- .data-\[drag-over\]\:opacity-60 {
662
+ .data-drag-over\:opacity-60 {
663
663
  &[data-drag-over] {
664
664
  opacity: 60%;
665
665
  }
666
666
  }
667
- .data-\[index\=0\]\:mt-1 {
668
- &[data-index="0"] {
669
- margin-top: calc(var(--spacing) * 1);
670
- }
671
- }
672
- .data-\[invalid\]\:border-zu-destructive {
667
+ .data-invalid\:border-zu-destructive {
673
668
  &[data-invalid] {
674
669
  border-color: var(--color-zu-destructive);
675
670
  }
676
671
  }
677
- .data-\[invalid\]\:ring-zu-destructive\/20 {
672
+ .data-invalid\:ring-zu-destructive\/20 {
678
673
  &[data-invalid] {
679
674
  --tw-ring-color: color-mix(in srgb, oklch(0.577 0.245 27.325) 20%, transparent);
680
675
  @supports (color: color-mix(in lab, red, red)) {
@@ -682,6 +677,11 @@
682
677
  }
683
678
  }
684
679
  }
680
+ .data-\[index\=0\]\:mt-1 {
681
+ &[data-index="0"] {
682
+ margin-top: calc(var(--spacing) * 1);
683
+ }
684
+ }
685
685
  .data-\[state\=active\]\:animate-files-in {
686
686
  &[data-state="active"] {
687
687
  animation: var(--animate-files-in);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@zayne-labs/ui-react",
3
3
  "type": "module",
4
- "version": "0.10.38",
4
+ "version": "0.10.39",
5
5
  "description": "A composable UI/UI-utilities components library. ",
6
6
  "author": "Ryan Zayne",
7
7
  "license": "MIT",
@@ -46,9 +46,9 @@
46
46
  }
47
47
  },
48
48
  "dependencies": {
49
- "@zayne-labs/toolkit-core": "0.12.15",
50
- "@zayne-labs/toolkit-react": "0.12.15",
51
- "@zayne-labs/toolkit-type-helpers": "0.12.15"
49
+ "@zayne-labs/toolkit-core": "0.12.16",
50
+ "@zayne-labs/toolkit-react": "0.12.16",
51
+ "@zayne-labs/toolkit-type-helpers": "0.12.16"
52
52
  },
53
53
  "devDependencies": {
54
54
  "@arethetypeswrong/cli": "0.18.2",
@@ -63,13 +63,13 @@
63
63
  "cross-env": "10.1.0",
64
64
  "publint": "0.3.15",
65
65
  "publish": "0.6.0",
66
- "react": "19.2.0",
67
- "react-dom": "19.2.0",
68
- "react-hook-form": "7.67.0",
66
+ "react": "19.2.1",
67
+ "react-dom": "19.2.1",
68
+ "react-hook-form": "7.68.0",
69
69
  "size-limit": "12.0.0",
70
70
  "tailwind-merge": "3.4.0",
71
71
  "tailwindcss": "4.1.17",
72
- "tsdown": "0.17.0-beta.4",
72
+ "tsdown": "0.17.0",
73
73
  "tw-animate-css": "1.4.0",
74
74
  "typescript": "5.9.3"
75
75
  },