dhre-component-lib 0.4.3 → 0.4.4

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
@@ -179,7 +179,7 @@ const Typography = ({ variant = 'B1', weight = 'MEDIUM', children, className, ..
179
179
  return React__namespace.default.createElement("div", { className: classNames, ...props }, children);
180
180
  };
181
181
 
182
- var css$h = ".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.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}";
182
+ var css$h = ".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.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}";
183
183
  n(css$h,{});
184
184
 
185
185
  const CustomInputField = ({ label, value = "", type = INPUT_TYPES.TEXT, placeholder = "", onChange, className = "", inputClassName = "", labelClassName = "", error, errorClassName = "", maxLength = 0, minLength = 0, checkValidation, name, min, ...rest }) => {
@@ -202,7 +202,9 @@ const CustomInputField = ({ label, value = "", type = INPUT_TYPES.TEXT, placehol
202
202
  setShowLabelOnBorder(!!value);
203
203
  }, [value]);
204
204
  return (React__namespace.default.createElement("div", { className: `${className} ${'inputContainer'}` },
205
- (placeholder && showLabelOnBorder) && React__namespace.default.createElement("label", { className: 'label' }, placeholder),
205
+ ((placeholder && showLabelOnBorder) || (placeholder && value)) && React__namespace.default.createElement("label", { className: 'label' },
206
+ placeholder.replace("*", ""),
207
+ placeholder.includes("*") && React__namespace.default.createElement("label", { className: 'astreik' }, "*")),
206
208
  React__namespace.default.createElement("input", { type: type, value: value, name: name, placeholder: showLabelOnBorder ? "" : placeholder, onChange: handleInputValues, onFocus: () => setShowLabelOnBorder(true), onBlur: checkFieldValue,
207
209
  // className={inputClassName}
208
210
  className: `${inputClassName} ${error ? "inputError" : ''}`, maxLength: maxLength, minLength: minLength, min: min, ...rest }),
@@ -9607,7 +9609,7 @@ const Tabs = ({ tabs, onTabChange, selectedTabValue, dot, }) => {
9607
9609
  dot && haveDots.includes(tab.value.toLowerCase()) && (React__namespace.default.createElement("span", { className: "dot" })))))))));
9608
9610
  };
9609
9611
 
9610
- 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}\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.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}";
9612
+ 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}\n\n.astreik {\n color: #eb0542;\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.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}";
9611
9613
  n(css$9,{});
9612
9614
 
9613
9615
  function Dropdown(props) {
@@ -9622,24 +9624,32 @@ function Dropdown(props) {
9622
9624
  return (React__namespace.default.createElement(React__namespace.default.Fragment, null,
9623
9625
  openDropdown && (React__namespace.default.createElement("div", { onClick: () => setOpenDropdown(!openDropdown), className: "backdropDropdown" })),
9624
9626
  React__namespace.default.createElement("div", { className: "dropPosition" },
9625
- placeholder && selectedValue && (React__namespace.default.createElement("label", { className: "label" }, placeholder)),
9627
+ placeholder && selectedValue && (React__namespace.default.createElement("label", { className: "label" },
9628
+ placeholder.replace("*", ""),
9629
+ placeholder.includes("*") && React__namespace.default.createElement("label", { className: 'astreik' }, "*"))),
9626
9630
  React__namespace.default.createElement("div", { onClick: () => setOpenDropdown(!openDropdown), className: `${"dropdown"} ${className}` },
9627
9631
  !selectedValue && (React__namespace.default.createElement(Typography, { className: "placeholder", variant: "B3", weight: "SEMI_BOLD" }, placeholder)),
9628
- selectedValue && (React__namespace.default.createElement(Typography, { className: "value", variant: "B3", weight: "BOLD" }, selectedValue.name)),
9632
+ selectedValue && (React__namespace.default.createElement(Typography, { className: "value", variant: "B3", weight: "MEDIUM" }, selectedValue.name)),
9629
9633
  !openDropdown && React__namespace.default.createElement("div", null, arrowDown),
9630
9634
  openDropdown && React__namespace.default.createElement("div", null, arrowUp)),
9631
9635
  openDropdown && (React__namespace.default.createElement("div", { className: "dropdownValues" }, dropdownList.map((val) => (React__namespace.default.createElement("div", { onClick: () => selectedDropdwonValue(val), className: "unselectedText" },
9632
9636
  React__namespace.default.createElement(Typography, { variant: "B3", weight: "SEMI_BOLD" }, val.name)))))))));
9633
9637
  }
9634
9638
 
9635
- 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 position: relative;\n max-width: 100%;\n max-height: 100%;\n overflow: hidden;\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}";
9639
+ 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 position: relative;\n max-width: 100%;\n max-height: 100%;\n overflow: hidden;\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}";
9636
9640
  n(css$8,{});
9637
9641
 
9638
9642
  function TextArea(props) {
9639
9643
  const { value, onChange, requiredLimit, placeholder, charText, property } = props;
9644
+ const [showLabelOnBorder, setShowLabelOnBorder] = React__namespace.default.useState(false);
9645
+ const checkFieldValue = (e) => {
9646
+ if (!e.target.value) {
9647
+ setShowLabelOnBorder(false);
9648
+ }
9649
+ };
9640
9650
  return (React__namespace.default.createElement(React__namespace.default.Fragment, null,
9641
9651
  React__namespace.default.createElement("div", { className: "textArea100" },
9642
- React__namespace.default.createElement("textarea", { value: value, onChange: (event) => onChange(event, property), maxLength: Number(requiredLimit), className: `textArea ${value?.length === Number(requiredLimit) ? "maxLimitArea" : ""}`, placeholder: placeholder })),
9652
+ React__namespace.default.createElement("textarea", { value: value, onChange: (event) => onChange(event, property), maxLength: Number(requiredLimit), onFocus: () => setShowLabelOnBorder(true), onBlur: checkFieldValue, className: `textArea ${value?.length === Number(requiredLimit) ? "maxLimitArea" : ""}`, placeholder: placeholder })),
9643
9653
  React__namespace.default.createElement(Typography, { className: `characters ${value?.length === Number(requiredLimit) ? "maxLimit" : ""}`, variant: "L1", weight: "SEMI_BOLD" },
9644
9654
  value?.length ?? 0,
9645
9655
  "/",