@appcorp/app-corp-vista 0.3.16 → 0.3.18

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.
@@ -0,0 +1,3 @@
1
+ import { FC } from 'react';
2
+ import { VistaBannerV1Props } from '../../type/vista-banner-type';
3
+ export declare const VistaBannerV1: FC<VistaBannerV1Props>;
@@ -0,0 +1,32 @@
1
+ 'use client';
2
+ "use strict";
3
+ var __importDefault = (this && this.__importDefault) || function (mod) {
4
+ return (mod && mod.__esModule) ? mod : { "default": mod };
5
+ };
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.VistaBannerV1 = void 0;
8
+ var react_1 = __importDefault(require("react"));
9
+ var outline_1 = require("@heroicons/react/24/outline");
10
+ var VistaBannerV1 = function (_a) {
11
+ var ctaLabel = _a.ctaLabel, description = _a.description, heading = _a.heading, handleCtaOnClick = _a.handleCtaOnClick, handleCrossOnClick = _a.handleCrossOnClick;
12
+ return (react_1.default.createElement("div", { className: "relative isolate flex items-center gap-x-6 overflow-hidden bg-gray-50 px-6 py-2.5 sm:px-3.5 sm:before:flex-1 dark:bg-gray-800/50 dark:after:pointer-events-none dark:after:absolute dark:after:inset-x-0 dark:after:bottom-0 dark:after:h-px dark:after:bg-white/10" },
13
+ react_1.default.createElement("div", { "aria-hidden": "true", className: "absolute top-1/2 left-[max(-7rem,calc(50%-52rem))] -z-10 -translate-y-1/2 transform-gpu blur-2xl" },
14
+ react_1.default.createElement("div", { style: {
15
+ clipPath: 'polygon(74.8% 41.9%, 97.2% 73.2%, 100% 34.9%, 92.5% 0.4%, 87.5% 0%, 75% 28.6%, 58.5% 54.6%, 50.1% 56.8%, 46.9% 44%, 48.3% 17.4%, 24.7% 53.9%, 0% 27.9%, 11.9% 74.2%, 24.9% 54.1%, 68.6% 100%, 74.8% 41.9%)',
16
+ }, className: "aspect-577/310 w-144.25 bg-linear-to-r from-[#ff80b5] to-[#9089fc] opacity-30 dark:opacity-40" })),
17
+ react_1.default.createElement("div", { "aria-hidden": "true", className: "absolute top-1/2 left-[max(45rem,calc(50%+8rem))] -z-10 -translate-y-1/2 transform-gpu blur-2xl" },
18
+ react_1.default.createElement("div", { style: {
19
+ clipPath: 'polygon(74.8% 41.9%, 97.2% 73.2%, 100% 34.9%, 92.5% 0.4%, 87.5% 0%, 75% 28.6%, 58.5% 54.6%, 50.1% 56.8%, 46.9% 44%, 48.3% 17.4%, 24.7% 53.9%, 0% 27.9%, 11.9% 74.2%, 24.9% 54.1%, 68.6% 100%, 74.8% 41.9%)',
20
+ }, className: "aspect-577/310 w-144.25 bg-linear-to-r from-[#ff80b5] to-[#9089fc] opacity-30 dark:opacity-40" })),
21
+ react_1.default.createElement("div", { className: "flex flex-wrap items-center gap-x-4 gap-y-2" },
22
+ react_1.default.createElement("p", { className: "text-sm/6 text-gray-900 dark:text-gray-100" },
23
+ react_1.default.createElement("strong", { className: "font-semibold" }, heading),
24
+ react_1.default.createElement("svg", { viewBox: "0 0 2 2", "aria-hidden": "true", className: "mx-2 inline size-0.5 fill-current" },
25
+ react_1.default.createElement("circle", { r: 1, cx: 1, cy: 1 })),
26
+ description),
27
+ ctaLabel && (react_1.default.createElement("button", { onClick: handleCtaOnClick, className: "flex-none rounded-full bg-primary px-3.5 py-1 text-sm font-semibold text-white shadow-xs hover:bg-primary/70 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gray-900 dark:bg-white/10 dark:inset-ring-white/20 dark:hover:bg-white/15 dark:focus-visible:outline-white" }, ctaLabel))),
28
+ react_1.default.createElement("div", { className: "flex flex-1 justify-end" }, handleCrossOnClick && (react_1.default.createElement("button", { type: "button", className: "-m-3 p-3 focus-visible:-outline-offset-4", onClick: handleCrossOnClick },
29
+ react_1.default.createElement("span", { className: "sr-only" }, "Dismiss"),
30
+ react_1.default.createElement(outline_1.XMarkIcon, { "aria-hidden": "true", className: "size-5 text-gray-900 dark:text-gray-100" }))))));
31
+ };
32
+ exports.VistaBannerV1 = VistaBannerV1;
@@ -1,10 +1,7 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.vistaChatV2Props = exports.vistaChatV1Props = exports.messages = exports.chats = void 0;
7
- var react_1 = __importDefault(require("react"));
4
+ // import React from 'react';
8
5
  var vista_button_type_1 = require("../type/vista-button-type");
