lecom-ui 4.8.9 → 4.9.0

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.
@@ -51,6 +51,7 @@ const Input = React.forwardRef(
51
51
  iconAfter,
52
52
  type,
53
53
  containerClassName,
54
+ prefixInset,
54
55
  ...props
55
56
  }, ref) => {
56
57
  const inputStyles = () => cn(
@@ -58,7 +59,8 @@ const Input = React.forwardRef(
58
59
  prefix && "rounded-l-none",
59
60
  sufix && "rounded-r-none",
60
61
  iconBefore && "pl-10",
61
- iconAfter && "pr-10"
62
+ iconAfter && "pr-10",
63
+ prefixInset && "pl-10"
62
64
  );
63
65
  const renderPrefix = () => {
64
66
  if (!prefix) {
@@ -72,18 +74,14 @@ const Input = React.forwardRef(
72
74
  }
73
75
  return sufix;
74
76
  };
75
- return /* @__PURE__ */ React.createElement("div", { className: cn("flex justify-center", containerClassName) }, renderPrefix(), /* @__PURE__ */ React.createElement(
76
- "div",
77
- {
78
- className: cn(
79
- "flex items-center justify-center relative",
80
- containerClassName
81
- )
82
- },
83
- /* @__PURE__ */ React.createElement("div", { className: "shrink-0 absolute left-3" }, /* @__PURE__ */ React.createElement(Icon, { icon: iconBefore })),
84
- /* @__PURE__ */ React.createElement("input", { type, className: inputStyles(), ref, ...props }),
85
- /* @__PURE__ */ React.createElement("div", { className: "shrink-0 absolute right-3" }, /* @__PURE__ */ React.createElement(Icon, { icon: iconAfter }))
86
- ), renderSufix());
77
+ const renderInput = () => /* @__PURE__ */ React.createElement("input", { type, className: inputStyles(), ref, ...props });
78
+ const renderContainerInput = () => {
79
+ if (iconBefore || iconAfter || prefixInset) {
80
+ return /* @__PURE__ */ React.createElement("div", { className: cn("flex items-center relative", containerClassName) }, iconBefore && /* @__PURE__ */ React.createElement("div", { className: "shrink-0 absolute left-3" }, /* @__PURE__ */ React.createElement(Icon, { icon: iconBefore })), prefixInset && /* @__PURE__ */ React.createElement("div", { className: "shrink-0 absolute left-3" }, prefixInset), renderInput(), iconAfter && /* @__PURE__ */ React.createElement("div", { className: "shrink-0 absolute right-3" }, /* @__PURE__ */ React.createElement(Icon, { icon: iconAfter })));
81
+ }
82
+ return renderInput();
83
+ };
84
+ return /* @__PURE__ */ React.createElement("div", { className: cn("flex justify-center", containerClassName) }, renderPrefix(), renderContainerInput(), renderSufix());
87
85
  }
88
86
  );
89
87
  Input.displayName = "Input";
package/dist/index.d.ts CHANGED
@@ -581,6 +581,7 @@ interface InputProps extends Omit<React$1.InputHTMLAttributes<HTMLInputElement>,
581
581
  iconBefore?: React$1.ReactNode;
582
582
  iconAfter?: React$1.ReactNode;
583
583
  containerClassName?: string;
584
+ prefixInset?: React$1.ReactNode;
584
585
  }
585
586
  declare const Input: React$1.ForwardRefExoticComponent<InputProps & React$1.RefAttributes<HTMLInputElement>>;
586
587
 
@@ -735,7 +736,7 @@ declare const TooltipTrigger: React$1.ForwardRefExoticComponent<TooltipPrimitive
735
736
  declare const TooltipArrow: React$1.ForwardRefExoticComponent<TooltipPrimitive.TooltipArrowProps & React$1.RefAttributes<SVGSVGElement>>;
736
737
  declare const TooltipPortal: React$1.FC<TooltipPrimitive.TooltipPortalProps>;
737
738
  declare const tooltipContentVariants: (props?: ({
738
- color?: "white" | "black" | null | undefined;
739
+ color?: "black" | "white" | null | undefined;
739
740
  arrow?: boolean | null | undefined;
740
741
  } & class_variance_authority_types.ClassProp) | undefined) => string;
741
742
  interface TooltipContentProps extends React$1.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>, VariantProps<typeof tooltipContentVariants> {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lecom-ui",
3
- "version": "4.8.9",
3
+ "version": "4.9.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",