@algorithm-shift/design-system 1.2.987 → 1.2.988

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -36,6 +36,7 @@ interface ImageProps extends ElementProps {
36
36
  enableUpload?: boolean;
37
37
  onSuccess?: (data: { url: string; fileName: string }) => void;
38
38
  axiosInstance?: typeof axios;
39
+ apiUrl?: string;
39
40
  }
40
41
 
41
42
  type InputProperties = {
@@ -304,7 +305,7 @@ declare const _default$2: typeof Repeater;
304
305
 
305
306
  declare const ButtonWrapper: ({ className, style, textContent, loadingText, loading, ...props }: ButtonProps) => react_jsx_runtime.JSX.Element;
306
307
 
307
- declare const ImageControl: ({ className, style, imageUrl, altText, ...props }: ImageProps) => react_jsx_runtime.JSX.Element;
308
+ declare const ImageControl: ({ className, style, imageUrl, altText, apiUrl, ...props }: ImageProps) => react_jsx_runtime.JSX.Element;
308
309
 
309
310
  declare const Shape: ({ children, className, style }: ElementProps) => react_jsx_runtime.JSX.Element;
310
311
 
package/dist/index.d.ts CHANGED
@@ -36,6 +36,7 @@ interface ImageProps extends ElementProps {
36
36
  enableUpload?: boolean;
37
37
  onSuccess?: (data: { url: string; fileName: string }) => void;
38
38
  axiosInstance?: typeof axios;
39
+ apiUrl?: string;
39
40
  }
40
41
 
41
42
  type InputProperties = {
@@ -304,7 +305,7 @@ declare const _default$2: typeof Repeater;
304
305
 
305
306
  declare const ButtonWrapper: ({ className, style, textContent, loadingText, loading, ...props }: ButtonProps) => react_jsx_runtime.JSX.Element;
306
307
 
307
- declare const ImageControl: ({ className, style, imageUrl, altText, ...props }: ImageProps) => react_jsx_runtime.JSX.Element;
308
+ declare const ImageControl: ({ className, style, imageUrl, altText, apiUrl, ...props }: ImageProps) => react_jsx_runtime.JSX.Element;
308
309
 
309
310
  declare const Shape: ({ children, className, style }: ElementProps) => react_jsx_runtime.JSX.Element;
310
311
 
package/dist/index.js CHANGED
@@ -447,7 +447,7 @@ function useFileService(options) {
447
447
  formData.append(key, value);
448
448
  });
449
449
  const axiosClient = options.axiosInstance ?? import_axios.default;
450
- const apiUrl = "/fileservice/upload";
450
+ const apiUrl = options.apiUrl ?? "/fileservice/upload";
451
451
  const result = await axiosClient.post(`${apiUrl}`, formData, {
452
452
  withCredentials: true
453
453
  });
@@ -519,6 +519,7 @@ var ImageControl = ({
519
519
  style,
520
520
  imageUrl,
521
521
  altText = "Preview",
522
+ apiUrl,
522
523
  ...props
523
524
  }) => {
524
525
  const defaultImgClass = cn(
@@ -535,6 +536,7 @@ var ImageControl = ({
535
536
  };
536
537
  const { uploadFile } = useFileService({
537
538
  axiosInstance: props.axiosInstance,
539
+ apiUrl,
538
540
  onSuccess: async (result) => {
539
541
  if (!result?.data?.url && !props.onSuccess) return;
540
542
  props.onSuccess?.({ url: result.data.url || "", fileName: result.data.originalname || "" });