9
6
  var vista_chat_type_1 = require("../type/vista-chat-type");
10
7
  exports.chats = [
@@ -117,8 +114,6 @@ exports.vistaChatV2Props = {
117
114
  chatValue: '',
118
115
  containerClassName: '',
119
116
  handleChatOnChange: function () { return void 0; },
120
- sideBarHeading: 'Psychic Tools',
121
- sideBarNode: react_1.default.createElement("p", null, "Hello World"),
122
117
  name: 'John Doe',
123
118
  timer: '00:20',
124
119
  estimatedBalance: '30.00',
@@ -200,4 +195,7 @@ exports.vistaChatV2Props = {
200
195
  handlePayment: function () { return void 0; },
201
196
  isBalanceLow: false,
202
197
  typing: 'Username is typing...',
198
+ bannerHeading: 'Your session has started.',
199
+ bannerDescription: 'Enjoy your conversation.',
200
+ showBanner: true,
203
201
  };
@@ -65,7 +65,7 @@ var VistaChatBubbleV1 = function (_a) {
65
65
  react_1.default.createElement("p", { className: "px-4 pt-2" }, message),
66
66
  react_1.default.createElement("div", { className: "flex items-center px-4 py-2 text-xs justify-between ".concat(isUser ? 'text-right' : 'text-left') },
67
67
  react_1.default.createElement("span", { className: "mr-2" }, (0, format_timestamp_1.formatTimestamp)(createdAt)))),
68
- isUser && (react_1.default.createElement("p", { className: "text-xs font-semibold text-end" }, messageStatus))),
68
+ isUser && (react_1.default.createElement("p", { className: "text-xs text-end" }, messageStatus.toLowerCase()))),
69
69
  react_1.default.createElement("div", { className: "order-1 min-w-10" },
70
70
  react_1.default.createElement(vista_avatar_v1_1.VistaAvatarV1, { alt: isUser ? user.avatarAlt : psychic.avatarAlt, src: isUser ? user.avatarUrl : psychic.avatarUrl }))));
71
71
  };
@@ -1,3 +0,0 @@
1
- import { FC } from 'react';
2
- import { VistaChatV2Props } from '../../type/vista-chat-type';
3
- export declare const VistaChatSideBarV2: FC<Pick<VistaChatV2Props, 'sideBarHeading' | 'sideBarNode'>>;
@@ -1,15 +1,15 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.VistaChatSideBarV2 = void 0;
7
- var react_1 = __importDefault(require("react"));
8
- var vista_chat_heading_v1_1 = require("../vista-chat-heading-v1/vista-chat-heading-v1");
9
- var VistaChatSideBarV2 = function (_a) {
10
- var sideBarHeading = _a.sideBarHeading, sideBarNode = _a.sideBarNode;
11
- return (react_1.default.createElement("div", { className: "col-span-3 flex flex-col border-r border-gray-200 shadow-md" },
12
- react_1.default.createElement(vista_chat_heading_v1_1.VistaChatHeadingV1, { heading: sideBarHeading }),
13
- react_1.default.createElement("div", { className: "divide flex-1 divide-y divide-gray-600 overflow-y-auto" }, sideBarNode)));
14
- };
15
- exports.VistaChatSideBarV2 = VistaChatSideBarV2;
1
+ // import React, { FC } from 'react';
2
+ // import { VistaChatHeadingV1 } from '../vista-chat-heading-v1/vista-chat-heading-v1';
3
+ // import { VistaChatV2Props } from '../../type/vista-chat-type';
4
+ // export const VistaChatSideBarV2: FC<
5
+ // Pick<VistaChatV2Props, 'sideBarHeading' | 'sideBarNode'>
6
+ // > = ({ sideBarHeading, sideBarNode }) => {
7
+ // return (
8
+ // <div className="col-span-3 flex flex-col border-r border-gray-200 shadow-md">
9
+ // <VistaChatHeadingV1 heading={sideBarHeading} />
10
+ // <div className="divide flex-1 divide-y divide-gray-600 overflow-y-auto">
11
+ // {sideBarNode}
12
+ // </div>
13
+ // </div>
14
+ // );
15
+ // };
@@ -7,15 +7,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.VistaChatV2 = void 0;
8
8
  var react_1 = __importDefault(require("react"));
9
9
  var vista_chat_heading_v1_1 = require("../../molecules/vista-chat-heading-v1/vista-chat-heading-v1");
10
- var vista_chat_side_bar_v2_1 = require("../../molecules/vista-chat-side-bar-v2/vista-chat-side-bar-v2");
11
10
  var vista_text_input_v1_1 = require("../../molecules/vista-text-input-v1");
12
11
  var vista_button_v1_1 = require("../../molecules/vista-button-v1/vista-button-v1");
13
12
  var vista_button_type_1 = require("../../type/vista-button-type");
