@spark-ui/components 11.5.1 → 11.6.1

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.
@@ -2,9 +2,9 @@ import {
2
2
  Dialog
3
3
  } from "../chunk-WLI4EPS6.mjs";
4
4
  import "../chunk-DCXWGQVZ.mjs";
5
+ import "../chunk-UMUMFMFB.mjs";
5
6
  import "../chunk-2YM6GKWW.mjs";
6
7
  import "../chunk-GAK4SC2F.mjs";
7
- import "../chunk-UMUMFMFB.mjs";
8
8
  import "../chunk-KEGAAGJW.mjs";
9
9
  import "../chunk-6QCEPQ3U.mjs";
10
10
 
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  IconButton
3
3
  } from "../chunk-DCXWGQVZ.mjs";
4
- import "../chunk-2YM6GKWW.mjs";
5
- import "../chunk-GAK4SC2F.mjs";
6
4
  import {
7
5
  Icon
8
6
  } from "../chunk-UMUMFMFB.mjs";
7
+ import "../chunk-2YM6GKWW.mjs";
8
+ import "../chunk-GAK4SC2F.mjs";
9
9
  import "../chunk-KEGAAGJW.mjs";
10
10
  import {
11
11
  Slot
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  IconButton
3
3
  } from "../chunk-DCXWGQVZ.mjs";
4
- import "../chunk-2YM6GKWW.mjs";
5
- import "../chunk-GAK4SC2F.mjs";
6
4
  import {
7
5
  Icon
8
6
  } from "../chunk-UMUMFMFB.mjs";
7
+ import "../chunk-2YM6GKWW.mjs";
8
+ import "../chunk-GAK4SC2F.mjs";
9
9
  import "../chunk-KEGAAGJW.mjs";
10
10
  import "../chunk-6QCEPQ3U.mjs";
11
11
 
