@appcorp/app-corp-vista 0.3.30 → 0.3.31

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.
@@ -200,4 +200,5 @@ exports.vistaChatV2Props = {
200
200
  showBanner: true,
201
201
  showControls: true,
202
202
  showLoadMore: true,
203
+ chatIsLoading: true,
203
204
  };
@@ -11,11 +11,14 @@ var vista_chat_bubble_v1_1 = require("../../molecules/vista-chat-bubble-v1/vista
11
11
  var vista_button_v1_1 = require("../../molecules/vista-button-v1/vista-button-v1");
12
12
  var vista_button_type_1 = require("../../type/vista-button-type");
13
13
  var VistaChatMessagesV2 = function (_a) {
14
- var messages = _a.messages, psychic = _a.psychic, user = _a.user, showLoadMore = _a.showLoadMore, handleLoadMore = _a.handleLoadMore;
14
+ var chatIsLoading = _a.chatIsLoading, handleLoadMore = _a.handleLoadMore, messages = _a.messages, psychic = _a.psychic, showLoadMore = _a.showLoadMore, user = _a.user;
15
15
  var lastDate = '';
16
16
  return (react_1.default.createElement("div", { className: "overflow-y-scroll" },
17
17
  showLoadMore && (react_1.default.createElement("div", { className: "flex flex-row justify-center" },
18
- react_1.default.createElement(vista_button_v1_1.VistaButtonV1, { variant: vista_button_type_1.VISTA_BUTTON_VARIANT.SECONDARY, label: "Load Previous Chats...", handleOnClick: handleLoadMore, className: "inline-flex max-w-48" }))),
18
+ react_1.default.createElement(vista_button_v1_1.VistaButtonV1, { variant: chatIsLoading
19
+ ? vista_button_type_1.VISTA_BUTTON_VARIANT.ICON
20
+ : vista_button_type_1.VISTA_BUTTON_VARIANT.SECONDARY, label: chatIsLoading ? '' : 'Load Previous Chats...', handleOnClick: handleLoadMore, className: "inline-flex max-w-48 transition-all duration-1000 !bg-white", icon: react_1.default.createElement("div", { role: "status", className: "h-6 w-6 border-4 border-primary border-t-transparent rounded-full animate-spin" },
21
+ react_1.default.createElement("span", { className: "sr-only" }, "Loading...")) }))),
19
22
  messages.map(function (_a, ind) {
20
23
  var _b, _c;
21
24
  var createdAt = _a.createdAt, id = _a.id, isUser = _a.isUser, message = _a.message, messageStatus = _a.messageStatus;
@@ -13,7 +13,7 @@ var vista_button_type_1 = require("../../type/vista-button-type");
13
13
  var vista_banner_v1_1 = require("../../atoms/vista-banner-v1/vista-banner-v1");
14
14
  var vista_chat_messages_v2_1 = require("./vista-chat-messages-v2");
15
15
  var VistaChatV2 = function (_a) {
16
- var actionItems = _a.actionItems, bannerDescription = _a.bannerDescription, bannerHeading = _a.bannerHeading, 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, handleLoadMore = _a.handleLoadMore, isBalanceLow = _a.isBalanceLow, messages = _a.messages, name = _a.name, paymentLoading = _a.paymentLoading, psychic = _a.psychic, _d = _a.showBanner, showBanner = _d === void 0 ? false : _d, _e = _a.showControls, showControls = _e === void 0 ? true : _e, showLoadMore = _a.showLoadMore, timer = _a.timer, typing = _a.typing, user = _a.user;
16
+ var actionItems = _a.actionItems, bannerDescription = _a.bannerDescription, bannerHeading = _a.bannerHeading, buttonDenominations = _a.buttonDenominations, chatId = _a.chatId, _b = _a.chatIsLoading, chatIsLoading = _b === void 0 ? false : _b, chatValue = _a.chatValue, _c = _a.containerClassName, containerClassName = _c === void 0 ? '' : _c, _d = _a.estimatedBalance, estimatedBalance = _d === void 0 ? '' : _d, handleChatOnChange = _a.handleChatOnChange, handleLoadMore = _a.handleLoadMore, handleOnBlur = _a.handleOnBlur, handleOnFocus = _a.handleOnFocus, handlePayment = _a.handlePayment, isBalanceLow = _a.isBalanceLow, messages = _a.messages, name = _a.name, paymentLoading = _a.paymentLoading, psychic = _a.psychic, _e = _a.showBanner, showBanner = _e === void 0 ? false : _e, _f = _a.showControls, showControls = _f === void 0 ? true : _f, showLoadMore = _a.showLoadMore, timer = _a.timer, typing = _a.typing, user = _a.user;
17
17
  var handleOnKeyDown = function (e) {
18
18
  if (e.key === 'Enter') {
19
19
  actionItems[0].handleOnClick();
@@ -24,7 +24,7 @@ var VistaChatV2 = function (_a) {
24
24
  react_1.default.createElement(vista_chat_heading_v1_1.VistaChatHeadingV1, { estimatedBalance: estimatedBalance, heading: name, timer: timer }),
25
25
  showBanner && (react_1.default.createElement(vista_banner_v1_1.VistaBannerV1, { description: bannerDescription, heading: bannerHeading })),
26
26
  react_1.default.createElement("div", { className: "overflow-y-auto h-full flex flex-col justify-end p-4" },
27
- react_1.default.createElement(vista_chat_messages_v2_1.VistaChatMessagesV2, { messages: messages, psychic: psychic, showLoadMore: showLoadMore, user: user, handleLoadMore: handleLoadMore })),
27
+ react_1.default.createElement(vista_chat_messages_v2_1.VistaChatMessagesV2, { messages: messages, psychic: psychic, showLoadMore: showLoadMore, user: user, handleLoadMore: handleLoadMore, chatIsLoading: chatIsLoading })),
28
28
  isBalanceLow && (react_1.default.createElement("div", { className: "grid grid-cols-5 m-4 p-4 border-2 border-primary border-dashed rounded-md justify-between items-center bg-cyan-200" },
29
29
  react_1.default.createElement("div", { className: "col-span-2" },
30
30
  react_1.default.createElement("p", { className: "text-md font-semibold" }, "You are running out of your Kismaa credits, click one of the buttons to top up your account.")),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appcorp/app-corp-vista",
3
- "version": "0.3.30",
3
+ "version": "0.3.31",
4
4
  "scripts": {
5
5
  "build": "yarn clean && yarn build:ts && cp package.json lib && cp README.md lib && cp yarn.lock lib",
6
6
  "build:next": "next build",
@@ -45,6 +45,7 @@ export interface VistaChatV2Props {
45
45
  bannerHeading: string;
46
46
  buttonDenominations: ButtonDenomination[];
47
47
  chatId: string;
48
+ chatIsLoading?: boolean;
48
49
  chatValue: string;
49
50
  containerClassName?: string;
50
51
  estimatedBalance?: string;
@@ -66,6 +67,7 @@ export interface VistaChatV2Props {
66
67
  user: VistaChatV2User;
67
68
  }
68
69
  export interface VistaChatMessageV2 {
70
+ chatIsLoading: boolean;
69
71
  handleLoadMore: () => void;
70
72
  messages: VistaChatV2Message[];
71
73
  psychic: VistaChatV2Psychic;