14
13
  var vista_chat_bubble_v1_1 = require("../../molecules/vista-chat-bubble-v1/vista-chat-bubble-v1");
15
14
  var vista_vertical_divider_v1_1 = require("../../molecules/vista-vertical-divider-v1");
16
15
  var util_functions_1 = require("@react-pakistan/util-functions");
16
+ var vista_banner_v1_1 = require("../../atoms/vista-banner-v1/vista-banner-v1");
17
17
  var VistaChatV2 = function (_a) {
18
- 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;
18
+ 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, isBalanceLow = _a.isBalanceLow, messages = _a.messages, name = _a.name, paymentLoading = _a.paymentLoading, psychic = _a.psychic, showBanner = _a.showBanner, timer = _a.timer, typing = _a.typing, user = _a.user;
19
19
  var renderChatMessages = function () {
20
20
  var lastDate = '';
21
21
  return (react_1.default.createElement("div", { className: "overflow-y-scroll" }, messages.map(function (_a, ind) {
@@ -36,10 +36,10 @@ var VistaChatV2 = function (_a) {
36
36
  actionItems[0].handleOnClick();
37
37
  }
38
38
  };
39
- return (react_1.default.createElement("div", { className: "relative h-screen grid grid-cols-12 grid-rows-1 overflow-hidden ".concat(containerClassName) },
40
- react_1.default.createElement(vista_chat_side_bar_v2_1.VistaChatSideBarV2, { sideBarHeading: sideBarHeading, sideBarNode: sideBarNode }),
41
- react_1.default.createElement("section", { className: "col-span-9 flex flex-col" },
42
- react_1.default.createElement(vista_chat_heading_v1_1.VistaChatHeadingV1, { heading: name, timer: timer, estimatedBalance: estimatedBalance }),
39
+ return (react_1.default.createElement("div", { className: "relative h-screen overflow-hidden max-w-7xl mx-auto ".concat(containerClassName) },
40
+ react_1.default.createElement("section", { className: "flex flex-col h-full" },
41
+ react_1.default.createElement(vista_chat_heading_v1_1.VistaChatHeadingV1, { estimatedBalance: estimatedBalance, heading: name, timer: timer }),
42
+ showBanner && (react_1.default.createElement(vista_banner_v1_1.VistaBannerV1, { description: bannerDescription, heading: bannerHeading })),
43
43
  react_1.default.createElement("div", { className: "overflow-y-auto h-full flex flex-col justify-end p-4" }, renderChatMessages()),
44
44
  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" },
45
45
  react_1.default.createElement("div", { className: "col-span-2" },
@@ -51,7 +51,7 @@ var VistaChatV2 = function (_a) {
51
51
  react_1.default.createElement("div", { className: "pl-4" }, typing && (react_1.default.createElement("p", { className: "text-xs italic pb-1 text-primary" }, typing))),
52
52
  react_1.default.createElement("div", { className: "flex flex-row items-center gap-4 border-t border-gray-200 p-4" },
53
53
  react_1.default.createElement("div", { className: "w-full" },
54
- 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 })),
54
+ react_1.default.createElement(vista_text_input_v1_1.VistaTextInputV1, { handleOnBlur: handleOnBlur, handleOnChange: handleChatOnChange, handleOnFocus: handleOnFocus, handleOnKeyDown: handleOnKeyDown, id: chatId, placeholder: "Message ".concat(name, "..."), value: chatValue })),
55
55
  actionItems
56
56
  .slice(0, 2)
57
57
  .filter(function (_a) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appcorp/app-corp-vista",
3
- "version": "0.3.16",
3
+ "version": "0.3.18",
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",
@@ -0,0 +1,7 @@
1
+ export interface VistaBannerV1Props {
2
+ ctaLabel?: string;
3
+ description?: string;
4
+ handleCrossOnClick?: () => void;
5
+ handleCtaOnClick?: () => void;
6
+ heading?: string;
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,4 +1,3 @@
1
- import { ReactNode } from 'react';
2
1
  import { VISTA_BUTTON_VARIANT } from './vista-button-type';
3
2
  export declare enum VISTA_CHAT_BUBBLE_TYPES {
4
3
  PSYCHIC = "PSYCHIC",
@@ -42,6 +41,8 @@ export interface ButtonDenomination {
42
41
  }
43
42
  export interface VistaChatV2Props {
44
43
  actionItems: VistaChatV2ActionItem[];
44
+ bannerDescription: string;
45
+ bannerHeading: string;
45
46
  buttonDenominations: ButtonDenomination[];
46
47
  chatId: string;
47
48
  chatValue: string;
@@ -56,8 +57,7 @@ export interface VistaChatV2Props {
56
57
  name: string;
57
58
  paymentLoading: string;
58
59
  psychic: VistaChatV2Psychic;
59
- sideBarHeading: string;
60
- sideBarNode: ReactNode;
60
+ showBanner: boolean;
61
61
  timer: string;
62
62
  typing?: string;
63
63
  user: VistaChatV2User;