@@ -73,10 +73,17 @@ var ProgressIndicator = ({
73
73
  className,
74
74
  style,
75
75
  ref,
76
+ onTransitionEnd,
76
77
  ...others
77
78
  }) => {
78
- const { value, max, intent, shape, isIndeterminate } = useProgress();
79
+ const { value, max, intent, shape, isIndeterminate, onComplete } = useProgress();
79
80
  const x = (max - value) / max * 100;
81
+ const handleTransitionEnd = (event) => {
82
+ onTransitionEnd?.(event);
83
+ if (value >= max && onComplete && !isIndeterminate) {
84
+ onComplete();
85
+ }
86
+ };
80
87
  return /* @__PURE__ */ jsx(
81
88
  RadixProgress.ProgressIndicator,
82
89
  {
@@ -84,6 +91,7 @@ var ProgressIndicator = ({
84
91
  className: progressIndicatorStyles({ className, intent, shape, isIndeterminate }),
85
92
  style: { ...style, ...!isIndeterminate && { transform: `translateX(-${x}%)` } },
86
93
  ref,
94
+ onTransitionEnd: handleTransitionEnd,
87
95
  ...others
88
96
  }
89
97
  );
@@ -121,14 +129,23 @@ var Progress = ({
121
129
  shape = "square",
122
130
  intent = "basic",
123
131
  isIndeterminate = false,
132
+ onComplete,
124
133
  children = /* @__PURE__ */ jsx3(ProgressBar, {}),
125
134
  ref,
126
135
  ...others
127
136
  }) => {
128
137
  const [labelId, setLabelId] = useState();
129
138
  const value = useMemo(() => {
130
- return { value: valueProp ?? 0, max, intent, shape, isIndeterminate, onLabelId: setLabelId };
131
- }, [max, valueProp, intent, shape, isIndeterminate, setLabelId]);
139
+ return {
140
+ value: valueProp ?? 0,
141
+ max,
142
+ intent,
143
+ shape,
144
+ isIndeterminate,
145
+ onLabelId: setLabelId,
146
+ onComplete
147
+ };
148
+ }, [max, valueProp, intent, shape, isIndeterminate, setLabelId, onComplete]);
132
149
  return /* @__PURE__ */ jsx3(ProgressContext.Provider, { "data-spark-component": "progress", value, children: /* @__PURE__ */ jsx3(
133
150
  RadixProgress2.Progress,
134
151
  {
@@ -194,4 +211,4 @@ ProgressLabel.displayName = "Progress.Label";
194
211
  export {
195
212
  Progress2 as Progress
196
213
  };
197
- //# sourceMappingURL=chunk-TKAU6SMC.mjs.map
214
+ //# sourceMappingURL=chunk-7EWSMIZU.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/progress/Progress.tsx","../src/progress/ProgressBar.styles.ts","../src/progress/ProgressContext.tsx","../src/progress/ProgressIndicator.tsx","../src/progress/ProgressIndicator.styles.ts","../src/progress/ProgressBar.tsx","../src/progress/ProgressLabel.tsx","../src/progress/index.ts"],"sourcesContent":["import { cx } from 'class-variance-authority'\nimport { Progress as RadixProgress } from 'radix-ui'\nimport { PropsWithChildren, Ref, useMemo, useState } from 'react'\n\nimport { ProgressBar } from './ProgressBar'\nimport { ProgressContext } from './ProgressContext'\nimport { ProgressIndicatorStylesProps } from './ProgressIndicator.styles'\n\nexport interface ProgressProps\n extends RadixProgress.ProgressProps,\n Pick<ProgressIndicatorStylesProps, 'intent'> {\n shape?: 'square' | 'rounded'\n isIndeterminate?: boolean\n /**\n * Callback called when the progress reaches its maximum value and the transition animation completes.\n */\n onComplete?: () => void\n ref?: Ref<HTMLDivElement>\n}\n\nexport const Progress = ({\n className,\n value: valueProp,\n max = 100,\n shape = 'square',\n intent = 'basic',\n isIndeterminate = false,\n onComplete,\n children = <ProgressBar />,\n ref,\n ...others\n}: PropsWithChildren<ProgressProps>) => {\n const [labelId, setLabelId] = useState<string>()\n\n const value = useMemo(() => {\n return {\n value: valueProp ?? 0,\n max,\n intent,\n shape,\n isIndeterminate,\n onLabelId: setLabelId,\n onComplete,\n }\n }, [max, valueProp, intent, shape, isIndeterminate, setLabelId, onComplete])\n\n return (\n <ProgressContext.Provider data-spark-component=\"progress\" value={value}>\n <RadixProgress.Progress\n data-spark-component=\"progress\"\n ref={ref}\n className={cx('gap-sm focus-visible:u-outline flex flex-col', className)}\n value={valueProp}\n aria-labelledby={labelId}\n max={max}\n tabIndex={-1}\n {...others}\n >\n {children}\n </RadixProgress.Progress>\n </ProgressContext.Provider>\n )\n}\n\nProgress.displayName = 'Progress'\n","import { cva, VariantProps } from 'class-variance-authority'\n\nexport const progressBarStyles = cva(\n ['relative', 'h-sz-4 w-full', 'transform-gpu overflow-hidden', 'bg-on-background/dim-4'],\n {\n variants: {\n shape: {\n square: [],\n rounded: ['rounded-sm'],\n },\n },\n }\n)\n\nexport type ProgressBarStylesProps = VariantProps<typeof progressBarStyles>\n","import { createContext, useContext } from 'react'\n\nimport { ProgressIndicatorStylesProps } from './ProgressIndicator.styles'\n\nexport interface ProgressContextValue {\n value: number\n max: number\n isIndeterminate: boolean\n shape: 'square' | 'rounded'\n intent: ProgressIndicatorStylesProps['intent']\n onLabelId: (id?: string) => void\n onComplete?: () => void\n}\n\nexport const ProgressContext = createContext<ProgressContextValue | null>(null)\n\nexport const ID_PREFIX = ':progress'\n\nexport const useProgress = () => {\n const context = useContext(ProgressContext)\n\n if (!context) {\n throw new Error('useProgress must be used within a Progress provider')\n }\n\n return context\n}\n","import { Progress as RadixProgress } from 'radix-ui'\nimport { ComponentPropsWithRef, PropsWithChildren } from 'react'\n\nimport { useProgress } from './ProgressContext'\nimport { progressIndicatorStyles } from './ProgressIndicator.styles'\n\nexport type ProgressIndicatorProps = ComponentPropsWithRef<'div'>\n\nexport const ProgressIndicator = ({\n className,\n style,\n ref,\n onTransitionEnd,\n ...others\n}: PropsWithChildren<ProgressIndicatorProps>) => {\n const { value, max, intent, shape, isIndeterminate, onComplete } = useProgress()\n const x = ((max - value) / max) * 100\n\n const handleTransitionEnd = (event: React.TransitionEvent<HTMLDivElement>) => {\n // Call the original onTransitionEnd if provided\n onTransitionEnd?.(event)\n\n // If progress is complete and we have a callback, call it\n if (value >= max && onComplete && !isIndeterminate) {\n onComplete()\n }\n }\n\n return (\n <RadixProgress.ProgressIndicator\n data-spark-component=\"progress-indicator\"\n className={progressIndicatorStyles({ className, intent, shape, isIndeterminate })}\n style={{ ...style, ...(!isIndeterminate && { transform: `translateX(-${x}%)` }) }}\n ref={ref}\n onTransitionEnd={handleTransitionEnd}\n {...others}\n />\n )\n}\n\nProgressIndicator.displayName = 'Progress.Indicator'\n","import { cva, VariantProps } from 'class-variance-authority'\n\nexport const progressIndicatorStyles = cva(['h-full w-full', 'transition-transform duration-400'], {\n variants: {\n /**\n * Color scheme of the progress component.\n */\n intent: {\n basic: ['bg-basic'],\n main: ['bg-main'],\n support: ['bg-support'],\n accent: ['bg-accent'],\n success: ['bg-success'],\n alert: ['bg-alert'],\n danger: ['bg-error'],\n info: ['bg-info'],\n neutral: ['bg-neutral'],\n },\n /**\n * Shape of the progress component.\n */\n shape: {\n square: [],\n rounded: ['rounded-sm'],\n },\n /**\n * Sets if the progress value is not determinated.\n */\n isIndeterminate: {\n true: ['absolute', '-translate-x-1/2', 'animate-standalone-indeterminate-bar'],\n false: [],\n },\n },\n})\n\nexport type ProgressIndicatorStylesProps = VariantProps<typeof progressIndicatorStyles>\n","import { ComponentPropsWithRef, PropsWithChildren } from 'react'\n\nimport { progressBarStyles } from './ProgressBar.styles'\nimport { useProgress } from './ProgressContext'\nimport { ProgressIndicator } from './ProgressIndicator'\n\nexport type ProgressBarProps = ComponentPropsWithRef<'div'>\n\nexport const ProgressBar = ({\n className,\n children = <ProgressIndicator />,\n ref,\n ...others\n}: PropsWithChildren<ProgressBarProps>) => {\n const { shape } = useProgress()\n\n return (\n <div\n data-spark-component=\"progress-bar\"\n className={progressBarStyles({ className, shape })}\n ref={ref}\n {...others}\n >\n {children}\n </div>\n )\n}\n\nProgressBar.displayName = 'Progress.Bar'\n","import { useMergeRefs } from '@spark-ui/hooks/use-merge-refs'\nimport { ComponentPropsWithRef, useCallback, useId } from 'react'\n\nimport { ID_PREFIX, useProgress } from './ProgressContext'\n\nexport type ProgressLabelProps = ComponentPropsWithRef<'span'>\n\nexport const ProgressLabel = ({\n id: idProp,\n children,\n ref: forwardedRef,\n ...others\n}: ProgressLabelProps) => {\n const internalID = `${ID_PREFIX}-label-${useId()}`\n const id = idProp || internalID\n\n const { onLabelId } = useProgress()\n const rootRef = useCallback(\n (el: HTMLSpanElement) => {\n onLabelId(el ? id : undefined)\n },\n [id, onLabelId]\n )\n const ref = useMergeRefs(forwardedRef, rootRef)\n\n return (\n <span\n data-spark-component=\"progress-label\"\n id={id}\n className=\"text-body-2 text-on-surface\"\n ref={ref}\n {...others}\n >\n {children}\n </span>\n )\n}\n\nProgressLabel.displayName = 'Progress.Label'\n","import { Progress as Root } from './Progress'\nimport { ProgressBar } from './ProgressBar'\nimport { ProgressIndicator } from './ProgressIndicator'\nimport { ProgressLabel } from './ProgressLabel'\n\nexport const Progress: typeof Root & {\n Label: typeof ProgressLabel\n Bar: typeof ProgressBar\n Indicator: typeof ProgressIndicator\n} = Object.assign(Root, {\n Label: ProgressLabel,\n Bar: ProgressBar,\n Indicator: ProgressIndicator,\n})\n\nProgress.displayName = 'Progress'\nProgressBar.displayName = 'Progress.Bar'\nProgressIndicator.displayName = 'Progress.Indicator'\nProgressLabel.displayName = 'Progress.Label'\n\nexport { type ProgressProps } from './Progress'\nexport { type ProgressBarProps } from './ProgressBar'\nexport { type ProgressLabelProps } from './ProgressLabel'\nexport { type ProgressIndicatorProps } from './ProgressIndicator'\n"],"mappings":";AAAA,SAAS,UAAU;AACnB,SAAS,YAAYA,sBAAqB;AAC1C,SAAiC,SAAS,gBAAgB;;;ACF1D,SAAS,WAAyB;AAE3B,IAAM,oBAAoB;AAAA,EAC/B,CAAC,YAAY,iBAAiB,iCAAiC,wBAAwB;AAAA,EACvF;AAAA,IACE,UAAU;AAAA,MACR,OAAO;AAAA,QACL,QAAQ,CAAC;AAAA,QACT,SAAS,CAAC,YAAY;AAAA,MACxB;AAAA,IACF;AAAA,EACF;AACF;;;ACZA,SAAS,eAAe,kBAAkB;AAcnC,IAAM,kBAAkB,cAA2C,IAAI;AAEvE,IAAM,YAAY;AAElB,IAAM,cAAc,MAAM;AAC/B,QAAM,UAAU,WAAW,eAAe;AAE1C,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI,MAAM,qDAAqD;AAAA,EACvE;AAEA,SAAO;AACT;;;AC1BA,SAAS,YAAY,qBAAqB;;;ACA1C,SAAS,OAAAC,YAAyB;AAE3B,IAAM,0BAA0BA,KAAI,CAAC,iBAAiB,mCAAmC,GAAG;AAAA,EACjG,UAAU;AAAA;AAAA;AAAA;AAAA,IAIR,QAAQ;AAAA,MACN,OAAO,CAAC,UAAU;AAAA,MACl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B,IAAI;AAAA,EACJ;AAAA,EACA,KAAK;AAAA,EACL,GAAG;AACL,MAA0B;AACxB,QAAM,aAAa,GAAG,SAAS,UAAU,MAAM,CAAC;AAChD,QAAM,KAAK,UAAU;AAErB,QAAM,EAAE,UAAU,IAAI,YAAY;AAClC,QAAM,UAAU;AAAA,IACd,CAAC,OAAwB;AACvB,gBAAU,KAAK,KAAK,MAAS;AAAA,IAC/B;AAAA,IACA,CAAC,IAAI,SAAS;AAAA,EAChB;AACA,QAAM,MAAM,aAAa,cAAc,OAAO;AAE9C,SACE,gBAAAA;AAAA,IAAC;AAAA;AAAA,MACC,wBAAqB;AAAA,MACrB;AAAA,MACA,WAAU;AAAA,MACV;AAAA,MACC,GAAG;AAAA,MAEH;AAAA;AAAA,EACH;AAEJ;AAEA,cAAc,cAAc;;;ACjCrB,IAAMC,YAIT,OAAO,OAAO,UAAM;AAAA,EACtB,OAAO;AAAA,EACP,KAAK;AAAA,EACL,WAAW;AACb,CAAC;AAEDA,UAAS,cAAc;AACvB,YAAY,cAAc;AAC1B,kBAAkB,cAAc;AAChC,cAAc,cAAc;","names":["RadixProgress","cva","jsx","jsx","RadixProgress","jsx","Progress"]}
@@ -4,13 +4,13 @@ import {
4
4
  import {
5
5
  IconButton
6
6
  } from "../chunk-DCXWGQVZ.mjs";
7
+ import {
8
+ Icon
9
+ } from "../chunk-UMUMFMFB.mjs";
7
10
  import "../chunk-2YM6GKWW.mjs";
8
11
  import {
9
12
  Spinner
10
13
  } from "../chunk-GAK4SC2F.mjs";
11
- import {
12
- Icon
13
- } from "../chunk-UMUMFMFB.mjs";
14
14
  import {
15
15
  VisuallyHidden
16
16
  } from "../chunk-KEGAAGJW.mjs";
@@ -2,9 +2,9 @@ import {
2
2
  Dialog
3
3
  } from "../chunk-WLI4EPS6.mjs";
4
4
  import "../chunk-DCXWGQVZ.mjs";
5
+ import "../chunk-UMUMFMFB.mjs";
5
6
  import "../chunk-2YM6GKWW.mjs";
6
7
  import "../chunk-GAK4SC2F.mjs";
7
- import "../chunk-UMUMFMFB.mjs";
8
8
  import "../chunk-KEGAAGJW.mjs";
9
9
  import "../chunk-6QCEPQ3U.mjs";
10
10
  export {
package/dist/docgen.json CHANGED
@@ -30524,27 +30524,6 @@
30524
30524
  "displayName": "FileUpload.AcceptedFile",
30525
30525
  "methods": [],
30526
30526
  "props": {
30527
- "asChild": {
30528
- "defaultValue": {
30529
- "value": false
30530
- },
30531
- "description": "Change the default rendered element for the one passed as a child, merging their props and behavior.",
30532
- "name": "asChild",
30533
- "parent": {
30534
- "fileName": "src/file-upload/FileUploadAcceptedFile.tsx",
30535
- "name": "FileUploadAcceptedFileProps"
30536
- },
30537
- "declarations": [
30538
- {
30539
- "fileName": "src/file-upload/FileUploadAcceptedFile.tsx",
30540
- "name": "FileUploadAcceptedFileProps"
30541
- }
30542
- ],
30543
- "required": false,
30544
- "type": {
30545
- "name": "boolean"
30546
- }
30547
- },
30548
30527
  "ref": {
30549
30528
  "defaultValue": null,
30550
30529
  "description": "",
@@ -31001,27 +30980,6 @@
31001
30980
  "displayName": "FileUpload.PreviewImage",
31002
30981
  "methods": [],
31003
30982
  "props": {
31004
- "asChild": {
31005
- "defaultValue": {
31006
- "value": false
31007
- },
31008
- "description": "Change the default rendered element for the one passed as a child, merging their props and behavior.",
31009
- "name": "asChild",
31010
- "parent": {
31011
- "fileName": "src/file-upload/FileUploadPreviewImage.tsx",
31012
- "name": "FileUploadPreviewImageProps"
31013
- },
31014
- "declarations": [
31015
- {
31016
- "fileName": "src/file-upload/FileUploadPreviewImage.tsx",
31017
- "name": "FileUploadPreviewImageProps"
31018
- }
31019
- ],
31020
- "required": false,
31021
- "type": {
31022
- "name": "boolean"
31023
- }
31024
- },
31025
30983
  "ref": {
31026
30984
  "defaultValue": null,
31027
30985
  "description": "",
@@ -31108,27 +31066,6 @@
31108
31066
  "displayName": "FileUpload.RejectedFile",
31109
31067
  "methods": [],
31110
31068
  "props": {
31111
- "asChild": {
31112
- "defaultValue": {
31113
- "value": false
31114
- },
31115
- "description": "Change the default rendered element for the one passed as a child, merging their props and behavior.",
31116
- "name": "asChild",
31117
- "parent": {
31118
- "fileName": "src/file-upload/FileUploadRejectedFile.tsx",
31119
- "name": "FileUploadRejectedFileProps"
31120
- },
31121
- "declarations": [
31122
- {
31123
- "fileName": "src/file-upload/FileUploadRejectedFile.tsx",
31124
- "name": "FileUploadRejectedFileProps"
31125
- }
31126
- ],
31127
- "required": false,
31128
- "type": {
31129
- "name": "boolean"
31130
- }
31131
- },
31132
31069
  "ref": {
31133
31070
  "defaultValue": null,
31134
31071
  "description": "",
@@ -31767,6 +31704,55 @@
31767
31704
  }
31768
31705
  }
31769
31706
  },
31707
+ "FILE_UPLOAD_ERRORS": {
31708
+ "tags": {},
31709
+ "description": "File upload error codes",
31710
+ "displayName": "FILE_UPLOAD_ERRORS",
31711
+ "methods": [],
31712
+ "props": {}
31713
+ },
31714
+ "TOO_MANY_FILES": {
31715
+ "tags": {},
31716
+ "description": "Exceeds the maxFiles limit",
31717
+ "displayName": "TOO_MANY_FILES",
31718
+ "methods": [],
31719
+ "props": {}
31720
+ },
31721
+ "FILE_INVALID_TYPE": {
31722
+ "tags": {},
31723
+ "description": "File type not in the accept list",
31724
+ "displayName": "FILE_INVALID_TYPE",
31725
+ "methods": [],
31726
+ "props": {}
31727
+ },
31728
+ "FILE_TOO_LARGE": {
31729
+ "tags": {},
31730
+ "description": "File size exceeds maxFileSize",
31731
+ "displayName": "FILE_TOO_LARGE",
31732
+ "methods": [],
31733
+ "props": {}
31734
+ },
31735
+ "FILE_TOO_SMALL": {
31736
+ "tags": {},
31737
+ "description": "File size below minFileSize",
31738
+ "displayName": "FILE_TOO_SMALL",
31739
+ "methods": [],
31740
+ "props": {}
31741
+ },
31742
+ "FILE_INVALID": {
31743
+ "tags": {},
31744
+ "description": "Generic validation failure",
31745
+ "displayName": "FILE_INVALID",
31746
+ "methods": [],
31747
+ "props": {}
31748
+ },
31749
+ "FILE_EXISTS": {
31750
+ "tags": {},
31751
+ "description": "Duplicate file detected",
31752
+ "displayName": "FILE_EXISTS",
31753
+ "methods": [],
31754
+ "props": {}
31755
+ },
31770
31756
  "uploadFiles": {
31771
31757
  "tags": {
31772
31758
  "param": "input - The file input element\nfiles - Single file or array of files to upload"
@@ -31776,6 +31762,269 @@
31776
31762
  "methods": [],
31777
31763
  "props": {}
31778
31764
  },
31765
+ "useFileUploadState": {
31766
+ "tags": {},
31767
+ "description": "Hook that manages file upload state, validation, and file operations",
31768
+ "displayName": "useFileUploadState",
31769
+ "methods": [],
31770
+ "props": {
31771
+ "defaultValue": {
31772
+ "defaultValue": {
31773
+ "value": "[]"
31774
+ },
31775
+ "description": "Initial files to display when the component mounts (uncontrolled mode)",
31776
+ "name": "defaultValue",
31777
+ "parent": {
31778
+ "fileName": "components/src/file-upload/useFileUploadState.tsx",
31779
+ "name": "UseFileUploadStateProps"
31780
+ },
31781
+ "declarations": [
31782
+ {
31783
+ "fileName": "components/src/file-upload/useFileUploadState.tsx",
31784
+ "name": "UseFileUploadStateProps"
31785
+ }
31786
+ ],
31787
+ "required": false,
31788
+ "type": {
31789
+ "name": "File[]"
31790
+ }
31791
+ },
31792
+ "value": {
31793
+ "defaultValue": null,
31794
+ "description": "Controlled files value (controlled mode)\nWhen provided, the component becomes controlled",
31795
+ "name": "value",
31796
+ "parent": {
31797
+ "fileName": "components/src/file-upload/useFileUploadState.tsx",
31798
+ "name": "UseFileUploadStateProps"
31799
+ },
31800
+ "declarations": [
31801
+ {
31802
+ "fileName": "components/src/file-upload/useFileUploadState.tsx",
31803
+ "name": "UseFileUploadStateProps"
31804
+ }
31805
+ ],
31806
+ "required": false,
31807
+ "type": {
31808
+ "name": "File[]"
31809
+ }
31810
+ },
31811
+ "onFileAccept": {
31812
+ "defaultValue": null,
31813
+ "description": "Callback when files are accepted",
31814
+ "name": "onFileAccept",
31815
+ "parent": {
31816
+ "fileName": "components/src/file-upload/useFileUploadState.tsx",
31817
+ "name": "UseFileUploadStateProps"
31818
+ },
31819
+ "declarations": [
31820
+ {
31821
+ "fileName": "components/src/file-upload/useFileUploadState.tsx",
31822
+ "name": "UseFileUploadStateProps"
31823
+ }
31824
+ ],
31825
+ "required": false,
31826
+ "type": {
31827
+ "name": "(details: FileAcceptDetails) => void"
31828
+ }
31829
+ },
31830
+ "onFileReject": {
31831
+ "defaultValue": null,
31832
+ "description": "Callback when files are rejected",
31833
+ "name": "onFileReject",
31834
+ "parent": {
31835
+ "fileName": "components/src/file-upload/useFileUploadState.tsx",
31836
+ "name": "UseFileUploadStateProps"
31837
+ },
31838
+ "declarations": [
31839
+ {
31840
+ "fileName": "components/src/file-upload/useFileUploadState.tsx",
31841
+ "name": "UseFileUploadStateProps"
31842
+ }
31843
+ ],
31844
+ "required": false,
31845
+ "type": {
31846
+ "name": "(details: FileRejectDetails) => void"
31847
+ }
31848
+ },
31849
+ "onFileChange": {
31850
+ "defaultValue": null,
31851
+ "description": "Callback when files change (both accepted and rejected)\nFor controlled mode, use this to update the value prop by extracting details.acceptedFiles",
31852
+ "name": "onFileChange",
31853
+ "parent": {
31854
+ "fileName": "components/src/file-upload/useFileUploadState.tsx",
31855
+ "name": "UseFileUploadStateProps"
31856
+ },
31857
+ "declarations": [
31858
+ {
31859
+ "fileName": "components/src/file-upload/useFileUploadState.tsx",
31860
+ "name": "UseFileUploadStateProps"
31861
+ }
31862
+ ],
31863
+ "required": false,
31864
+ "type": {
31865
+ "name": "(details: FileChangeDetails) => void"
31866
+ }
31867
+ },
31868
+ "multiple": {
31869
+ "defaultValue": {
31870
+ "value": true
31871
+ },
31872
+ "description": "Whether multiple files can be selected",
31873
+ "name": "multiple",
31874
+ "parent": {
31875
+ "fileName": "components/src/file-upload/useFileUploadState.tsx",
31876
+ "name": "UseFileUploadStateProps"
31877
+ },
31878
+ "declarations": [
31879
+ {
31880
+ "fileName": "components/src/file-upload/useFileUploadState.tsx",
31881
+ "name": "UseFileUploadStateProps"
31882
+ }
31883
+ ],
31884
+ "required": false,
31885
+ "type": {
31886
+ "name": "boolean"
31887
+ }
31888
+ },
31889
+ "accept": {
31890
+ "defaultValue": null,
31891
+ "description": "Comma-separated list of accepted file types",
31892
+ "name": "accept",
31893
+ "parent": {
31894
+ "fileName": "components/src/file-upload/useFileUploadState.tsx",
31895
+ "name": "UseFileUploadStateProps"
31896
+ },
31897
+ "declarations": [
31898
+ {
31899
+ "fileName": "components/src/file-upload/useFileUploadState.tsx",
31900
+ "name": "UseFileUploadStateProps"
31901
+ }
31902
+ ],
31903
+ "required": false,
31904
+ "type": {
31905
+ "name": "string"
31906
+ }
31907
+ },
31908
+ "maxFiles": {
31909
+ "defaultValue": null,
31910
+ "description": "Maximum number of files that can be uploaded",
31911
+ "name": "maxFiles",
31912
+ "parent": {
31913
+ "fileName": "components/src/file-upload/useFileUploadState.tsx",
31914
+ "name": "UseFileUploadStateProps"
31915
+ },
31916
+ "declarations": [
31917
+ {
31918
+ "fileName": "components/src/file-upload/useFileUploadState.tsx",
31919
+ "name": "UseFileUploadStateProps"
31920
+ }
31921
+ ],
31922
+ "required": false,
31923
+ "type": {
31924
+ "name": "number"
31925
+ }
31926
+ },
31927
+ "maxFileSize": {
31928
+ "defaultValue": null,
31929
+ "description": "Maximum file size in bytes",
31930
+ "name": "maxFileSize",
31931
+ "parent": {
31932
+ "fileName": "components/src/file-upload/useFileUploadState.tsx",
31933
+ "name": "UseFileUploadStateProps"
31934
+ },
31935
+ "declarations": [
31936
+ {
31937
+ "fileName": "components/src/file-upload/useFileUploadState.tsx",
31938
+ "name": "UseFileUploadStateProps"
31939
+ }
31940
+ ],
31941
+ "required": false,
31942
+ "type": {
31943
+ "name": "number"
31944
+ }
31945
+ },
31946
+ "minFileSize": {
31947
+ "defaultValue": null,
31948
+ "description": "Minimum file size in bytes",
31949
+ "name": "minFileSize",
31950
+ "parent": {
31951
+ "fileName": "components/src/file-upload/useFileUploadState.tsx",
31952
+ "name": "UseFileUploadStateProps"
31953
+ },
31954
+ "declarations": [
31955
+ {
31956
+ "fileName": "components/src/file-upload/useFileUploadState.tsx",
31957
+ "name": "UseFileUploadStateProps"
31958
+ }
31959
+ ],
31960
+ "required": false,
31961
+ "type": {
31962
+ "name": "number"
31963
+ }
31964
+ },
31965
+ "disabled": {
31966
+ "defaultValue": {
31967
+ "value": false
31968
+ },
31969
+ "description": "When `true`, prevents the user from interacting with the file upload",
31970
+ "name": "disabled",
31971
+ "parent": {
31972
+ "fileName": "components/src/file-upload/useFileUploadState.tsx",
31973
+ "name": "UseFileUploadStateProps"
31974
+ },
31975
+ "declarations": [
31976
+ {
31977
+ "fileName": "components/src/file-upload/useFileUploadState.tsx",
31978
+ "name": "UseFileUploadStateProps"
31979
+ }
31980
+ ],
31981
+ "required": false,
31982
+ "type": {
31983
+ "name": "boolean"
31984
+ }
31985
+ },
31986
+ "readOnly": {
31987
+ "defaultValue": {
31988
+ "value": false
31989
+ },
31990
+ "description": "When `true`, sets the file upload to read-only mode",
31991
+ "name": "readOnly",
31992
+ "parent": {
31993
+ "fileName": "components/src/file-upload/useFileUploadState.tsx",
31994
+ "name": "UseFileUploadStateProps"
31995
+ },
31996
+ "declarations": [
31997
+ {
31998
+ "fileName": "components/src/file-upload/useFileUploadState.tsx",
31999
+ "name": "UseFileUploadStateProps"
32000
+ }
32001
+ ],
32002
+ "required": false,
32003
+ "type": {
32004
+ "name": "boolean"
32005
+ }
32006
+ },
32007
+ "locale": {
32008
+ "defaultValue": null,
32009
+ "description": "The [BCP47](https://www.ietf.org/rfc/bcp/bcp47.txt) language code for the locale.\nUsed for formatting file sizes and error messages.",
32010
+ "name": "locale",
32011
+ "parent": {
32012
+ "fileName": "components/src/file-upload/useFileUploadState.tsx",
32013
+ "name": "UseFileUploadStateProps"
32014
+ },
32015
+ "declarations": [
32016
+ {
32017
+ "fileName": "components/src/file-upload/useFileUploadState.tsx",
32018
+ "name": "UseFileUploadStateProps"
32019
+ }
32020
+ ],
32021
+ "required": false,
32022
+ "type": {
32023
+ "name": "string"
32024
+ }
32025
+ }
32026
+ }
32027
+ },
31779
32028
  "validateFileAccept": {
31780
32029
  "tags": {},
31781
32030
  "description": "Validates if a file matches the accept patterns\nSupports MIME types (e.g., \"image/*\", \"image/png\", \"application/pdf\")\nand file extensions (e.g., \".pdf\", \".doc\", \".jpg\")",
@@ -32004,6 +32253,16 @@
32004
32253
  }
32005
32254
  }
32006
32255
  },
32256
+ "findFocusableElement": {
32257
+ "tags": {
32258
+ "param": "candidates - Array of candidate elements to check\ninputRef - Input element to use as last resort",
32259
+ "returns": "The first focusable element, or null if none found"
32260
+ },
32261
+ "description": "Finds the first focusable element from a list of candidates\nFalls back to inputRef if no other element is focusable",
32262
+ "displayName": "findFocusableElement",
32263
+ "methods": [],
32264
+ "props": {}
32265
+ },
32007
32266
  "FormField": {
32008
32267
  "tags": {},
32009
32268
  "description": "",
@@ -35755,6 +36014,25 @@
35755
36014
  "name": "boolean"
35756
36015
  }
35757
36016
  },
36017
+ "onComplete": {
36018
+ "defaultValue": null,
36019
+ "description": "Callback called when the progress reaches its maximum value and the transition animation completes.",
36020
+ "name": "onComplete",
36021
+ "parent": {
36022
+ "fileName": "components/src/progress/Progress.tsx",
36023
+ "name": "ProgressProps"
36024
+ },
36025
+ "declarations": [
36026
+ {
36027
+ "fileName": "components/src/progress/Progress.tsx",
36028
+ "name": "ProgressProps"
36029
+ }
36030
+ ],
36031
+ "required": false,
36032
+ "type": {
36033
+ "name": "() => void"
36034
+ }
36035
+ },
35758
36036
  "ref": {
35759
36037
  "defaultValue": null,
35760
36038
  "description": "",
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  IconButton
3
3
  } from "../chunk-DCXWGQVZ.mjs";
4
- import "../chunk-2YM6GKWW.mjs";
5
- import "../chunk-GAK4SC2F.mjs";
6
4
  import {
7
5
  Icon
8
6
  } from "../chunk-UMUMFMFB.mjs";
7
+ import "../chunk-2YM6GKWW.mjs";
8
+ import "../chunk-GAK4SC2F.mjs";
9
9
  import "../chunk-KEGAAGJW.mjs";
10
10
  import "../chunk-6QCEPQ3U.mjs";
11
11
 
@@ -2,11 +2,11 @@ import {
2
2
  Popover
3
3
  } from "../chunk-GPJMLIHC.mjs";
4
4
  import "../chunk-DCXWGQVZ.mjs";
5
- import "../chunk-2YM6GKWW.mjs";
6
- import "../chunk-GAK4SC2F.mjs";
7
5
  import {
8
6
  Icon
9
7
  } from "../chunk-UMUMFMFB.mjs";
8
+ import "../chunk-2YM6GKWW.mjs";
9
+ import "../chunk-GAK4SC2F.mjs";
10
10
  import {
11
11
  VisuallyHidden
12
12
  } from "../chunk-KEGAAGJW.mjs";