@majapisoftwares/ui 4.3.11 → 4.3.13

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,9 +1,6 @@
1
- import { type ReactNode } from "react";
2
- declare function Accordion({ children, className, type, }: {
3
- children?: ReactNode;
4
- className?: string;
5
- type?: "single" | "multiple";
6
- }): import("react").JSX.Element;
1
+ import { type ComponentProps, type ReactNode } from "react";
2
+ import * as RAccordion from "@radix-ui/react-accordion";
3
+ declare function Accordion({ children, className, ...props }: ComponentProps<typeof RAccordion.Root>): import("react").JSX.Element;
7
4
  declare namespace Accordion {
8
5
  var Item: typeof AccordionItem;
9
6
  }
@@ -2,8 +2,8 @@ import { ChevronUpIcon } from "@heroicons/react/20/solid";
2
2
  import { useId } from "react";
3
3
  import * as RAccordion from "@radix-ui/react-accordion";
4
4
  import clsx from "../../utils/clsx";
5
- export default function Accordion({ children, className, type = "multiple", }) {
6
- return (<RAccordion.Root type={type} className={clsx("flex flex-col gap-2", className)} collapsible={type === "single" || undefined}>
5
+ export default function Accordion({ children, className, ...props }) {
6
+ return (<RAccordion.Root {...props} className={clsx("flex flex-col gap-2", className)} {...(props.type === "single" ? { collapsible: true } : {})}>
7
7
  {children}
8
8
  </RAccordion.Root>);
9
9
  }
@@ -4,7 +4,7 @@ export type PictureCropInputRef = {
4
4
  handleCrop: () => Promise<void>;
5
5
  completedCrop: PixelCrop | undefined;
6
6
  };
7
- export default function PictureCropInput({ value, onChange, loading, className, previewSizeClassNames, previewContainerClassName, cropButtonClassName, aspect, ref, label, }: {
7
+ export default function PictureCropInput({ value, onChange, loading, className, previewSizeClassNames, previewContainerClassName, cropButtonClassName, aspect, minWidth, minHeight, ref, label, }: {
8
8
  value?: string;
9
9
  onChange: (value?: string) => void;
10
10
  loading?: boolean;
@@ -13,6 +13,8 @@ export default function PictureCropInput({ value, onChange, loading, className,
13
13
  previewContainerClassName?: string;
14
14
  cropButtonClassName?: string;
15
15
  aspect?: number;
16
+ minWidth?: number;
17
+ minHeight?: number;
16
18
  ref?: RefObject<PictureCropInputRef | null>;
17
19
  label?: string;
18
20
  }): import("react").JSX.Element;
@@ -10,7 +10,7 @@ import { CheckIcon, TrashIcon } from "@heroicons/react/20/solid";
10
10
  import Tooltip from "../Tooltip";
11
11
  import { useLatest } from "react-use";
12
12
  import { defaultLabelClassName } from "../Input";
13
- export default function PictureCropInput({ value, onChange, loading, className, previewSizeClassNames = "h-52 w-52", previewContainerClassName, cropButtonClassName, aspect = 1, ref, label, }) {
13
+ export default function PictureCropInput({ value, onChange, loading, className, previewSizeClassNames = "w-52", previewContainerClassName, cropButtonClassName, aspect, minWidth, minHeight, ref, label, }) {
14
14
  const id = useId();
15
15
  const [src, setSrc] = useState();
16
16
  const [crop, setCrop] = useState();
@@ -121,7 +121,7 @@ export default function PictureCropInput({ value, onChange, loading, className,
121
121
  <div className="flex gap-2">
122
122
  {loading && <Skeleton className={previewSizeClassNames}/>}
123
123
  {src && (<>
124
- <ReactCrop crop={crop} onChange={(c) => setCrop(c)} onComplete={(c) => setCompletedCrop(c)} aspect={aspect} minWidth={50 * aspect} minHeight={50 * aspect} className="max-h-96 max-w-96" keepSelection>
124
+ <ReactCrop crop={crop} onChange={(c) => setCrop(c)} onComplete={(c) => setCompletedCrop(c)} aspect={aspect} minWidth={minWidth} minHeight={minHeight} className="max-h-96 max-w-96" keepSelection>
125
125
  {/* eslint-disable-next-line @next/next/no-img-element */}
126
126
  <img alt="Picture" src={src}
127
127
  // className="h-96 w-96 object-contain"
package/package.json CHANGED
@@ -4,5 +4,5 @@
4
4
  "type": "git",
5
5
  "url": "https://github.com/majapisoftwares/ui.git"
6
6
  },
7
- "version": "4.3.11"
7
+ "version": "4.3.13"
8
8
  }