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.js
CHANGED
|
@@ -180,7 +180,7 @@ const Typography = ({ variant = 'B1', weight = 'MEDIUM', children, className, ..
|
|
|
180
180
|
return React__namespace.default.createElement("div", { className: classNames, ...props }, children);
|
|
181
181
|
};
|
|
182
182
|
|
|
183
|
-
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}";
|
|
183
|
+
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}";
|
|
184
184
|
n(css$h,{});
|
|
185
185
|
|
|
186
186
|
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 }) => {
|
|
@@ -9373,7 +9373,7 @@ const MapComponent = ({ containerClassName = "map-container", zoom = 18, mapOpti
|
|
|
9373
9373
|
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}";
|
|
9374
9374
|
n(css$e,{});
|
|
9375
9375
|
|
|
9376
|
-
const OTPInput = ({ length = 4, onChange, autoFocus = false, onResend, resendDelay = 60, error = false, errorText, resendText, showResendButton = true, className, inputClassName, disableResend, icon }) => {
|
|
9376
|
+
const OTPInput = ({ length = 4, onChange, autoFocus = false, onResend, resendDelay = 60, error = false, errorText, resendText, showResendButton = true, className, inputClassName, disableResend, icon, noResendButtonText }) => {
|
|
9377
9377
|
const [otp, setOtp] = React.useState(Array(length).fill(""));
|
|
9378
9378
|
const [timer, setTimer] = React.useState(resendDelay);
|
|
9379
9379
|
const [isComplete, setIsComplete] = React.useState(false);
|
|
@@ -9432,6 +9432,7 @@ const OTPInput = ({ length = 4, onChange, autoFocus = false, onResend, resendDel
|
|
|
9432
9432
|
.map((_, index) => (React__namespace.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 })))),
|
|
9433
9433
|
React__namespace.default.createElement("div", { className: "resendContainer" },
|
|
9434
9434
|
error && (React__namespace.default.createElement("div", { className: "errorText" }, errorText)),
|
|
9435
|
+
!showResendButton && !error && React__namespace.default.createElement("div", { className: "errorText" }, noResendButtonText),
|
|
9435
9436
|
(showResendButton && !error) && (React__namespace.default.createElement(React__namespace.default.Fragment, null,
|
|
9436
9437
|
React__namespace.default.createElement("div", { className: "timerText" },
|
|
9437
9438
|
timer ? icon : "",
|
|
@@ -9613,11 +9614,11 @@ const Tabs = ({ tabs, onTabChange, selectedTabValue, dot }) => {
|
|
|
9613
9614
|
React__namespace.default.createElement("div", { className: "counts" }, tab?.count))))))));
|
|
9614
9615
|
};
|
|
9615
9616
|
|
|
9616
|
-
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}";
|
|
9617
|
+
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}";
|
|
9617
9618
|
n(css$9,{});
|
|
9618
9619
|
|
|
9619
9620
|
function Dropdown(props) {
|
|
9620
|
-
const { placeholder, getSelectedValue, dropdownList, arrowUp, arrowDown, value, className, } = props;
|
|
9621
|
+
const { placeholder, getSelectedValue, dropdownList, arrowUp, arrowDown, value, className, onDropdownOpen } = props;
|
|
9621
9622
|
const [openDropdown, setOpenDropdown] = React.useState(false);
|
|
9622
9623
|
const [selectedValue, setSelectedValue] = React.useState(value);
|
|
9623
9624
|
const selectedDropdwonValue = (value) => {
|
|
@@ -9625,6 +9626,14 @@ function Dropdown(props) {
|
|
|
9625
9626
|
getSelectedValue(value);
|
|
9626
9627
|
setOpenDropdown(!openDropdown);
|
|
9627
9628
|
};
|
|
9629
|
+
React.useEffect(() => {
|
|
9630
|
+
if (openDropdown) {
|
|
9631
|
+
onDropdownOpen && onDropdownOpen(true);
|
|
9632
|
+
}
|
|
9633
|
+
else {
|
|
9634
|
+
onDropdownOpen && onDropdownOpen(false);
|
|
9635
|
+
}
|
|
9636
|
+
}, [openDropdown]);
|
|
9628
9637
|
React.useEffect(() => {
|
|
9629
9638
|
if (!value) {
|
|
9630
9639
|
setSelectedValue(undefined);
|
|
@@ -9632,7 +9641,7 @@ function Dropdown(props) {
|
|
|
9632
9641
|
}, [value]);
|
|
9633
9642
|
return (React__namespace.default.createElement(React__namespace.default.Fragment, null,
|
|
9634
9643
|
openDropdown && (React__namespace.default.createElement("div", { onClick: () => setOpenDropdown(!openDropdown), className: "backdropDropdown" })),
|
|
9635
|
-
React__namespace.default.createElement("div", { className:
|
|
9644
|
+
React__namespace.default.createElement("div", { className: `dropPosition ${!openDropdown ? 'zIndexProp' : ''}` },
|
|
9636
9645
|
placeholder && selectedValue && (React__namespace.default.createElement("label", { className: "dropdownLabel" },
|
|
9637
9646
|
placeholder.replace("*", ""),
|
|
9638
9647
|
placeholder.includes("*") && React__namespace.default.createElement("label", { className: 'astreik' }, "*"))),
|