@appcorp/app-corp-vista 0.1.91 → 0.1.93

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.
@@ -162,17 +162,19 @@ exports.vistaChatV2Props = {
162
162
  ],
163
163
  actionItems: [
164
164
  {
165
+ disable: false,
165
166
  enabled: true,
166
- order: 1,
167
167
  handleOnClick: function () { return void 0; },
168
168
  label: 'Send',
169
+ order: 1,
169
170
  variant: vista_button_type_1.VISTA_BUTTON_VARIANT.PRIMARY,
170
171
  },
171
172
  {
173
+ disable: false,
172
174
  enabled: true,
173
- order: 2,
174
175
  handleOnClick: function () { return void 0; },
175
176
  label: 'End',
177
+ order: 2,
176
178
  variant: vista_button_type_1.VISTA_BUTTON_VARIANT.SECONDARY,
177
179
  },
178
180
  ],
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.VistaTextInputV1 = void 0;
8
8
  var react_1 = __importDefault(require("react"));
9
9
  var VistaTextInputV1 = function (_a) {
10
- var _b = _a.autoFocus, autoFocus = _b === void 0 ? false : _b, _c = _a.className, className = _c === void 0 ? '' : _c, _d = _a.disabled, disabled = _d === void 0 ? false : _d, error = _a.error, handleOnChange = _a.handleOnChange, handleOnKeyDown = _a.handleOnKeyDown, handleSuffixOnClick = _a.handleSuffixOnClick, id = _a.id, info = _a.info, label = _a.label, max = _a.max, min = _a.min, optional = _a.optional, placeholder = _a.placeholder, prefix = _a.prefix, _e = _a.readOnly, readOnly = _e === void 0 ? false : _e, _f = _a.required, required = _f === void 0 ? false : _f, suffix = _a.suffix, _g = _a.type, type = _g === void 0 ? 'text' : _g, value = _a.value;
10
+ var _b = _a.autoFocus, autoFocus = _b === void 0 ? false : _b, _c = _a.className, className = _c === void 0 ? '' : _c, _d = _a.disabled, disabled = _d === void 0 ? false : _d, error = _a.error, handleOnBlur = _a.handleOnBlur, handleOnChange = _a.handleOnChange, handleOnFocus = _a.handleOnFocus, handleOnKeyDown = _a.handleOnKeyDown, handleSuffixOnClick = _a.handleSuffixOnClick, id = _a.id, info = _a.info, label = _a.label, max = _a.max, min = _a.min, optional = _a.optional, placeholder = _a.placeholder, prefix = _a.prefix, _e = _a.readOnly, readOnly = _e === void 0 ? false : _e, _f = _a.required, required = _f === void 0 ? false : _f, suffix = _a.suffix, _g = _a.type, type = _g === void 0 ? 'text' : _g, value = _a.value;
11
11
  return (react_1.default.createElement("div", null,
12
12
  react_1.default.createElement("div", { className: "flex justify-between" },
13
13
  label && (react_1.default.createElement("div", { className: "mb-2" },
@@ -19,9 +19,9 @@ var VistaTextInputV1 = function (_a) {
19
19
  react_1.default.createElement("div", { className: "relative" },
20
20
  prefix && (react_1.default.createElement("div", { className: "pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3" },
21
21
  react_1.default.createElement("span", { className: "text-gray-500 sm:text-sm" }, prefix))),
22
- react_1.default.createElement("input", { autoComplete: id, className: "block w-full rounded-md border-0 bg-white/5 dark:bg-white/5 py-1.5 text-gray-900 dark:text-white shadow-sm ring-1 ring-inset ring-gray-200 focus:ring-2 focus:ring-inset focus:ring-primary disabled:cursor-not-allowed disabled:bg-gray-50 disabled:text-gray-300 disabled:ring-gray-200 sm:text-sm/6 dark:disabled:bg-gray-800 dark:disabled:text-gray-400 dark:disabled:ring-gray-700 placeholder:text-gray-500 ".concat(prefix && 'pl-7', " ").concat(className), disabled: disabled, id: id, name: id, onChange: function (e) {
22
+ react_1.default.createElement("input", { autoComplete: id, autoFocus: autoFocus, className: "block w-full rounded-md border-0 bg-white/5 dark:bg-white/5 py-1.5 text-gray-900 dark:text-white shadow-sm ring-1 ring-inset ring-gray-200 focus:ring-2 focus:ring-inset focus:ring-primary disabled:cursor-not-allowed disabled:bg-gray-50 disabled:text-gray-300 disabled:ring-gray-200 sm:text-sm/6 dark:disabled:bg-gray-800 dark:disabled:text-gray-400 dark:disabled:ring-gray-700 placeholder:text-gray-500 ".concat(prefix && 'pl-7', " ").concat(className), disabled: disabled, id: id, name: id, onChange: function (e) {
23
23
  return handleOnChange(id, e.target.value);
24
- }, autoFocus: autoFocus, max: max, min: min, onKeyDown: handleOnKeyDown, placeholder: placeholder, readOnly: readOnly, required: required, type: type, value: value }),
24
+ }, max: max, min: min, onBlur: handleOnBlur, onFocus: handleOnFocus, onKeyDown: handleOnKeyDown, placeholder: placeholder, readOnly: readOnly, required: required, type: type, value: value }),
25
25
  suffix && handleSuffixOnClick && (react_1.default.createElement("div", { className: "pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3", onClick: handleSuffixOnClick },
26
26
  react_1.default.createElement("span", { id: "price-currency", className: "text-gray-500 sm:text-sm" }, suffix)))),
27
27
  info && !error && (react_1.default.createElement("p", { id: "".concat(id, "-info"), className: "mt-2 text-sm text-blue-500" }, info)),
@@ -13,7 +13,7 @@ var vista_button_v1_1 = require("../../molecules/vista-button-v1/vista-button-v1
13
13
  var vista_button_type_1 = require("../../type/vista-button-type");
14
14
  var vista_chat_bubble_v1_1 = require("../../molecules/vista-chat-bubble-v1/vista-chat-bubble-v1");
15
15
  var VistaChatV2 = function (_a) {
16
- var actionItems = _a.actionItems, buttonDenominations = _a.buttonDenominations, chatId = _a.chatId, chatValue = _a.chatValue, _b = _a.containerClassName, containerClassName = _b === void 0 ? '' : _b, _c = _a.estimatedBalance, estimatedBalance = _c === void 0 ? '' : _c, handleChatOnChange = _a.handleChatOnChange, handlePayment = _a.handlePayment, isBalanceLow = _a.isBalanceLow, messages = _a.messages, name = _a.name, paymentLoading = _a.paymentLoading, psychic = _a.psychic, sideBarHeading = _a.sideBarHeading, sideBarNode = _a.sideBarNode, timer = _a.timer, typing = _a.typing, user = _a.user;
16
+ var actionItems = _a.actionItems, buttonDenominations = _a.buttonDenominations, chatId = _a.chatId, chatValue = _a.chatValue, _b = _a.containerClassName, containerClassName = _b === void 0 ? '' : _b, _c = _a.estimatedBalance, estimatedBalance = _c === void 0 ? '' : _c, handleChatOnChange = _a.handleChatOnChange, handleOnBlur = _a.handleOnBlur, handleOnFocus = _a.handleOnFocus, handlePayment = _a.handlePayment, isBalanceLow = _a.isBalanceLow, messages = _a.messages, name = _a.name, paymentLoading = _a.paymentLoading, psychic = _a.psychic, sideBarHeading = _a.sideBarHeading, sideBarNode = _a.sideBarNode, timer = _a.timer, typing = _a.typing, user = _a.user;
17
17
  var renderChatMessages = function () {
18
18
  return (react_1.default.createElement("div", { className: 'overflow-y-scroll' }, messages.map((function (_a, ind) {
19
19
  var createdAt = _a.createdAt, id = _a.id, isUser = _a.isUser, message = _a.message;
@@ -40,16 +40,17 @@ var VistaChatV2 = function (_a) {
40
40
  react_1.default.createElement("div", { className: 'pl-4' }, typing && (react_1.default.createElement("p", { className: 'text-xs italic pb-1 text-primary' }, typing))),
41
41
  react_1.default.createElement("div", { className: "flex flex-row items-center gap-4 border-t border-gray-200 p-4" },
42
42
  react_1.default.createElement("div", { className: 'w-full' },
43
- react_1.default.createElement(vista_text_input_v1_1.VistaTextInputV1, { handleOnChange: handleChatOnChange, id: chatId, placeholder: 'Enter message...', value: chatValue, handleOnKeyDown: handleOnKeyDown })),
43
+ react_1.default.createElement(vista_text_input_v1_1.VistaTextInputV1, { handleOnBlur: handleOnBlur, handleOnChange: handleChatOnChange, handleOnFocus: handleOnFocus, handleOnKeyDown: handleOnKeyDown, id: chatId, placeholder: 'Enter message...', value: chatValue })),
44
44
  actionItems
45
+ .slice(0, 2)
45
46
  .filter(function (_a) {
46
47
  var enabled = _a.enabled;
47
48
  return enabled;
48
49
  })
49
50
  .sort(function (a, b) { return a.order - b.order; })
50
51
  .map(function (_a) {
51
- var handleOnClick = _a.handleOnClick, label = _a.label, variant = _a.variant;
52
- return (react_1.default.createElement(vista_button_v1_1.VistaButtonV1, { handleOnClick: handleOnClick, key: label, label: label, size: vista_button_type_1.VISTA_BUTTON_SIZE.LG, variant: variant }));
52
+ var handleOnClick = _a.handleOnClick, label = _a.label, variant = _a.variant, disable = _a.disable;
53
+ return (react_1.default.createElement(vista_button_v1_1.VistaButtonV1, { disabled: disable, handleOnClick: handleOnClick, key: label, label: label, size: vista_button_type_1.VISTA_BUTTON_SIZE.LG, variant: variant }));
53
54
  })))));
54
55
  };
55
56
  exports.VistaChatV2 = VistaChatV2;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appcorp/app-corp-vista",
3
- "version": "0.1.91",
3
+ "version": "0.1.93",
4
4
  "scripts": {
5
5
  "build": "yarn clean && yarn build:ts && cp package.json lib && cp README.md lib",
6
6
  "build:next": "next build",
@@ -14,6 +14,7 @@ export interface VistaChatV1Props {
14
14
  chats: any;
15
15
  }
16
16
  export interface VistaChatV2ActionItem {
17
+ disable: boolean;
17
18
  enabled: boolean;
18
19
  handleOnClick: () => void;
19
20
  label: string;
@@ -46,6 +47,8 @@ export interface VistaChatV2Props {
46
47
  containerClassName?: string;
47
48
  estimatedBalance?: string;
48
49
  handleChatOnChange: (k: string, v: string) => void;
50
+ handleOnBlur?: () => void;
51
+ handleOnFocus?: () => void;
49
52
  handlePayment: (l: string, v: string) => void;
50
53
  isBalanceLow: boolean;
51
54
  messages: VistaChatV2Message[];
@@ -4,7 +4,9 @@ export interface VistaTextInputV1Props {
4
4
  className?: string;
5
5
  disabled?: boolean;
6
6
  error?: string;
7
+ handleOnBlur?: () => void;
7
8
  handleOnChange: (k: string, v: string) => void;
9
+ handleOnFocus?: () => void;
8
10
  handleOnKeyDown?: (e: KeyboardEvent<HTMLInputElement>) => void;
9
11
  handleSuffixOnClick?: () => void;
10
12
  id: string;