dhre-component-lib 0.8.1 → 0.8.3
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/components/InputTextField/InputTextField.d.ts +4 -0
- package/dist/components/TextArea/TextArea.d.ts +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.esm.js +11 -6
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +11 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
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$i = ".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.inputLabelTooltip {\n position: absolute;\n z-index: 1;\n top: 17px;\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}\n\n.ToolTipImage {\n position: relative;\n left: 87.5%;\n z-index: 2;\n top: 2.75rem;\n cursor: pointer;\n}\n\n.tooltipwrapper {\n display: flex;\n flex-direction: row !important;\n gap: 1rem;\n}\n\n.tooltipText {\n font-family: Meraas Aktiv;\n font-size: 16px;\n font-weight: 400;\n line-height: 22.4px;\n text-align: left;\n text-underline-position: from-font;\n text-decoration-skip-ink: none;\n color: #000000;\n max-width: 17.1875rem;\n}\n\n.tooltip {\n cursor: pointer;\n}";
|
|
183
|
+
var css$i = ".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.inputLabelTooltip {\n position: absolute;\n z-index: 1;\n top: 17px;\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}\n\n.ToolTipImage {\n position: relative;\n left: 87.5%;\n z-index: 2;\n top: 2.75rem;\n cursor: pointer;\n}\n\n.tooltipwrapper {\n display: flex;\n flex-direction: row !important;\n gap: 1rem;\n}\n\n.tooltipText {\n font-family: Meraas Aktiv;\n font-size: 16px;\n font-weight: 400;\n line-height: 22.4px;\n text-align: left;\n text-underline-position: from-font;\n text-decoration-skip-ink: none;\n color: #000000;\n max-width: 17.1875rem;\n}\n\n.tooltip {\n cursor: pointer;\n}\n\n.linkWrapper {\n display: flex;\n gap: 1;\n}\n\n.linkClassName {\n text-decoration: underline;\n cursor: pointer;\n color: #eb0542;\n}";
|
|
184
184
|
n(css$i,{});
|
|
185
185
|
|
|
186
186
|
const common = {
|
|
@@ -12427,7 +12427,7 @@ const TcodeToolTip = styled(({ className, ...props }) => (React__namespace.defau
|
|
|
12427
12427
|
fontSize: "1rem",
|
|
12428
12428
|
},
|
|
12429
12429
|
}));
|
|
12430
|
-
const CustomInputField = ({ label, value = "", type = INPUT_TYPES.TEXT, placeholder = "", onChange, className = "", inputClassName = "", labelClassName = "", error, errorClassName = "", maxLength = 0, minLength = 0, checkValidation, name, min, disabled = false, istoolTip, toolTipText, ...rest }) => {
|
|
12430
|
+
const CustomInputField = ({ label, value = "", type = INPUT_TYPES.TEXT, placeholder = "", onChange, className = "", inputClassName = "", labelClassName = "", error, errorClassName = "", maxLength = 0, minLength = 0, checkValidation, name, min, disabled = false, istoolTip, toolTipText, link, handleLink, linkWrapper = "", linkClassName = "", ...rest }) => {
|
|
12431
12431
|
const [showLabelOnBorder, setShowLabelOnBorder] = React$1.useState(false);
|
|
12432
12432
|
const handleInputValues = (e) => {
|
|
12433
12433
|
onChange?.(e);
|
|
@@ -12456,7 +12456,12 @@ const CustomInputField = ({ label, value = "", type = INPUT_TYPES.TEXT, placehol
|
|
|
12456
12456
|
React__namespace.default.createElement("input", { type: type, value: value, name: name, placeholder: showLabelOnBorder ? "" : placeholder, onChange: handleInputValues, onFocus: () => setShowLabelOnBorder(true), onBlur: checkFieldValue,
|
|
12457
12457
|
// className={inputClassName}
|
|
12458
12458
|
className: `${inputClassName} ${error ? "inputError" : ""}`, maxLength: maxLength, minLength: minLength, min: min, disabled: disabled, ...rest }),
|
|
12459
|
-
error && (React__namespace.default.createElement(Typography, { variant: "L1", weight: "SEMI_BOLD", className: errorClassName }, error))
|
|
12459
|
+
error && !link && (React__namespace.default.createElement(Typography, { variant: "L1", weight: "SEMI_BOLD", className: errorClassName }, error)),
|
|
12460
|
+
error && link && (React__namespace.default.createElement("div", { className: linkWrapper },
|
|
12461
|
+
React__namespace.default.createElement(Typography, { variant: "L1", weight: "SEMI_BOLD", className: errorClassName },
|
|
12462
|
+
error,
|
|
12463
|
+
React__namespace.default.createElement("span", { onClick: handleLink },
|
|
12464
|
+
React__namespace.default.createElement(Typography, { variant: "L1", weight: "SEMI_BOLD", className: linkClassName }, link)))))));
|
|
12460
12465
|
};
|
|
12461
12466
|
|
|
12462
12467
|
var css$g = ".container {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n}\n\n.spinner {\n border: 2px solid transparent;\n border-radius: 50%;\n border-top: 2px solid currentColor;\n animation: spin 1s linear infinite;\n}\n\n.spinnerInner {\n width: 100%;\n height: 100%;\n border-radius: 50%;\n}\n\n.errorText {\n color: red;\n}\n\n.button {\n padding: 8px 16px;\n border: none;\n border-radius: 4px;\n cursor: pointer;\n font-size: 16px;\n}\n.button-text {\n background: none;\n}\n.button-outlined {\n border: 1px solid currentColor;\n}\n.button-contained {\n background-color: currentColor;\n color: white;\n}\n.button-primary {\n color: blue;\n}\n.button-secondary {\n color: gray;\n}\n.button-small {\n font-size: 12px;\n}\n.button-medium {\n font-size: 16px;\n}\n.button-large {\n font-size: 20px;\n}\n\n@keyframes spin {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n}";
|
|
@@ -21902,11 +21907,11 @@ function Dropdown(props) {
|
|
|
21902
21907
|
React__namespace.default.createElement(Typography, { variant: "B3", weight: "SEMI_BOLD" }, val.name)))))))));
|
|
21903
21908
|
}
|
|
21904
21909
|
|
|
21905
|
-
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}";
|
|
21910
|
+
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.shortTextBox {\n min-width: 70%;\n width: 100%;\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}";
|
|
21906
21911
|
n(css$8,{});
|
|
21907
21912
|
|
|
21908
21913
|
function TextArea(props) {
|
|
21909
|
-
const { value, onChange, requiredLimit, placeholder, charText, property } = props;
|
|
21914
|
+
const { value, onChange, requiredLimit, placeholder, charText, property, isShortTextBox } = props;
|
|
21910
21915
|
const [showLabelOnBorder, setShowLabelOnBorder] = React$1.useState(false);
|
|
21911
21916
|
const checkSpecialChar = (e) => {
|
|
21912
21917
|
if (!/[0-9a-zA-Z ]/.test(e.key)) {
|
|
@@ -21927,7 +21932,7 @@ function TextArea(props) {
|
|
|
21927
21932
|
((placeholder && showLabelOnBorder) || (placeholder && value)) && React__namespace.default.createElement("label", { className: 'inputTextAreaLabel' },
|
|
21928
21933
|
placeholder.replace("*", ""),
|
|
21929
21934
|
placeholder.includes("*") && React__namespace.default.createElement("label", { className: 'astreik' }, "*")),
|
|
21930
|
-
React__namespace.default.createElement("textarea", { value: value, onChange: (event) => onChange(event, property), onKeyDown: checkSpecialChar, maxLength: Number(requiredLimit), className:
|
|
21935
|
+
React__namespace.default.createElement("textarea", { value: value, onChange: (event) => onChange(event, property), onKeyDown: checkSpecialChar, maxLength: Number(requiredLimit), className: `${isShortTextBox ? "shortTextBox" : "textArea"} ${value && value.length > Number(requiredLimit) ? "maxLimitArea" : ""}`, placeholder: showLabelOnBorder ? "" : placeholder, onFocus: () => setShowLabelOnBorder(true), onBlur: checkFieldValue })),
|
|
21931
21936
|
React__namespace.default.createElement(Typography, { className: `characters ${value &&
|
|
21932
21937
|
value?.length > Number(requiredLimit) ? "maxLimit" : ""}`, variant: "L1", weight: "SEMI_BOLD" },
|
|
21933
21938
|
value?.length ?? 0,
|