najm-kit 2.1.39 → 2.1.40
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.ts +6 -2
- package/dist/index.mjs +17 -5
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -2168,6 +2168,8 @@ interface ImageInputProps extends BaseProps {
|
|
|
2168
2168
|
icon?: InputIcon;
|
|
2169
2169
|
showIcon?: boolean;
|
|
2170
2170
|
uploadIcon?: React.ReactNode;
|
|
2171
|
+
/** Class applied to the component's outer layout container. */
|
|
2172
|
+
containerClassName?: string;
|
|
2171
2173
|
previewClassName?: string;
|
|
2172
2174
|
/** Inline styles applied to the preview container. */
|
|
2173
2175
|
previewStyle?: CSSProperties;
|
|
@@ -2197,6 +2199,8 @@ interface AvatarInputProps extends ImageInputProps {
|
|
|
2197
2199
|
radius?: AvatarInputRadius;
|
|
2198
2200
|
/** Exact width and height. Numbers are interpreted as pixels. */
|
|
2199
2201
|
size?: number | string;
|
|
2202
|
+
/** Fill the available width and remaining height of the form item. */
|
|
2203
|
+
fill?: boolean;
|
|
2200
2204
|
}
|
|
2201
2205
|
interface EmojiInputProps extends BaseProps {
|
|
2202
2206
|
value: number;
|
|
@@ -2294,10 +2298,10 @@ interface NUploaderProps {
|
|
|
2294
2298
|
}
|
|
2295
2299
|
declare function NUploader({ title, subtitle, accept, multiple, disabled, items, listTitle, className, dropzoneClassName, onFilesSelected, onCancel, onRemove, }: NUploaderProps): react_jsx_runtime.JSX.Element;
|
|
2296
2300
|
|
|
2297
|
-
declare function ImageInput({ value, onChange, previewClassName, previewStyle, contentClassName, showPreview, previewPosition, allowClear, accept, defaultImage, imageSize, imageVersion, disabled, uploadIcon, title, subtitle, titleClassName, subtitleClassName, replaceTitle, replaceSubtitle, trigger, buttonLabel, }: ImageInputProps): react_jsx_runtime.JSX.Element;
|
|
2301
|
+
declare function ImageInput({ value, onChange, containerClassName, previewClassName, previewStyle, contentClassName, showPreview, previewPosition, allowClear, accept, defaultImage, imageSize, imageVersion, disabled, uploadIcon, title, subtitle, titleClassName, subtitleClassName, replaceTitle, replaceSubtitle, trigger, buttonLabel, }: ImageInputProps): react_jsx_runtime.JSX.Element;
|
|
2298
2302
|
|
|
2299
2303
|
/** A circular image picker preset for profile photos and user avatars. */
|
|
2300
|
-
declare function AvatarInput({ imageSize, size, radius, previewClassName, previewStyle, contentClassName, uploadIcon, title, subtitleClassName, trigger, ...props }: AvatarInputProps): react_jsx_runtime.JSX.Element;
|
|
2304
|
+
declare function AvatarInput({ imageSize, size, fill, radius, containerClassName, previewClassName, previewStyle, contentClassName, uploadIcon, title, subtitleClassName, trigger, ...props }: AvatarInputProps): react_jsx_runtime.JSX.Element;
|
|
2301
2305
|
|
|
2302
2306
|
declare const StarRatingInput: React__default.FC<StarRatingInputProps>;
|
|
2303
2307
|
|
package/dist/index.mjs
CHANGED
|
@@ -9494,6 +9494,7 @@ var IMAGE_SIZE_MAP = {
|
|
|
9494
9494
|
function ImageInput({
|
|
9495
9495
|
value,
|
|
9496
9496
|
onChange,
|
|
9497
|
+
containerClassName,
|
|
9497
9498
|
previewClassName,
|
|
9498
9499
|
previewStyle,
|
|
9499
9500
|
contentClassName,
|
|
@@ -9645,12 +9646,12 @@ function ImageInput({
|
|
|
9645
9646
|
);
|
|
9646
9647
|
if (!showPreview) return renderFileInput();
|
|
9647
9648
|
if (previewPosition === "left" || previewPosition === "right") {
|
|
9648
|
-
return /* @__PURE__ */ jsxs("div", { className: cn("flex items-center gap-4", previewPosition === "right" && "flex-row-reverse"), children: [
|
|
9649
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("flex items-center gap-4", previewPosition === "right" && "flex-row-reverse", containerClassName), children: [
|
|
9649
9650
|
renderPreview(),
|
|
9650
9651
|
/* @__PURE__ */ jsx("div", { className: "flex-1", children: renderFileInput() })
|
|
9651
9652
|
] });
|
|
9652
9653
|
}
|
|
9653
|
-
return /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col gap-3", previewPosition === "bottom" && "flex-col-reverse"), children: [
|
|
9654
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col gap-3", previewPosition === "bottom" && "flex-col-reverse", containerClassName), children: [
|
|
9654
9655
|
renderPreview(),
|
|
9655
9656
|
renderFileInput()
|
|
9656
9657
|
] });
|
|
@@ -9673,7 +9674,9 @@ var AVATAR_RADIUS_MAP = {
|
|
|
9673
9674
|
function AvatarInput({
|
|
9674
9675
|
imageSize = "md",
|
|
9675
9676
|
size,
|
|
9677
|
+
fill = false,
|
|
9676
9678
|
radius = "full",
|
|
9679
|
+
containerClassName,
|
|
9677
9680
|
previewClassName,
|
|
9678
9681
|
previewStyle,
|
|
9679
9682
|
contentClassName,
|
|
@@ -9688,15 +9691,19 @@ function AvatarInput({
|
|
|
9688
9691
|
{
|
|
9689
9692
|
...props,
|
|
9690
9693
|
imageSize,
|
|
9694
|
+
containerClassName: cn(
|
|
9695
|
+
fill && "min-h-24 w-full flex-1",
|
|
9696
|
+
containerClassName
|
|
9697
|
+
),
|
|
9691
9698
|
previewClassName: cn(
|
|
9692
|
-
AVATAR_SIZE_MAP[imageSize],
|
|
9699
|
+
fill ? "size-full min-h-0" : AVATAR_SIZE_MAP[imageSize],
|
|
9693
9700
|
"shrink-0",
|
|
9694
9701
|
AVATAR_RADIUS_MAP[radius],
|
|
9695
9702
|
previewClassName
|
|
9696
9703
|
),
|
|
9697
9704
|
previewStyle: {
|
|
9698
9705
|
...previewStyle,
|
|
9699
|
-
...size != null ? { width: size, height: size } : null
|
|
9706
|
+
...size != null && !fill ? { width: size, height: size } : null
|
|
9700
9707
|
},
|
|
9701
9708
|
contentClassName: cn("gap-1 p-2", contentClassName),
|
|
9702
9709
|
uploadIcon: uploadIcon ?? /* @__PURE__ */ jsx(Camera, { className: "size-6" }),
|
|
@@ -10584,8 +10591,13 @@ var FormInput = ({ name, type, formLabel, formDescription, required = false, dis
|
|
|
10584
10591
|
return "";
|
|
10585
10592
|
};
|
|
10586
10593
|
const presetInput = type === "textarea" ? preset.input?.replace(/\bh-\d+\b/g, "").trim() : preset.input;
|
|
10594
|
+
const isFillAvatar = type === "avatar" && inputRest.fill === true;
|
|
10587
10595
|
const slot = {
|
|
10588
|
-
item: cn(
|
|
10596
|
+
item: cn(
|
|
10597
|
+
preset.item,
|
|
10598
|
+
isFillAvatar && "flex h-full min-h-0 w-full flex-col",
|
|
10599
|
+
classNames?.item
|
|
10600
|
+
),
|
|
10589
10601
|
label: cn(preset.label, classNames?.label),
|
|
10590
10602
|
input: cn(presetInput, background && inputBackgroundClasses[background], classNames?.input, className),
|
|
10591
10603
|
description: cn(preset.description, classNames?.description),
|