dhre-component-lib 0.6.7 → 0.6.9
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
CHANGED
|
@@ -207,6 +207,7 @@ interface OTPInputProps {
|
|
|
207
207
|
inputClassName?: string;
|
|
208
208
|
icon: React.ReactNode;
|
|
209
209
|
disableResend?: boolean;
|
|
210
|
+
noResendButtonText?: string;
|
|
210
211
|
}
|
|
211
212
|
declare const OTPInput: React.FC<OTPInputProps>;
|
|
212
213
|
|
|
@@ -292,6 +293,7 @@ declare function Dropdown(props: {
|
|
|
292
293
|
arrowDown: React.ReactNode;
|
|
293
294
|
value?: value;
|
|
294
295
|
className?: string;
|
|
296
|
+
onDropdownOpen?: (data: boolean) => void;
|
|
295
297
|
}): React.JSX.Element;
|
|
296
298
|
|
|
297
299
|
declare function TextArea(props: {
|
package/dist/index.esm.js
CHANGED
|
@@ -157,7 +157,7 @@ const Typography = ({ variant = 'B1', weight = 'MEDIUM', children, className, ..
|
|
|
157
157
|
return React__default.createElement("div", { className: classNames, ...props }, children);
|
|
158
158
|
};
|
|
159
159
|
|
|
160
|
-
var css$h = ".inputLabel {\n position: absolute;\n z-index: 1;\n top: -10px;\n left: 11px;\n background: #ffffff;\n padding: 0 6px;\n transition: all 0.3s ease-out;\n}\n\n.inputContainer {\n position: relative;\n}\n\n.inputError:focus-visible {\n outline: 1px solid #eb0542 !important;\n}\n\n.inputContainer::placeholder {\n color: #686868;\n font-size: 16px;\n font-family: \"Meraas Aktiv\", sans-serif;\n font-weight: 400;\n line-height: 22.4px;\n}\n\n.astreik {\n color: #eb0542;\n}\n\ninput::-webkit-contacts-auto-fill-button {\n box-shadow: 0 0 0px 1000px white inset !important;\n -webkit-text-fill-color: inherit !important;\n background-image: none !important;\n mask-image: none;\n}";
|
|
160
|
+
var css$h = ".inputLabel {\n position: absolute;\n z-index: 1;\n top: -10px;\n left: 11px;\n background: #ffffff;\n padding: 0 6px;\n transition: all 0.3s ease-out;\n}\n\n.inputContainer {\n position: relative;\n z-index: 0;\n}\n\n.inputError:focus-visible {\n outline: 1px solid #eb0542 !important;\n}\n\n.inputContainer::placeholder {\n color: #686868;\n font-size: 16px;\n font-family: \"Meraas Aktiv\", sans-serif;\n font-weight: 400;\n line-height: 22.4px;\n}\n\n.astreik {\n color: #eb0542;\n}\n\ninput::-webkit-contacts-auto-fill-button {\n box-shadow: 0 0 0px 1000px white inset !important;\n -webkit-text-fill-color: inherit !important;\n background-image: none !important;\n mask-image: none;\n}";
|
|
161
161
|
n(css$h,{});
|
|
162
162
|
|
|
163
163
|
const CustomInputField = ({ label, value = "", type = INPUT_TYPES.TEXT, placeholder = "", onChange, className = "", inputClassName = "", labelClassName = "", error, errorClassName = "", maxLength = 0, minLength = 0, checkValidation, name, min, disabled = false, ...rest }) => {
|
|
@@ -9350,7 +9350,7 @@ const MapComponent = ({ containerClassName = "map-container", zoom = 18, mapOpti
|
|
|
9350
9350
|
var css$e = ".otpMainContainer {\n display: flex;\n justify-content: center;\n flex-direction: column;\n margin: 10px;\n width: 343px;\n}\n\n.otpInputDiv {\n flex-direction: row;\n gap: 12px;\n display: flex;\n}\n\n.otpInput {\n width: calc(25% - 9px);\n height: 48px;\n text-align: center;\n font-size: 18px;\n font-weight: 400;\n border-radius: 8px;\n}\n@media (max-width: 600px) {\n .otpInput {\n height: 40px;\n }\n}\n\n.resendContainer {\n display: flex;\n flex-direction: row;\n margin-top: 10px;\n justify-content: space-between;\n}\n\n.errorText {\n color: #EB0542;\n font-weight: 400;\n font-size: 14px;\n}\n\n.timerText {\n color: #0569C2;\n font-weight: 400;\n font-size: 14px;\n display: flex;\n align-items: center;\n}\n\n.resendText {\n color: #A7A7A7;\n font-weight: 700;\n font-size: 14px;\n}\n\n.enabledResendText {\n color: #000000;\n font-weight: 700;\n font-size: 14px;\n}";
|
|
9351
9351
|
n(css$e,{});
|
|
9352
9352
|
|
|
9353
|
-
const OTPInput = ({ length = 4, onChange, autoFocus = false, onResend, resendDelay = 60, error = false, errorText, resendText, showResendButton = true, className, inputClassName, disableResend, icon }) => {
|
|
9353
|
+
const OTPInput = ({ length = 4, onChange, autoFocus = false, onResend, resendDelay = 60, error = false, errorText, resendText, showResendButton = true, className, inputClassName, disableResend, icon, noResendButtonText }) => {
|
|
9354
9354
|
const [otp, setOtp] = useState(Array(length).fill(""));
|
|
9355
9355
|
const [timer, setTimer] = useState(resendDelay);
|
|
9356
9356
|
const [isComplete, setIsComplete] = useState(false);
|
|
@@ -9409,6 +9409,7 @@ const OTPInput = ({ length = 4, onChange, autoFocus = false, onResend, resendDel
|
|
|
9409
9409
|
.map((_, index) => (React__default.createElement("input", { key: index, type: "text", id: `otp-input-${index}`, value: otp[index], "data-testid": `otp-input-${index}`, onChange: (e) => handleChange(e.target.value, index), onKeyDown: (e) => handleKeyDown(e, index), maxLength: 1, style: { border: `1px solid ${getReadableStatus()}` }, className: `${'otpInput'} ${inputClassName ? inputClassName : ''}`, autoFocus: autoFocus && index === 0 })))),
|
|
9410
9410
|
React__default.createElement("div", { className: "resendContainer" },
|
|
9411
9411
|
error && (React__default.createElement("div", { className: "errorText" }, errorText)),
|
|
9412
|
+
!showResendButton && !error && React__default.createElement("div", { className: "errorText" }, noResendButtonText),
|
|
9412
9413
|
(showResendButton && !error) && (React__default.createElement(React__default.Fragment, null,
|
|
9413
9414
|
React__default.createElement("div", { className: "timerText" },
|
|
9414
9415
|
timer ? icon : "",
|
|
@@ -9590,11 +9591,11 @@ const Tabs = ({ tabs, onTabChange, selectedTabValue, dot }) => {
|
|
|
9590
9591
|
React__default.createElement("div", { className: "counts" }, tab?.count))))))));
|
|
9591
9592
|
};
|
|
9592
9593
|
|
|
9593
|
-
var css$9 = ".dropdown {\n width: 100%;\n border: 0.0625rem solid #686868;\n height: 3.5rem;\n border-radius: 0.5rem;\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n padding: 1rem;\n position: relative;\n cursor: pointer;\n z-index: 1;\n}\n\n.astreik {\n color: #eb0542;\n}\n\n.dropdownLabel {\n position: absolute;\n z-index: 2;\n top: -10px;\n left: 11px;\n background: #ffffff;\n padding: 0 6px;\n transition: all 0.3s ease-out;\n}\n\n.placeholder {\n color: #686868;\n}\n\n.dropPosition {\n position: relative;\n}\n\n.dropdownValues {\n border: 0.0625rem solid #e1e1e1;\n box-shadow: 0px 0.25rem 0.5rem 0px rgba(0, 0, 0, 0.2509803922);\n border-radius: 0.5rem;\n margin-top: 0.3125rem;\n position: absolute;\n width: 100%;\n z-index: 9;\n}\n\n.unselectedText {\n background: #ffffff;\n height: 3.24rem;\n padding: 1rem;\n color: #686868;\n cursor: pointer;\n}\n\n.value {\n color: #000000;\n}\n\n.unselectedText:hover {\n background: #e1e1e1;\n color: #000000;\n font-weight: 700 !important;\n}\n\n.backdropDropdown {\n position: fixed;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n}\n\n.dropdown select {\n background: transparent;\n width: 10.625rem;\n padding: 0.5rem;\n border: 0;\n border-radius: 0;\n height: 2.1875rem;\n}";
|
|
9594
|
+
var css$9 = ".dropdown {\n width: 100%;\n border: 0.0625rem solid #686868;\n height: 3.5rem;\n border-radius: 0.5rem;\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n padding: 1rem;\n position: relative;\n cursor: pointer;\n z-index: 1;\n}\n\n.astreik {\n color: #eb0542;\n}\n\n.dropdownLabel {\n position: absolute;\n z-index: 2;\n top: -10px;\n left: 11px;\n background: #ffffff;\n padding: 0 6px;\n transition: all 0.3s ease-out;\n}\n\n.placeholder {\n color: #686868;\n}\n\n.dropPosition {\n position: relative;\n}\n\n.zIndexProp {\n z-index: 0;\n}\n\n.dropdownValues {\n border: 0.0625rem solid #e1e1e1;\n box-shadow: 0px 0.25rem 0.5rem 0px rgba(0, 0, 0, 0.2509803922);\n border-radius: 0.5rem;\n margin-top: 0.3125rem;\n position: absolute;\n width: 100%;\n z-index: 9;\n}\n\n.unselectedText {\n background: #ffffff;\n height: 3.24rem;\n padding: 1rem;\n color: #686868;\n cursor: pointer;\n}\n\n.value {\n color: #000000;\n}\n\n.unselectedText:hover {\n background: #e1e1e1;\n color: #000000;\n font-weight: 700 !important;\n}\n\n.backdropDropdown {\n position: fixed;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n z-index: 4;\n}\n\n.dropdown select {\n background: transparent;\n width: 10.625rem;\n padding: 0.5rem;\n border: 0;\n border-radius: 0;\n height: 2.1875rem;\n}";
|
|
9594
9595
|
n(css$9,{});
|
|
9595
9596
|
|
|
9596
9597
|
function Dropdown(props) {
|
|
9597
|
-
const { placeholder, getSelectedValue, dropdownList, arrowUp, arrowDown, value, className, } = props;
|
|
9598
|
+
const { placeholder, getSelectedValue, dropdownList, arrowUp, arrowDown, value, className, onDropdownOpen } = props;
|
|
9598
9599
|
const [openDropdown, setOpenDropdown] = useState(false);
|
|
9599
9600
|
const [selectedValue, setSelectedValue] = useState(value);
|
|
9600
9601
|
const selectedDropdwonValue = (value) => {
|
|
@@ -9602,6 +9603,14 @@ function Dropdown(props) {
|
|
|
9602
9603
|
getSelectedValue(value);
|
|
9603
9604
|
setOpenDropdown(!openDropdown);
|
|
9604
9605
|
};
|
|
9606
|
+
useEffect(() => {
|
|
9607
|
+
if (openDropdown) {
|
|
9608
|
+
onDropdownOpen && onDropdownOpen(true);
|
|
9609
|
+
}
|
|
9610
|
+
else {
|
|
9611
|
+
onDropdownOpen && onDropdownOpen(false);
|
|
9612
|
+
}
|
|
9613
|
+
}, [openDropdown]);
|
|
9605
9614
|
useEffect(() => {
|
|
9606
9615
|
if (!value) {
|
|
9607
9616
|
setSelectedValue(undefined);
|
|
@@ -9609,7 +9618,7 @@ function Dropdown(props) {
|
|
|
9609
9618
|
}, [value]);
|
|
9610
9619
|
return (React__default.createElement(React__default.Fragment, null,
|
|
9611
9620
|
openDropdown && (React__default.createElement("div", { onClick: () => setOpenDropdown(!openDropdown), className: "backdropDropdown" })),
|
|
9612
|
-
React__default.createElement("div", { className:
|
|
9621
|
+
React__default.createElement("div", { className: `dropPosition ${!openDropdown ? 'zIndexProp' : ''}` },
|
|
9613
9622
|
placeholder && selectedValue && (React__default.createElement("label", { className: "dropdownLabel" },
|
|
9614
9623
|
placeholder.replace("*", ""),
|
|
9615
9624
|
placeholder.includes("*") && React__default.createElement("label", { className: 'astreik' }, "*"))),
|