hplx-react-elements-dev 1.0.41 → 1.0.43

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.
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
2
  import { AddSuggestionProps } from "../types";
3
- declare const AddSuggestion: ({ isInputField, label, labelColor, labelSize, start_icon, end_icon, prefix, suffixButton, suffix, suffixDropdown, isSuffixEditable, suffixInputProps, suffixPlaceholder, handleSuggestionValChange, handleSuffixValChange, handleSuffixClick, char_count, onSuggestionClick, height, hint_text_icon, hint_text, errorMsg, inputProps, inputFieldInputProps, options, fieldColor, suggestionValue, isborderRequired, }: AddSuggestionProps) => JSX.Element;
3
+ declare const AddSuggestion: ({ isInputField, label, labelColor, labelSize, start_icon, end_icon, prefix, suffixButton, suffix, suffixDropdown, isSuffixEditable, suffixInputProps, suffixPlaceholder, handleSuggestionValChange, handleSuffixValChange, handleSuffixClick, char_count, onSuggestionClick, className, rows, hint_text_icon, hint_text, errorMsg, inputProps, inputFieldInputProps, options, suggestionValue, isborderRequired, isDynamicHeight, fieldColor, }: AddSuggestionProps) => JSX.Element;
4
4
  export default AddSuggestion;
@@ -2,14 +2,6 @@
2
2
  import "react-date-range/dist/styles.css";
3
3
  import "react-date-range/dist/theme/default.css";
4
4
  import "../datePicker/DatePickerCSS.css";
5
- export interface DatePickerProps {
6
- disabledDates?: Date[];
7
- selectDate?: any;
8
- dateVar: (val: Date) => void;
9
- isborderRequired?: boolean;
10
- minDate?: Date;
11
- maxDate?: Date;
12
- fieldColor?: string;
13
- }
14
- declare const DatePicker: ({ disabledDates, selectDate, dateVar, minDate, maxDate, fieldColor, isborderRequired, }: DatePickerProps) => JSX.Element;
5
+ import { DatePickerProps } from "../types";
6
+ declare const DatePicker: ({ disabledDates, selectDate, dateVar, minDate, maxDate, label, labelColor, labelSize, height, start_icon, end_icon, hint_text_icon, prefix, suffixButton, suffix, hint_text, char_count, errorMsg, suffixInputProps, suffixDropdown, isSuffixEditable, suffixPlaceholder, fieldColor, isborderRequired, }: DatePickerProps) => JSX.Element;
15
7
  export default DatePicker;
