@farmzone/fz-react-ui 1.1.13 → 1.1.14
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.cjs +18 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +18 -3
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -610,7 +610,13 @@ function Input2(props) {
|
|
|
610
610
|
{
|
|
611
611
|
id: inputId,
|
|
612
612
|
type: actualType === "money" || actualType === "number" ? "text" : actualType,
|
|
613
|
-
className: cn(
|
|
613
|
+
className: cn(
|
|
614
|
+
"w-full",
|
|
615
|
+
leftIcon && "pl-10!",
|
|
616
|
+
hasRightSlot && "pr-10!",
|
|
617
|
+
getStatusStyles(),
|
|
618
|
+
className
|
|
619
|
+
),
|
|
614
620
|
placeholder,
|
|
615
621
|
disabled,
|
|
616
622
|
ref,
|
|
@@ -645,6 +651,8 @@ function Textarea(props) {
|
|
|
645
651
|
bare = false,
|
|
646
652
|
id,
|
|
647
653
|
rows = 4,
|
|
654
|
+
blockLeadingSpace = false,
|
|
655
|
+
onKeyDown,
|
|
648
656
|
...rest
|
|
649
657
|
} = props;
|
|
650
658
|
const randomId = React6.useId();
|
|
@@ -669,6 +677,12 @@ function Textarea(props) {
|
|
|
669
677
|
return "text-muted-foreground";
|
|
670
678
|
}
|
|
671
679
|
};
|
|
680
|
+
const handleKeyDown = (event) => {
|
|
681
|
+
if (blockLeadingSpace && event.key === " " && event.currentTarget.selectionStart === 0) {
|
|
682
|
+
event.preventDefault();
|
|
683
|
+
}
|
|
684
|
+
onKeyDown?.(event);
|
|
685
|
+
};
|
|
672
686
|
const textareaEl = /* @__PURE__ */ jsxRuntime.jsx(
|
|
673
687
|
"textarea",
|
|
674
688
|
{
|
|
@@ -678,9 +692,10 @@ function Textarea(props) {
|
|
|
678
692
|
placeholder,
|
|
679
693
|
disabled,
|
|
680
694
|
readOnly,
|
|
695
|
+
onKeyDown: handleKeyDown,
|
|
681
696
|
className: cn(
|
|
682
|
-
"placeholder:text-muted-foreground custom-view-scrollbar border-input flex w-full min-w-0 resize-
|
|
683
|
-
"focus-visible:border-
|
|
697
|
+
"placeholder:text-muted-foreground custom-view-scrollbar border-input flex w-full min-w-0 resize-none rounded-md border border-gray-300 bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
|
|
698
|
+
"focus-visible:border-blue-600 focus-visible:ring-blue-600/30 focus-visible:ring-[1px]",
|
|
684
699
|
"aria-invalid:ring-destructive/20 aria-invalid:border-destructive",
|
|
685
700
|
getStatusStyles(),
|
|
686
701
|
className
|