ar-design 0.1.16 → 0.1.17
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,14 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import React, { forwardRef
|
|
2
|
+
import React, { forwardRef } from "react";
|
|
3
3
|
import "../../../assets/css/components/form/input/input.css";
|
|
4
4
|
import Button from "../button";
|
|
5
|
-
const Input = forwardRef(({ variant = "outlined", status = "light", icon, border, button, addon, ...attributes }, ref) => {
|
|
6
|
-
//
|
|
7
|
-
let _wrapperClassName =
|
|
8
|
-
let _addonBeforeClassName =
|
|
9
|
-
let _addonAfterClassName =
|
|
10
|
-
let _inputWrapperClassName =
|
|
11
|
-
let _inputClassName =
|
|
5
|
+
const Input = forwardRef(({ variant = "outlined", status = "light", icon, border = { radius: "sm" }, button, addon, ...attributes }, ref) => {
|
|
6
|
+
// variables
|
|
7
|
+
let _wrapperClassName = "ar-input-wrapper";
|
|
8
|
+
let _addonBeforeClassName = "addon-before";
|
|
9
|
+
let _addonAfterClassName = "addon-after";
|
|
10
|
+
let _inputWrapperClassName = "ar-input";
|
|
11
|
+
let _inputClassName = "";
|
|
12
12
|
// input wrapper className
|
|
13
13
|
if (icon && icon.element) {
|
|
14
14
|
_inputWrapperClassName += ` icon`;
|
|
@@ -20,7 +20,7 @@ const Input = forwardRef(({ variant = "outlined", status = "light", icon, border
|
|
|
20
20
|
if (status)
|
|
21
21
|
_inputClassName += ` ${status}`;
|
|
22
22
|
// border radius
|
|
23
|
-
_inputClassName += ` border-radius-${border
|
|
23
|
+
_inputClassName += ` border-radius-${border.radius}`;
|
|
24
24
|
// addon className
|
|
25
25
|
if (addon) {
|
|
26
26
|
_wrapperClassName += ` addon`;
|
|
@@ -58,7 +58,7 @@ const Input = forwardRef(({ variant = "outlined", status = "light", icon, border
|
|
|
58
58
|
})();
|
|
59
59
|
} })),
|
|
60
60
|
addon?.after && React.createElement("span", { className: _addonAfterClassName }, addon?.after),
|
|
61
|
-
button && (React.createElement(Button, { ...button,
|
|
61
|
+
button && (React.createElement(Button, { ...button, status: status, border: { radius: border.radius }, disabled: attributes.disabled }))));
|
|
62
62
|
});
|
|
63
63
|
Input.displayName = "Input";
|
|
64
64
|
export default Input;
|