dhre-component-lib 0.6.8 → 0.7.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.
package/dist/index.js
CHANGED
|
@@ -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' }, "*"))),
|
|
@@ -9645,20 +9654,32 @@ function Dropdown(props) {
|
|
|
9645
9654
|
React__namespace.default.createElement(Typography, { variant: "B3", weight: "SEMI_BOLD" }, val.name)))))))));
|
|
9646
9655
|
}
|
|
9647
9656
|
|
|
9648
|
-
var css$8 = ".textArea {\n min-width: 70%;\n width: 100%;\n height: 8.875rem;\n border-radius: 0.5rem;\n padding: 1rem;\n font-size: 1rem;\n font-family: Meraas Aktiv;\n font-weight: 400;\n line-height: 1.4rem;\n text-align: left;\n outline: none;\n resize: none;\n overflow: auto;\n max-width: 100%;\n max-height: 100%;\n}\n.characters {\n color: #686868;\n}\n\n.textArea100 {\n height: 100%;\n width: 100%;\n
|
|
9657
|
+
var css$8 = ".textArea {\n min-width: 70%;\n width: 100%;\n height: 8.875rem;\n border-radius: 0.5rem;\n padding: 1rem;\n font-size: 1rem;\n font-family: Meraas Aktiv;\n font-weight: 400;\n line-height: 1.4rem;\n text-align: left;\n outline: none;\n resize: none;\n overflow: auto;\n max-width: 100%;\n max-height: 100%;\n}\n.inputTextAreaLabel {\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.astreik {\n color: #eb0542;\n}\n\n.characters {\n color: #686868;\n}\n\n.textArea100 {\n height: 100%;\n width: 100%;\n max-width: 100%;\n max-height: 100%;\n overflow: hidden;\n}\n\n.positionRel {\n position: relative;\n z-index: 0;\n}\n\n.label {\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.astreik {\n color: #eb0542;\n}\n\n.textArea::placeholder {\n font-family: Meraas Aktiv, sans-serif;\n font-size: 16px;\n font-weight: 400;\n line-height: 22.4px;\n text-align: left;\n color: #686868;\n}\n\n.maxLimit {\n color: #eb0542 !important;\n}\n\n.maxLimitArea {\n border: 1px solid #eb0542 !important;\n}";
|
|
9649
9658
|
n(css$8,{});
|
|
9650
9659
|
|
|
9651
9660
|
function TextArea(props) {
|
|
9652
9661
|
const { value, onChange, requiredLimit, placeholder, charText, property } = props;
|
|
9662
|
+
const [showLabelOnBorder, setShowLabelOnBorder] = React.useState(false);
|
|
9653
9663
|
const checkSpecialChar = (e) => {
|
|
9654
9664
|
if (!/[0-9a-zA-Z ]/.test(e.key)) {
|
|
9655
9665
|
e.preventDefault();
|
|
9656
9666
|
}
|
|
9657
9667
|
console.log('textAraea');
|
|
9658
9668
|
};
|
|
9659
|
-
|
|
9669
|
+
const checkFieldValue = (e) => {
|
|
9670
|
+
if (!e.key) {
|
|
9671
|
+
setShowLabelOnBorder(false);
|
|
9672
|
+
}
|
|
9673
|
+
};
|
|
9674
|
+
React.useEffect(() => {
|
|
9675
|
+
setShowLabelOnBorder(!!value);
|
|
9676
|
+
}, [value]);
|
|
9677
|
+
return (React__namespace.default.createElement("div", { className: "positionRel" },
|
|
9660
9678
|
React__namespace.default.createElement("div", { className: "textArea100" },
|
|
9661
|
-
|
|
9679
|
+
((placeholder && showLabelOnBorder) || (placeholder && value)) && React__namespace.default.createElement("label", { className: 'inputTextAreaLabel' },
|
|
9680
|
+
placeholder.replace("*", ""),
|
|
9681
|
+
placeholder.includes("*") && React__namespace.default.createElement("label", { className: 'astreik' }, "*")),
|
|
9682
|
+
React__namespace.default.createElement("textarea", { value: value, onChange: (event) => onChange(event, property), onKeyDown: checkSpecialChar, maxLength: Number(requiredLimit), className: `textArea ${value && value?.length > Number(requiredLimit) ? "maxLimitArea" : ""}`, placeholder: showLabelOnBorder ? "" : placeholder, onFocus: () => setShowLabelOnBorder(true), onBlur: checkFieldValue })),
|
|
9662
9683
|
React__namespace.default.createElement(Typography, { className: `characters ${value &&
|
|
9663
9684
|
value?.length > Number(requiredLimit) ? "maxLimit" : ""}`, variant: "L1", weight: "SEMI_BOLD" },
|
|
9664
9685
|
value?.length ?? 0,
|