package/dist/esm/index.js CHANGED
@@ -2545,26 +2545,42 @@ var TextAreaField = function TextAreaField(_a) {
2545
2545
  _c = _a.errorMsg,
2546
2546
  errorMsg = _c === void 0 ? "" : _c,
2547
2547
  inputProps = _a.inputProps,
2548
- _d = _a.height,
2549
- height = _d === void 0 ? "hplxt-h-32" : _d;
2548
+ className = _a.className,
2549
+ _d = _a.rows,
2550
+ rows = _d === void 0 ? 2 : _d,
2551
+ _e = _a.isDynamicHeight,
2552
+ isDynamicHeight = _e === void 0 ? false : _e;
2550
2553
 
2551
- var _e = inputProps || {},
2552
- disabled = _e.disabled,
2553
- onFocus = _e.onFocus,
2554
- onBlur = _e.onBlur;
2554
+ var _f = inputProps || {},
2555
+ disabled = _f.disabled,
2556
+ onFocus = _f.onFocus,
2557
+ onBlur = _f.onBlur;
2555
2558
 
2556
- var _f = useState(false),
2557
- active = _f[0],
2558
- setActive = _f[1];
2559
+ var _g = useState(false),
2560
+ active = _g[0],
2561
+ setActive = _g[1];
2562
+
2563
+ var _h = useState(rows),
2564
+ row = _h[0],
2565
+ setRow = _h[1];
2566
+
2567
+ var ref = useRef(null);
2568
+
2569
+ var handleHeight = function handleHeight() {
2570
+ var element = ref.current;
2571
+ isDynamicHeight && setRow(element.scrollHeight / 32);
2572
+ };
2559
2573
 
2560
2574
  var handleFocus = function handleFocus(event) {
2561
2575
  setActive(true);
2562
2576
  onFocus && onFocus(event);
2577
+ isDynamicHeight && handleHeight();
2563
2578
  };
2564
2579
 
2565
2580
  var handleBlur = function handleBlur(event) {
2566
2581
  setActive(false);
2567
2582
  onBlur && onBlur(event);
2583
+ isDynamicHeight && setRow(rows);
2568
2584
  };
2569
2585
 
2570
2586
  return jsxRuntime.exports.jsxs("div", __assign({
@@ -2584,11 +2600,16 @@ var TextAreaField = function TextAreaField(_a) {
2584
2600
  type: "Text md"
2585
2601
  }, {
2586
2602
  children: jsxRuntime.exports.jsx("div", __assign({
2587
- className: "hplxt-flex hplxt-border-1 hplxt-overflow-hidden placeholder:hplxt-text-Gray-500 ".concat(errorMsg ? "hplxt-border-Error-300" : "hplxt-border-Gray-300", " hplxt-shadow-xs hplxt-rounded-lg ").concat(height, " ").concat(disabled ? "hplxt-bg-Gray-50" : "hplxt-bg-White ".concat(errorMsg ? "hover:hplxt-shadow-xs-error ".concat(active && "hplxt-shadow-xs-error") : "hover:hplxt-border-Primary-300 hover:hplxt-shadow-xs-primary ".concat(active && "hplxt-border-Primary-300 hplxt-shadow-xs-primary")))
2603
+ className: "hplxt-flex hplxt-border-1 hplxt-overflow-hidden placeholder:hplxt-text-Gray-500 ".concat(errorMsg ? "hplxt-border-Error-300" : "hplxt-border-Gray-300", " hplxt-shadow-xs hplxt-rounded-lg ").concat(className, " ").concat(disabled ? "hplxt-bg-Gray-50" : "hplxt-bg-White ".concat(errorMsg ? "hover:hplxt-shadow-xs-error ".concat(active && "hplxt-shadow-xs-error") : "hover:hplxt-border-Primary-300 hover:hplxt-shadow-xs-primary ".concat(active && "hplxt-border-Primary-300 hplxt-shadow-xs-primary")))
2588
2604
  }, {
2589
2605
  children: jsxRuntime.exports.jsx("textarea", __assign({
2590
- className: "hplxt-flex-1 hplxt-px-2 hplxt-py-2 focus-visible:hplxt-outline-0 hplxt-border-0 focus:hplxt-border-0"
2606
+ ref: ref,
2607
+ className: "hplxt-flex-1 hplxt-px-2 hplxt-py-2 focus-visible:hplxt-outline-0 hplxt-border-0 focus:hplxt-border-0",
2608
+ style: {
2609
+ height: row * 32 + 'px'
2610
+ }
2591
2611
  }, inputProps, {
2612
+ onInput: handleHeight,
2592
2613
  onFocus: handleFocus,
2593
2614
  onBlur: handleBlur
2594
2615
  }))
@@ -3320,22 +3341,22 @@ var getSizeClassName$5 = function getSizeClassName(size) {
3320
3341
  var getPaddingClassName$3 = function getPaddingClassName(size, icon, iconFile) {
3321
3342
  switch (size) {
3322
3343
  case "sm":
3323
- return icon && iconFile && icon === "Only" ? "hplxt-h-8 hplxt-w-[34px] hplxt-px-[5.8px]" : "hplxt-h-8 hplxt-px-1";
3344
+ return icon && iconFile && icon === "Only" ? "hplxt-h-8 hplxt-w-[34px] hplxt-px-[5.8px]" : "hplxt-h-8 hplxt-px-4";
3324
3345
 
3325
3346
  case "md":
3326
- return icon && iconFile && icon === "Only" ? "hplxt-h-9 hplxt-w-[42px] hplxt-px-[9.8px]" : "hplxt-h-9 hplxt-px-[6px]";
3347
+ return icon && iconFile && icon === "Only" ? "hplxt-h-9 hplxt-w-[42px] hplxt-px-[9.8px]" : "hplxt-h-9 hplxt-px-4";
3327
3348
 
3328
3349
  case "lg":
3329
- return icon && iconFile && icon === "Only" ? "hplxt-h-10 hplxt-w-[42px] hplxt-px-[9.8px]" : "hplxt-h-10 hplxt-px-2";
3350
+ return icon && iconFile && icon === "Only" ? "hplxt-h-10 hplxt-w-[42px] hplxt-px-[9.8px]" : "hplxt-h-10 hplxt-px-4";
3330
3351
 
3331
3352
  case "xl":
3332
- return icon && iconFile && icon === "Only" ? "hplxt-h-11 hplxt-w-[46px] hplxt-px-[11.8px]" : "hplxt-h-11 hplxt-px-[10px]";
3353
+ return icon && iconFile && icon === "Only" ? "hplxt-h-11 hplxt-w-[46px] hplxt-px-[11.8px]" : "hplxt-h-11 hplxt-px-4";
3333
3354
 
3334
3355
  case "2xl":
3335
- return icon && iconFile && icon === "Only" ? "hplxt-h-12 hplxt-w-[50px] hplxt-px-[13.8px]" : "hplxt-h-12 hplxt-px-3";
3356
+ return icon && iconFile && icon === "Only" ? "hplxt-h-12 hplxt-w-[50px] hplxt-px-[13.8px]" : "hplxt-h-12 hplxt-px-4";
3336
3357
 
3337
3358
  default:
3338
- return icon && iconFile && icon === "Only" ? "hplxt-h-8 hplxt-w-[34px] hplxt-px-[5.8px]" : "hplxt-h-8 hplxt-px-1";
3359
+ return icon && iconFile && icon === "Only" ? "hplxt-h-8 hplxt-w-[34px] hplxt-px-[5.8px]" : "hplxt-h-8 hplxt-px-4";
3339
3360
  }
3340
3361
  };
3341
3362
 
@@ -4273,7 +4294,7 @@ var CollapsibleCard = function CollapsibleCard(props) {
4273
4294
  footer = _a.footer,
4274
4295
  title = _a.title,
4275
4296
  _d = _a.icon,
4276
- icon = _d === void 0 ? "Right" : _d,
4297
+ icon = _d === void 0 ? "Only" : _d,
4277
4298
  _e = _a.openIcon,
4278
4299
  openIcon = _e === void 0 ? "hx_add" : _e,
4279
4300
  _f = _a.closeIcon,
@@ -5219,8 +5240,9 @@ var AddSuggestion = function AddSuggestion(_a) {
5219
5240
  char_count = _a.char_count,
5220
5241
  _l = _a.onSuggestionClick,
5221
5242
  onSuggestionClick = _l === void 0 ? function (_selectedValue) {} : _l,
5222
- _m = _a.height,
5223
- height = _m === void 0 ? "hplxt-h-32" : _m,
5243
+ className = _a.className,
5244
+ _m = _a.rows,
5245
+ rows = _m === void 0 ? 2 : _m,
5224
5246
  _o = _a.hint_text_icon,
5225
5247
  hint_text_icon = _o === void 0 ? "" : _o,
5226
5248
  hint_text = _a.hint_text,
@@ -5229,21 +5251,23 @@ var AddSuggestion = function AddSuggestion(_a) {
5229
5251
  inputProps = _a.inputProps,
5230
5252
  inputFieldInputProps = _a.inputFieldInputProps,
5231
5253
  options = _a.options,
5232
- fieldColor = _a.fieldColor,
5233
5254
  _q = _a.suggestionValue,
5234
5255
  suggestionValue = _q === void 0 ? "" : _q,
5235
5256
  _r = _a.isborderRequired,
5236
- isborderRequired = _r === void 0 ? true : _r;
5257
+ isborderRequired = _r === void 0 ? true : _r,
5258
+ _s = _a.isDynamicHeight,
5259
+ isDynamicHeight = _s === void 0 ? false : _s,
5260
+ fieldColor = _a.fieldColor;
5237
5261
 
5238
- var _s = useState(false),
5239
- showDropdown = _s[0],
5240
- setShowDropdown = _s[1];
5262
+ var _t = useState(false),
5263
+ showDropdown = _t[0],
5264
+ setShowDropdown = _t[1];
5241
5265
 
5242
5266
  var wrapperRef = useRef(null);
5243
5267
 
5244
- var _t = useState(),
5245
- suggestionArr = _t[0],
5246
- setSuggestionArr = _t[1];
5268
+ var _u = useState(),
5269
+ suggestionArr = _u[0],
5270
+ setSuggestionArr = _u[1];
5247
5271
 
5248
5272
  var changeHandler = function changeHandler(e) {
5249
5273
  setShowDropdown(true);
@@ -5334,7 +5358,9 @@ var AddSuggestion = function AddSuggestion(_a) {
5334
5358
  hint_text: hint_text,
5335
5359
  hint_text_icon: hint_text_icon,
5336
5360
  errorMsg: errorMsg,
5337
- height: height,
5361
+ className: className,
5362
+ rows: rows,
5363
+ isDynamicHeight: isDynamicHeight,
5338
5364
  inputProps: __assign(__assign({}, inputProps), {
5339
5365
  onChange: changeHandler,
5340
5366
  value: suggestionValue,
@@ -5344,7 +5370,7 @@ var AddSuggestion = function AddSuggestion(_a) {
5344
5370
  })
5345
5371
  }), showDropdown && jsxRuntime.exports.jsx("div", __assign({
5346
5372
  ref: wrapperRef,
5347
- className: "hplxt-absolute hplxt-mt-1 hplxt-min-w-max hplxt-rounded-lg hplxt-bg-White hplxt-overflow-y-auto hplxt-shadow-md hplxt-z-10 hplxt-max-h-80 "
5373
+ className: "hplxt-absolute hplxt-border hplxt-border-Gray-300 hplxt-mt-1 hplxt-min-w-max hplxt-rounded-lg hplxt-bg-Indigo-25 hplxt-overflow-y-auto hplxt-shadow-md hplxt-z-10 hplxt-max-h-80 "
5348
5374
  }, {
5349
5375
  children: suggestionArr && suggestionArr.length > 0 && jsxRuntime.exports.jsx("div", {
5350
5376
  children: (suggestionArr === null || suggestionArr === void 0 ? void 0 : suggestionArr.constructor) === Array && suggestionArr.length ? suggestionArr.map(function (option) {
@@ -16903,17 +16929,41 @@ var DatePicker = function DatePicker(_a) {
16903
16929
  dateVar = _a.dateVar,
16904
16930
  minDate = _a.minDate,
16905
16931
  maxDate = _a.maxDate,
16932
+ label = _a.label,
16933
+ labelColor = _a.labelColor,
16934
+ labelSize = _a.labelSize,
16935
+ _c = _a.height,
16936
+ height = _c === void 0 ? "" : _c,
16937
+ _d = _a.start_icon,
16938
+ start_icon = _d === void 0 ? "hx_calendar hplxt-text-4" : _d,
16939
+ _e = _a.end_icon,
16940
+ end_icon = _e === void 0 ? "" : _e,
16941
+ _f = _a.hint_text_icon,
16942
+ hint_text_icon = _f === void 0 ? "" : _f,
16943
+ prefix = _a.prefix,
16944
+ suffixButton = _a.suffixButton,
16945
+ suffix = _a.suffix,
16946
+ hint_text = _a.hint_text,
16947
+ char_count = _a.char_count,
16948
+ _g = _a.errorMsg,
16949
+ errorMsg = _g === void 0 ? "" : _g,
16950
+ // inputProps,
16951
+ suffixInputProps = _a.suffixInputProps,
16952
+ suffixDropdown = _a.suffixDropdown,
16953
+ _h = _a.isSuffixEditable,
16954
+ isSuffixEditable = _h === void 0 ? false : _h,
16955
+ suffixPlaceholder = _a.suffixPlaceholder,
16906
16956
  fieldColor = _a.fieldColor,
16907
- _c = _a.isborderRequired,
16908
- isborderRequired = _c === void 0 ? true : _c;
16957
+ _j = _a.isborderRequired,
16958
+ isborderRequired = _j === void 0 ? true : _j;
16909
16959
 
16910
- var _d = useState(),
16911
- date = _d[0],
16912
- setDate = _d[1];
16960
+ var _k = useState(),
16961
+ date = _k[0],
16962
+ setDate = _k[1];
16913
16963
 
16914
- var _e = useState(false),
16915
- clicked = _e[0],
16916
- setClicked = _e[1];
16964
+ var _l = useState(false),
16965
+ clicked = _l[0],
16966
+ setClicked = _l[1];
16917
16967
 
16918
16968
  var handleSelect = function handleSelect(date) {
16919
16969
  setDate(date);
@@ -16956,8 +17006,24 @@ var DatePicker = function DatePicker(_a) {
16956
17006
  className: "hplxt-relative hplxt-w-[189px]"
16957
17007
  }, {
16958
17008
  children: jsxRuntime.exports.jsx(InputField, {
17009
+ label: label,
17010
+ labelColor: labelColor,
17011
+ labelSize: labelSize,
17012
+ height: height,
17013
+ end_icon: end_icon,
17014
+ hint_text_icon: hint_text_icon,
17015
+ prefix: prefix,
17016
+ suffixButton: suffixButton,
17017
+ suffix: suffix,
17018
+ hint_text: hint_text,
17019
+ char_count: char_count,
17020
+ errorMsg: errorMsg,
17021
+ suffixInputProps: suffixInputProps,
17022
+ suffixDropdown: suffixDropdown,
17023
+ isSuffixEditable: isSuffixEditable,
17024
+ suffixPlaceholder: suffixPlaceholder,
16959
17025
  isborderRequired: isborderRequired,
16960
- start_icon: "hx_calendar hplxt-text-4",
17026
+ start_icon: start_icon,
16961
17027
  inputProps: {
16962
17028
  placeholder: "Select date",
16963
17029
  onClick: inputClick,
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
2
  import { TextAreaFieldProps } from "../types";
3
- declare const TextAreaField: ({ label, hint_text_icon, hint_text, errorMsg, inputProps, height, }: TextAreaFieldProps) => JSX.Element;
3
+ declare const TextAreaField: ({ label, hint_text_icon, hint_text, errorMsg, inputProps, className, rows, isDynamicHeight, }: TextAreaFieldProps) => JSX.Element;
4
4
  export default TextAreaField;
@@ -23,6 +23,34 @@ export interface InputFieldProps {
23
23
  isSuffixEditable?: boolean;
24
24
  handleSuffixValChange?: (value: any) => void;
25
25
  }
26
+ export interface DatePickerProps {
27
+ disabledDates?: Date[];
28
+ selectDate?: any;
29
+ dateVar: (val: Date) => void;
30
+ minDate?: Date;
31
+ maxDate?: Date;
32
+ label?: string;
33
+ fieldColor?: string;
34
+ labelSize?: typographyTextType;
35
+ labelColor?: string;
36
+ height?: string;
37
+ prefix?: ReactNode;
38
+ suffixButton?: ReactNode;
39
+ suffix?: ReactNode;
40
+ start_icon?: string;
41
+ end_icon?: string;
42
+ hint_text?: string;
43
+ hint_text_icon?: string;
44
+ char_count?: string;
45
+ errorMsg?: string;
46
+ isborderRequired?: boolean;
47
+ suffixInputProps?: React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
48
+ suffixPlaceholder?: string;
49
+ suffixDropdown?: any;
50
+ handleSuffixClick?: (value: any) => void;
51
+ isSuffixEditable?: boolean;
52
+ handleSuffixValChange?: (value: any) => void;
53
+ }
26
54
  export interface InputFieldSplitProps {
27
55
  label?: string;
28
56
  labelSize?: typographyTextType;
@@ -62,7 +90,9 @@ export interface TextAreaFieldProps {
62
90
  hint_text_icon?: string;
63
91
  errorMsg?: string;
64
92
  inputProps: React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>;
65
- height?: string;
93
+ className?: string;
94
+ rows?: number;
95
+ isDynamicHeight?: boolean;
66
96
  }
67
97
  type badgesizeType = "sm" | "md" | "lg";
68
98
  type badgeiconType = "Left" | "Right" | "Only";
@@ -301,7 +331,9 @@ export interface NestedDropdownItemsProps {
301
331
  export interface AddSuggestionProps {
302
332
  label?: string;
303
333
  isInputField?: boolean;
304
- height?: string;
334
+ className?: string;
335
+ rows?: number;
336
+ isDynamicHeight?: boolean;
305
337
  labelSize?: typographyTextType;
306
338
  labelColor?: string;
307
339
  prefix?: ReactNode;
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "frontend",
10
10
  "healthplix"
11
11
  ],
12
- "version": "1.0.41",
12
+ "version": "1.0.43",
13
13
  "main": "dist/esm/index.js",
14
14
  "module": "dist/esm/index.js",
15
15
  "types": "dist/esm/index.d.ts",