hplx-react-elements-dev 1.0.40 → 1.0.42

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, 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;
package/dist/esm/index.js CHANGED
@@ -2083,7 +2083,7 @@ var DropdownItems = function DropdownItems(_a) {
2083
2083
  onClick: function onClick() {
2084
2084
  !disabled && onSelect && onSelect(value);
2085
2085
  },
2086
- className: "hplxt-h-10 hplxt-flex hplxt-items-center hplxt-px-2 ".concat(disabled ? "hplxt-cursor-not-allowed" : "hover:hplxt-bg-Gray-50 hplxt-cursor-pointer"),
2086
+ className: "hplxt-h-10 hplxt-flex hplxt-items-center hplxt-px-2 ".concat(disabled ? "hplxt-cursor-not-allowed" : "hover:hplxt-bg-Blue_gray-100 hplxt-cursor-pointer"),
2087
2087
  onMouseEnter: onMouseEnterHandler,
2088
2088
  onMouseLeave: onMouseLeaveHandler
2089
2089
  }, {
@@ -2094,12 +2094,12 @@ var DropdownItems = function DropdownItems(_a) {
2094
2094
  className: start_icon
2095
2095
  })
2096
2096
  })), jsxRuntime.exports.jsx(Typography, __assign({
2097
- variant: hover && !disabled ? 'Medium' : 'Regular',
2097
+ variant: hover && !disabled ? "Medium" : "Regular",
2098
2098
  type: "Text md",
2099
2099
  className: "hplxt-truncate"
2100
2100
  }, {
2101
2101
  children: jsxRuntime.exports.jsx("div", __assign({
2102
- className: "hplxt-flex-1 ".concat(disabled ? 'hplxt-text-Gray-200' : 'hplxt-text-Gray-700', " ").concat(className),
2102
+ className: "hplxt-flex-1 ".concat(disabled ? "hplxt-text-Gray-200" : "hplxt-text-Gray-700", " ").concat(className),
2103
2103
  title: checkOverFlow() ? label : undefined,
2104
2104
  ref: ref
2105
2105
  }, {
@@ -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
  }))
@@ -4271,8 +4292,9 @@ var CollapsibleCard = function CollapsibleCard(props) {
4271
4292
  header = _a.header,
4272
4293
  children = _a.children,
4273
4294
  footer = _a.footer,
4295
+ title = _a.title,
4274
4296
  _d = _a.icon,
4275
- icon = _d === void 0 ? "Right" : _d,
4297
+ icon = _d === void 0 ? "Only" : _d,
4276
4298
  _e = _a.openIcon,
4277
4299
  openIcon = _e === void 0 ? "hx_add" : _e,
4278
4300
  _f = _a.closeIcon,
@@ -4331,20 +4353,30 @@ var CollapsibleCard = function CollapsibleCard(props) {
4331
4353
 
4332
4354
  if (direction === "up" || direction === "down") {
4333
4355
  return jsxRuntime.exports.jsxs("div", __assign({
4334
- className: "hplxt-flex hplxt-m-5 ".concat(direction === "down" ? "hplxt-flex-col" : "hplxt-flex-col-reverse")
4356
+ className: "hplxt-flex hplxt-flex-col ".concat(direction === "down" ? "hplxt-flex-col" : "hplxt-flex-col-reverse")
4335
4357
  }, {
4336
4358
  children: [jsxRuntime.exports.jsxs("div", __assign({
4337
4359
  className: "hplxt-flex hplxt-flex-1 hplxt-flex-row hplxt-items-center"
4338
4360
  }, {
4339
- children: [jsxRuntime.exports.jsx(Tooltip, __assign({
4361
+ children: [title && jsxRuntime.exports.jsx("div", __assign({
4362
+ className: "hplxt-flex hplxt-mr-6 hplxt-items-center "
4363
+ }, {
4364
+ children: jsxRuntime.exports.jsx(Typography, __assign({
4365
+ variant: "Medium",
4366
+ type: "Text md",
4367
+ className: "hplxt-text-Gray-800"
4368
+ }, {
4369
+ children: title
4370
+ }))
4371
+ })), jsxRuntime.exports.jsx(Tooltip, __assign({
4340
4372
  variant: "Top",
4341
4373
  text: active ? "Click here to collapse" : "Click here to expand",
4342
4374
  theme: "light"
4343
4375
  }, {
4344
4376
  children: jsxRuntime.exports.jsx(Button, {
4345
4377
  onClick: OnButtonClick,
4346
- hierarchy: "Secondary-Grey-Dashed",
4347
- size: "lg",
4378
+ hierarchy: "Secondary-Grey",
4379
+ size: "sm",
4348
4380
  icon: icon,
4349
4381
  iconFile: active ? closeIcon : openIcon,
4350
4382
  textField: label,
@@ -4356,7 +4388,7 @@ var CollapsibleCard = function CollapsibleCard(props) {
4356
4388
  onAnimationEnd: function onAnimationEnd() {
4357
4389
  console.log("onAnimationEnd called");
4358
4390
  },
4359
- className: "".concat(active ? "hplxt-max-h-[1000px] hplxt-overflow-visible" : "hplxt-max-h-0 hplxt-overflow-hidden", " ").concat(active ? "hplxt-p-5" : "hplxt-p-0", " hplxt-transition-all hplxt-duration-500 hplxt-ease-in-out hplxt-mt-5 ").concat(getWidth(width), " ").concat(getHeight(height), " hplxt-text-ellipsis")
4391
+ className: "".concat(active ? "hplxt-max-h-[1000px] hplxt-overflow-visible" : "hplxt-max-h-0 hplxt-overflow-hidden", " ").concat(active ? "hplxt-p-5" : "hplxt-p-0", " hplxt-transition-all hplxt-duration-500 hplxt-ease-in-out hplxt-mt-5 ").concat(getWidth(width), " ").concat(getHeight(height), " hplxt-text-ellipsis\n ")
4360
4392
  }, {
4361
4393
  children: [header && jsxRuntime.exports.jsx("div", __assign({
4362
4394
  className: "hplxt-flex hplxt-flex-1 hplxt-m-1 hplxt-p-4"
@@ -5208,8 +5240,9 @@ var AddSuggestion = function AddSuggestion(_a) {
5208
5240
  char_count = _a.char_count,
5209
5241
  _l = _a.onSuggestionClick,
5210
5242
  onSuggestionClick = _l === void 0 ? function (_selectedValue) {} : _l,
5211
- _m = _a.height,
5212
- height = _m === void 0 ? "hplxt-h-32" : _m,
5243
+ className = _a.className,
5244
+ _m = _a.rows,
5245
+ rows = _m === void 0 ? 2 : _m,
5213
5246
  _o = _a.hint_text_icon,
5214
5247
  hint_text_icon = _o === void 0 ? "" : _o,
5215
5248
  hint_text = _a.hint_text,
@@ -5221,17 +5254,20 @@ var AddSuggestion = function AddSuggestion(_a) {
5221
5254
  _q = _a.suggestionValue,
5222
5255
  suggestionValue = _q === void 0 ? "" : _q,
5223
5256
  _r = _a.isborderRequired,
5224
- 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;
5225
5261
 
5226
- var _s = useState(false),
5227
- showDropdown = _s[0],
5228
- setShowDropdown = _s[1];
5262
+ var _t = useState(false),
5263
+ showDropdown = _t[0],
5264
+ setShowDropdown = _t[1];
5229
5265
 
5230
5266
  var wrapperRef = useRef(null);
5231
5267
 
5232
- var _t = useState(),
5233
- suggestionArr = _t[0],
5234
- setSuggestionArr = _t[1];
5268
+ var _u = useState(),
5269
+ suggestionArr = _u[0],
5270
+ setSuggestionArr = _u[1];
5235
5271
 
5236
5272
  var changeHandler = function changeHandler(e) {
5237
5273
  setShowDropdown(true);
@@ -5308,6 +5344,7 @@ var AddSuggestion = function AddSuggestion(_a) {
5308
5344
  hint_text: hint_text,
5309
5345
  hint_text_icon: hint_text_icon,
5310
5346
  errorMsg: errorMsg,
5347
+ fieldColor: fieldColor,
5311
5348
  suffixPlaceholder: suffixPlaceholder,
5312
5349
  isborderRequired: isborderRequired,
5313
5350
  isSuffixEditable: isSuffixEditable,
@@ -5321,7 +5358,9 @@ var AddSuggestion = function AddSuggestion(_a) {
5321
5358
  hint_text: hint_text,
5322
5359
  hint_text_icon: hint_text_icon,
5323
5360
  errorMsg: errorMsg,
5324
- height: height,
5361
+ className: className,
5362
+ rows: rows,
5363
+ isDynamicHeight: isDynamicHeight,
5325
5364
  inputProps: __assign(__assign({}, inputProps), {
5326
5365
  onChange: changeHandler,
5327
5366
  value: suggestionValue,
@@ -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;
@@ -62,7 +62,9 @@ export interface TextAreaFieldProps {
62
62
  hint_text_icon?: string;
63
63
  errorMsg?: string;
64
64
  inputProps: React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>;
65
- height?: string;
65
+ className?: string;
66
+ rows?: number;
67
+ isDynamicHeight?: boolean;
66
68
  }
67
69
  type badgesizeType = "sm" | "md" | "lg";
68
70
  type badgeiconType = "Left" | "Right" | "Only";
@@ -185,6 +187,7 @@ export interface CardType {
185
187
  }
186
188
  type CollapseDirection = "up" | "down" | "left" | "right";
187
189
  export interface CollapsibleCardProps {
190
+ title?: ReactNode;
188
191
  direction?: CollapseDirection;
189
192
  label?: string;
190
193
  children?: ReactNode;
@@ -300,7 +303,9 @@ export interface NestedDropdownItemsProps {
300
303
  export interface AddSuggestionProps {
301
304
  label?: string;
302
305
  isInputField?: boolean;
303
- height?: string;
306
+ className?: string;
307
+ rows?: number;
308
+ isDynamicHeight?: boolean;
304
309
  labelSize?: typographyTextType;
305
310
  labelColor?: string;
306
311
  prefix?: ReactNode;
@@ -312,6 +317,7 @@ export interface AddSuggestionProps {
312
317
  suffix?: ReactNode;
313
318
  start_icon?: string;
314
319
  end_icon?: string;
320
+ fieldColor?: string;
315
321
  hint_text?: string;
316
322
  hint_text_icon?: string;
317
323
  char_count?: string;
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "frontend",
10
10
  "healthplix"
11
11
  ],
12
- "version": "1.0.40",
12
+ "version": "1.0.42",
13
13
  "main": "dist/esm/index.js",
14
14
  "module": "dist/esm/index.js",
15
15
  "types": "dist/esm/index.d.ts",