hplx-react-elements-dev 1.0.45 → 1.0.47

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, height, width, 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;
3
+ declare const AddSuggestion: ({ isInputField, label, labelColor, labelSize, start_icon, height, width, 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, suffixClassName, }: AddSuggestionProps) => JSX.Element;
4
4
  export default AddSuggestion;
@@ -3,5 +3,5 @@ import "react-date-range/dist/styles.css";
3
3
  import "react-date-range/dist/theme/default.css";
4
4
  import "../datePicker/DatePickerCSS.css";
5
5
  import { DatePickerProps } from "../types";
6
- declare const DatePicker: ({ disabledDates, selectDate, dateVar, minDate, maxDate, label, width, 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;
6
+ declare const DatePicker: ({ disabledDates, selectDate, dateVar, minDate, maxDate, label, width, labelColor, labelSize, placeholder, 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;
7
7
  export default DatePicker;
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
2
  import { DropdownFieldProps } from "../types";
3
- declare const DropdownField: ({ label, end_icon, hint_text_icon, empty_text, hint_text, value, onChange, disabled, placeholder, errorMsg, options, }: DropdownFieldProps) => JSX.Element;
3
+ declare const DropdownField: ({ label, end_icon, hint_text_icon, empty_text, hint_text, value, onChange, disabled, placeholder, errorMsg, options, className }: DropdownFieldProps) => JSX.Element;
4
4
  export default DropdownField;
package/dist/esm/index.js CHANGED
@@ -2143,9 +2143,11 @@ var InputField = function InputField(_a) {
2143
2143
  _g = _a.isSuffixEditable,
2144
2144
  isSuffixEditable = _g === void 0 ? false : _g,
2145
2145
  suffixPlaceholder = _a.suffixPlaceholder,
2146
+ suffixClassName = _a.suffixClassName,
2146
2147
  fieldColor = _a.fieldColor,
2147
2148
  _h = _a.handleSuffixClick,
2148
- handleSuffixClick = _h === void 0 ? function (_) {} : _h;
2149
+ handleSuffixClick = _h === void 0 ? function (_) {} : _h,
2150
+ className = _a.className;
2149
2151
 
2150
2152
  var _j = inputProps || {},
2151
2153
  disabled = _j.disabled,
@@ -2245,7 +2247,7 @@ var InputField = function InputField(_a) {
2245
2247
  }, {
2246
2248
  children: jsxRuntime.exports.jsxs("div", __assign({
2247
2249
  "data-setid": "error-msg",
2248
- className: "hplxt-flex ".concat(isborderRequired ? "hplxt-shadow-xs ".concat(border ? border : "hplxt-border-1", " hplxt-rounded-lg") : "", " hplxt-overflow-hidden placeholder:hplxt-text-Gray-500 ").concat(errorMsg ? "hplxt-border-Error-300" : "hplxt-border-Gray-300", " ").concat(height ? height : "hplxt-h-10", " ").concat(disabled ? "hplxt-bg-Gray-50" : "".concat(fieldColor ? fieldColor : "hplxt-bg-White", " ").concat(errorMsg ? "hover:hplxt-shadow-xs-error ".concat(active && "hplxt-shadow-xs-error") : " ".concat(isborderRequired ? "hover:hplxt-border-Primary-300 hover:hplxt-shadow-xs-primary ".concat(active && "hplxt-border-Primary-300 hplxt-shadow-xs-primary") : " ")))
2250
+ className: "hplxt-flex ".concat(isborderRequired ? "hplxt-shadow-xs ".concat(border ? border : "hplxt-border-1", " hplxt-rounded-lg") : "", " hplxt-overflow-hidden placeholder:hplxt-text-Gray-500 ").concat(errorMsg ? "hplxt-border-Error-300" : "hplxt-border-Gray-300", " ").concat(height ? height : "hplxt-h-10", " ").concat(disabled ? "hplxt-bg-Gray-50" : "".concat(fieldColor ? fieldColor : "hplxt-bg-White", " ").concat(errorMsg ? "hover:hplxt-shadow-xs-error ".concat(active && "hplxt-shadow-xs-error") : " ".concat(isborderRequired ? "hover:hplxt-border-Primary-300 hover:hplxt-shadow-xs-primary ".concat(active && "hplxt-border-Primary-300 hplxt-shadow-xs-primary") : " ")), " ").concat(className)
2249
2251
  }, {
2250
2252
  children: [Boolean(prefix) && jsxRuntime.exports.jsx("div", __assign({
2251
2253
  "data-testid": "input-prefix",
@@ -2269,7 +2271,7 @@ var InputField = function InputField(_a) {
2269
2271
  background: "".concat(fieldColor === null || fieldColor === void 0 ? void 0 : fieldColor.split("-")[1], " "),
2270
2272
  width: "".concat(width)
2271
2273
  },
2272
- className: "hplxt-flex-1 hplxt-pl-[14px] ".concat(fieldColor, " placeholder:hplxt-text-Indigo-500 hplxt-opacity-50 hplxt-pr-[12px] hplxt-py-1 focus-visible:hplxt-outline-0 hplxt-border-0 focus:hplxt-border-0"),
2274
+ className: "hplxt-flex-1 hplxt-pl-[14px] ".concat(fieldColor, " placeholder:hplxt-text-Indigo-500 placeholder:hplxt-opacity-50 hplxt-pr-[12px] hplxt-py-1 focus-visible:hplxt-outline-0 hplxt-border-0 focus:hplxt-border-0"),
2273
2275
  "data-testid": "text-input"
2274
2276
  }, inputProps, {
2275
2277
  onFocus: handleFocus,
@@ -2296,7 +2298,7 @@ var InputField = function InputField(_a) {
2296
2298
  })), isSuffixEditable && jsxRuntime.exports.jsxs("div", {
2297
2299
  children: [jsxRuntime.exports.jsx("div", __assign({
2298
2300
  "data-testid": "input-suffix",
2299
- className: "".concat(fieldColor ? fieldColor : "hplxt-bg-Gray-50", " hplxt-bg-none hplxt-border-l-1 hplxt-border-l-Gray-300 hplxt-text-Gray-500 hplxt-flex hplxt-items-center hplxt-pr-3 hplxt-pl-[14px]"),
2301
+ className: "".concat(fieldColor ? fieldColor : "hplxt-bg-Gray-50", " hplxt-bg-none hplxt-border-l-1 hplxt-border-l-Gray-300 hplxt-text-Gray-500 hplxt-flex hplxt-items-center hplxt-pr-3 hplxt-pl-[14px] ").concat(suffixClassName),
2300
2302
  onClick: function onClick() {
2301
2303
  return setShowSuffixDropdown(true);
2302
2304
  }
@@ -4093,7 +4095,8 @@ var DropdownField = function DropdownField(_a) {
4093
4095
  placeholder = _a.placeholder,
4094
4096
  _f = _a.errorMsg,
4095
4097
  errorMsg = _f === void 0 ? "" : _f,
4096
- options = _a.options;
4098
+ options = _a.options,
4099
+ className = _a.className;
4097
4100
 
4098
4101
  var _g = useState(false),
4099
4102
  openDropdown = _g[0],
@@ -4124,7 +4127,7 @@ var DropdownField = function DropdownField(_a) {
4124
4127
  }, {
4125
4128
  children: [jsxRuntime.exports.jsxs("div", __assign({
4126
4129
  onClick: handleFieldClick,
4127
- className: "hplxt-flex-1 hplxt-flex hplxt-items-center hplxt-pl-2 placeholder:hplxt-text-Gray-500 hplxt-justify-between hplxt-border-1 ".concat(errorMsg ? "hplxt-border-Error-300" : "hplxt-border-Gray-300", " hplxt-shadow-xs hplxt-rounded-lg hplxt-h-10 ").concat(disabled ? "hplxt-bg-Gray-50 hplxt-cursor-not-allowed" : "hplxt-bg-White hplxt-cursor-pointer ".concat(errorMsg ? "hover:hplxt-shadow-xs-error" : "".concat(openDropdown ? "hplxt-border-Primary-300 hplxt-shadow-xs-primary" : "", " hover:hplxt-border-Primary-300 hover:hplxt-shadow-xs-primary")))
4130
+ className: "hplxt-flex-1 hplxt-flex hplxt-items-center hplxt-pl-2 placeholder:hplxt-text-Gray-500 hplxt-justify-between hplxt-border-1 ".concat(errorMsg ? "hplxt-border-Error-300" : "hplxt-border-Gray-300", " hplxt-shadow-xs hplxt-rounded-lg hplxt-h-10 ").concat(disabled ? "hplxt-bg-Gray-50 hplxt-cursor-not-allowed" : "hplxt-bg-White hplxt-cursor-pointer ".concat(errorMsg ? "hover:hplxt-shadow-xs-error" : "".concat(openDropdown ? "hplxt-border-Primary-300 hplxt-shadow-xs-primary" : "", " hover:hplxt-border-Primary-300 hover:hplxt-shadow-xs-primary")), " ").concat(className)
4128
4131
  }, {
4129
4132
  children: [!!value ? jsxRuntime.exports.jsx("div", __assign({
4130
4133
  className: "hplxt-text-Gray-900"
@@ -4291,35 +4294,38 @@ var CollapsibleCard = function CollapsibleCard(props) {
4291
4294
  var _a = props || {},
4292
4295
  _b = _a.direction,
4293
4296
  direction = _b === void 0 ? "down" : _b,
4294
- _c = _a.label,
4295
- label = _c === void 0 ? "" : _c,
4296
4297
  header = _a.header,
4297
4298
  children = _a.children,
4298
4299
  footer = _a.footer,
4299
4300
  title = _a.title,
4301
+ _c = _a.currentState,
4302
+ currentState = _c === void 0 ? function () {} : _c,
4300
4303
  _d = _a.icon,
4301
4304
  icon = _d === void 0 ? "Only" : _d,
4302
4305
  _e = _a.openIcon,
4303
4306
  openIcon = _e === void 0 ? "hx_add" : _e,
4304
- _f = _a.closeIcon,
4305
- closeIcon = _f === void 0 ? "hx_remove" : _f,
4306
- _g = _a.width,
4307
- width = _g === void 0 ? "" : _g,
4308
- _h = _a.height,
4309
- height = _h === void 0 ? "" : _h,
4310
- _j = _a.disabled,
4311
- disabled = _j === void 0 ? false : _j,
4307
+ _f = _a.label,
4308
+ label = _f === void 0 ? "" : _f,
4309
+ _g = _a.closeIcon,
4310
+ closeIcon = _g === void 0 ? "hx_remove" : _g,
4311
+ _h = _a.width,
4312
+ width = _h === void 0 ? "" : _h,
4313
+ _j = _a.height,
4314
+ height = _j === void 0 ? "" : _j,
4315
+ _k = _a.disabled,
4316
+ disabled = _k === void 0 ? false : _k,
4312
4317
  handleCollapsibleDisplay = _a.handleCollapsibleDisplay,
4313
4318
  headerRightChildren = _a.headerRightChildren;
4314
4319
 
4315
- var _k = useState(false),
4316
- active = _k[0],
4317
- setActive = _k[1];
4320
+ var _l = useState(false),
4321
+ active = _l[0],
4322
+ setActive = _l[1];
4318
4323
 
4319
4324
  var OnButtonClick = function OnButtonClick() {
4320
4325
  setActive(function (prevValue) {
4321
4326
  return !prevValue;
4322
4327
  });
4328
+ currentState(active);
4323
4329
  };
4324
4330
 
4325
4331
  var getWidth = function getWidth(w) {
@@ -4392,14 +4398,14 @@ var CollapsibleCard = function CollapsibleCard(props) {
4392
4398
  onAnimationEnd: function onAnimationEnd() {
4393
4399
  console.log("onAnimationEnd called");
4394
4400
  },
4395
- 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 ")
4401
+ className: "".concat(active ? "hplxt-max-h-[1000px] hplxt-overflow-visible" : "hplxt-max-h-0 hplxt-overflow-hidden", " ").concat(active ? "hplxt-p-4" : "hplxt-p-0", " hplxt-transition-all hplxt-duration-500 hplxt-ease-in-out ").concat(getWidth(width), " ").concat(getHeight(height), " hplxt-text-ellipsis\n ")
4396
4402
  }, {
4397
4403
  children: [header && jsxRuntime.exports.jsx("div", __assign({
4398
- className: "hplxt-flex hplxt-flex-1 hplxt-m-1 hplxt-p-4"
4404
+ className: "hplxt-flex hplxt-flex-1 hplxt-mx-1 hplxt-px-4 hplxt-pb-4"
4399
4405
  }, {
4400
4406
  children: header
4401
4407
  })), children, footer && jsxRuntime.exports.jsx("div", __assign({
4402
- className: "hplxt-flex hplxt-flex-1 hplxt-m-1 hplxt-p-4"
4408
+ className: "hplxt-flex hplxt-flex-1 hplxt-mx-1 hplxt-p-4"
4403
4409
  }, {
4404
4410
  children: footer
4405
4411
  }))]
@@ -4429,11 +4435,11 @@ var CollapsibleCard = function CollapsibleCard(props) {
4429
4435
  }
4430
4436
  }), active && jsxRuntime.exports.jsxs(jsxRuntime.exports.Fragment, {
4431
4437
  children: [jsxRuntime.exports.jsx("div", __assign({
4432
- className: "hplxt-flex hplxt-flex-1 hplxt-m-1 hplxt-p-4"
4438
+ className: "hplxt-flex hplxt-flex-1 hplxt-mx-1 hplxt-p-4"
4433
4439
  }, {
4434
4440
  children: header
4435
4441
  })), children, jsxRuntime.exports.jsx("div", __assign({
4436
- className: "hplxt-flex hplxt-flex-1 hplxt-m-1 hplxt-p-4"
4442
+ className: "hplxt-flex hplxt-flex-1 hplxt-mx-1 hplxt-p-4"
4437
4443
  }, {
4438
4444
  children: footer
4439
4445
  }))]
@@ -5263,7 +5269,8 @@ var AddSuggestion = function AddSuggestion(_a) {
5263
5269
  isborderRequired = _r === void 0 ? true : _r,
5264
5270
  _s = _a.isDynamicHeight,
5265
5271
  isDynamicHeight = _s === void 0 ? false : _s,
5266
- fieldColor = _a.fieldColor;
5272
+ fieldColor = _a.fieldColor,
5273
+ suffixClassName = _a.suffixClassName;
5267
5274
 
5268
5275
  var _t = useState(false),
5269
5276
  showDropdown = _t[0],
@@ -5357,6 +5364,7 @@ var AddSuggestion = function AddSuggestion(_a) {
5357
5364
  isborderRequired: isborderRequired,
5358
5365
  isSuffixEditable: isSuffixEditable,
5359
5366
  suffixInputProps: suffixInputProps,
5367
+ suffixClassName: suffixClassName,
5360
5368
  inputProps: __assign(__assign({}, inputFieldInputProps), {
5361
5369
  onChange: changeHandler,
5362
5370
  value: suggestionValue
@@ -16941,6 +16949,7 @@ var DatePicker = function DatePicker(_a) {
16941
16949
  width = _a.width,
16942
16950
  labelColor = _a.labelColor,
16943
16951
  labelSize = _a.labelSize,
16952
+ placeholder = _a.placeholder,
16944
16953
  _c = _a.height,
16945
16954
  height = _c === void 0 ? "" : _c,
16946
16955
  _d = _a.start_icon,
@@ -17012,10 +17021,10 @@ var DatePicker = function DatePicker(_a) {
17012
17021
  className: ""
17013
17022
  }, {
17014
17023
  children: [jsxRuntime.exports.jsx("div", __assign({
17015
- className: "hplxt-relative hplxt-w-[189px]"
17024
+ className: "hplxt-relative "
17016
17025
  }, {
17017
17026
  children: jsxRuntime.exports.jsx(InputField, {
17018
- width: width,
17027
+ width: width ? width : "8em",
17019
17028
  label: label,
17020
17029
  labelColor: labelColor,
17021
17030
  labelSize: labelSize,
@@ -17035,7 +17044,7 @@ var DatePicker = function DatePicker(_a) {
17035
17044
  isborderRequired: isborderRequired,
17036
17045
  start_icon: start_icon,
17037
17046
  inputProps: {
17038
- placeholder: "Select date",
17047
+ placeholder: placeholder ? placeholder : "select date",
17039
17048
  onClick: inputClick,
17040
17049
  onFocus: inputFocus,
17041
17050
  value: date ? dayjs(date).format("MMM DD, YYYY") : selectDate === null || selectDate === void 0 ? void 0 : selectDate.toString()
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
2
  import { InputFieldProps } from "../types";
3
- declare const InputField: ({ label, labelColor, labelSize, height, start_icon, width, border, end_icon, hint_text_icon, prefix, suffixButton, suffix, hint_text, char_count, errorMsg, inputProps, suffixInputProps, isborderRequired, suffixDropdown, isSuffixEditable, suffixPlaceholder, fieldColor, handleSuffixClick, }: InputFieldProps) => JSX.Element;
3
+ declare const InputField: ({ label, labelColor, labelSize, height, start_icon, width, border, end_icon, hint_text_icon, prefix, suffixButton, suffix, hint_text, char_count, errorMsg, inputProps, suffixInputProps, isborderRequired, suffixDropdown, isSuffixEditable, suffixPlaceholder, suffixClassName, fieldColor, handleSuffixClick, className }: InputFieldProps) => JSX.Element;
4
4
  export default InputField;
@@ -2,6 +2,7 @@ import { ReactNode } from "react";
2
2
  export interface InputFieldProps {
3
3
  label?: string;
4
4
  fieldColor?: string;
5
+ suffixClassName?: string;
5
6
  width?: string | number;
6
7
  border?: string;
7
8
  labelSize?: typographyTextType;
@@ -24,8 +25,10 @@ export interface InputFieldProps {
24
25
  handleSuffixClick?: (value: any) => void;
25
26
  isSuffixEditable?: boolean;
26
27
  handleSuffixValChange?: (value: any) => void;
28
+ className?: string;
27
29
  }
28
30
  export interface DatePickerProps {
31
+ placeholder?: string;
29
32
  disabledDates?: Date[];
30
33
  selectDate?: any;
31
34
  dateVar: (val: Date) => void;
@@ -231,6 +234,7 @@ export interface DropdownFieldProps {
231
234
  placeholder?: string;
232
235
  empty_text?: string;
233
236
  options?: Array<DropdownItemsProps>;
237
+ className?: string;
234
238
  }
235
239
  export interface CardType {
236
240
  title: string;
@@ -238,6 +242,7 @@ export interface CardType {
238
242
  type CollapseDirection = "up" | "down" | "left" | "right";
239
243
  export interface CollapsibleCardProps {
240
244
  title?: ReactNode;
245
+ currentState?: (val: boolean) => void;
241
246
  direction?: CollapseDirection;
242
247
  label?: string;
243
248
  children?: ReactNode;
@@ -247,7 +252,7 @@ export interface CollapsibleCardProps {
247
252
  closeIcon?: string;
248
253
  width?: string;
249
254
  height?: string;
250
- icon?: iconType;
255
+ icon: iconType;
251
256
  disabled?: boolean;
252
257
  handleCollapsibleDisplay?: Function;
253
258
  headerRightChildren?: ReactNode;
@@ -377,6 +382,7 @@ export interface AddSuggestionProps {
377
382
  inputProps?: React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>;
378
383
  inputFieldInputProps?: React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
379
384
  suffixInputProps?: React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
385
+ suffixClassName?: string;
380
386
  onSuggestionClick?: (selectedValue: any) => void;
381
387
  options?: Array<DropdownItemsProps>;
382
388
  suggestionValue?: string;
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "frontend",
10
10
  "healthplix"
11
11
  ],
12
- "version": "1.0.45",
12
+ "version": "1.0.47",
13
13
  "main": "dist/esm/index.js",
14
14
  "module": "dist/esm/index.js",
15
15
  "types": "dist/esm/index.d.ts",