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.
@@ -20,6 +20,10 @@ export interface CustomInputFieldProps {
20
20
  disabled?: boolean;
21
21
  istoolTip?: boolean;
22
22
  toolTipText?: string;
23
+ link?: string;
24
+ handleLink?: () => void;
25
+ linkWrapper?: string;
26
+ linkClassName?: string;
23
27
  }
24
28
  declare const CustomInputField: React.FC<CustomInputFieldProps>;
25
29
  export default CustomInputField;
@@ -11,5 +11,6 @@ declare function TextArea(props: {
11
11
  placeholder: string;
12
12
  charText: string;
13
13
  property?: any;
14
+ isShortTextBox?: boolean;
14
15
  }): React.JSX.Element;
15
16
  export default TextArea;
package/dist/index.d.ts CHANGED
@@ -152,6 +152,10 @@ interface CustomInputFieldProps {
152
152
  disabled?: boolean;
153
153
  istoolTip?: boolean;
154
154
  toolTipText?: string;
155
+ link?: string;
156
+ handleLink?: () => void;
157
+ linkWrapper?: string;
158
+ linkClassName?: string;
155
159
  }
156
160
  declare const CustomInputField: React.FC<CustomInputFieldProps>;
157
161
 
@@ -309,6 +313,7 @@ declare function TextArea(props: {
309
313
  placeholder: string;
310
314
  charText: string;
311
315
  property?: any;
316
+ isShortTextBox?: boolean;
312
317
  }): React.JSX.Element;
313
318
 
314
319
  interface DrawerProps {
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$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}";
160
+ 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}";
161
161
  n(css$i,{});
162
162
 
163
163
  const common = {
@@ -12404,7 +12404,7 @@ const TcodeToolTip = styled(({ className, ...props }) => (React__default.createE
12404
12404
  fontSize: "1rem",
12405
12405
  },
12406
12406
  }));
12407
- 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 }) => {
12407
+ 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 }) => {
12408
12408
  const [showLabelOnBorder, setShowLabelOnBorder] = useState(false);
12409
12409
  const handleInputValues = (e) => {
12410
12410
  onChange?.(e);
@@ -12433,7 +12433,12 @@ const CustomInputField = ({ label, value = "", type = INPUT_TYPES.TEXT, placehol
12433
12433
  React__default.createElement("input", { type: type, value: value, name: name, placeholder: showLabelOnBorder ? "" : placeholder, onChange: handleInputValues, onFocus: () => setShowLabelOnBorder(true), onBlur: checkFieldValue,
12434
12434
  // className={inputClassName}
12435
12435
  className: `${inputClassName} ${error ? "inputError" : ""}`, maxLength: maxLength, minLength: minLength, min: min, disabled: disabled, ...rest }),
12436
- error && (React__default.createElement(Typography, { variant: "L1", weight: "SEMI_BOLD", className: errorClassName }, error))));
12436
+ error && !link && (React__default.createElement(Typography, { variant: "L1", weight: "SEMI_BOLD", className: errorClassName }, error)),
12437
+ error && link && (React__default.createElement("div", { className: linkWrapper },
12438
+ React__default.createElement(Typography, { variant: "L1", weight: "SEMI_BOLD", className: errorClassName },
12439
+ error,
12440
+ React__default.createElement("span", { onClick: handleLink },
12441
+ React__default.createElement(Typography, { variant: "L1", weight: "SEMI_BOLD", className: linkClassName }, link)))))));
12437
12442
  };
12438
12443
 
12439
12444
  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}";
@@ -21879,11 +21884,11 @@ function Dropdown(props) {
21879
21884
  React__default.createElement(Typography, { variant: "B3", weight: "SEMI_BOLD" }, val.name)))))))));
21880
21885
  }
21881
21886
 
21882
- 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}";
21887
+ 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}";
21883
21888
  n(css$8,{});
21884
21889
 
21885
21890
  function TextArea(props) {
21886
- const { value, onChange, requiredLimit, placeholder, charText, property } = props;
21891
+ const { value, onChange, requiredLimit, placeholder, charText, property, isShortTextBox } = props;
21887
21892
  const [showLabelOnBorder, setShowLabelOnBorder] = useState(false);
21888
21893
  const checkSpecialChar = (e) => {
21889
21894
  if (!/[0-9a-zA-Z ]/.test(e.key)) {
@@ -21904,7 +21909,7 @@ function TextArea(props) {
21904
21909
  ((placeholder && showLabelOnBorder) || (placeholder && value)) && React__default.createElement("label", { className: 'inputTextAreaLabel' },
21905
21910
  placeholder.replace("*", ""),
21906
21911
  placeholder.includes("*") && React__default.createElement("label", { className: 'astreik' }, "*")),
21907
- React__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 })),
21912
+ React__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 })),
21908
21913
  React__default.createElement(Typography, { className: `characters ${value &&
21909
21914
  value?.length > Number(requiredLimit) ? "maxLimit" : ""}`, variant: "L1", weight: "SEMI_BOLD" },
21910
21915
  value?.length ?? 0,