@axos-web-dev/shared-components 2.2.5 → 2.2.7-2

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.
Files changed (200) hide show
  1. package/dist/ATMLocator/ATMLocator.d.ts +1 -1
  2. package/dist/ATMLocator/ATMLocator.js +1 -0
  3. package/dist/Accordion/Accordion.d.ts +3 -3
  4. package/dist/Article/Article.d.ts +1 -1
  5. package/dist/Auth/ErrorAlert.d.ts +1 -1
  6. package/dist/Auth/ErrorAlert.js +1 -0
  7. package/dist/Auth/Logout.d.ts +1 -1
  8. package/dist/Auth/SignInPassword.d.ts +1 -1
  9. package/dist/BulletItem/BulletItem.d.ts +1 -1
  10. package/dist/Button/Button.d.ts +1 -1
  11. package/dist/Button/Button.js +1 -0
  12. package/dist/Button/GoBackButton.d.ts +1 -1
  13. package/dist/Calculators/Calculator.d.ts +1 -1
  14. package/dist/Calculators/Calculator.js +2 -1
  15. package/dist/Calculators/MarginTradingCalculator/index.js +1 -0
  16. package/dist/Carousel/index.d.ts +3 -3
  17. package/dist/Carousel/index.js +1 -0
  18. package/dist/Chatbot/AudioManager.d.ts +19 -0
  19. package/dist/Chatbot/AudioManager.js +61 -0
  20. package/dist/Chatbot/Bubble.d.ts +1 -1
  21. package/dist/Chatbot/ChatWindow.css.d.ts +2 -0
  22. package/dist/Chatbot/ChatWindow.css.js +34 -30
  23. package/dist/Chatbot/ChatWindow.js +382 -363
  24. package/dist/Chatbot/Chatbot.d.ts +4 -1
  25. package/dist/Chatbot/Chatbot.js +24 -1
  26. package/dist/Chatbot/EllipsisAnimation.d.ts +1 -1
  27. package/dist/Chatbot/EllipsisIcon.d.ts +1 -1
  28. package/dist/Chatbot/ExpandChatToggle.d.ts +8 -0
  29. package/dist/Chatbot/ExpandChatToggle.js +74 -0
  30. package/dist/Chatbot/index.js +5 -2
  31. package/dist/Chatbot/store/chat.d.ts +8 -0
  32. package/dist/Chatbot/store/chat.js +14 -2
  33. package/dist/Chevron/index.js +1 -0
  34. package/dist/Comparison/Comparison.d.ts +1 -1
  35. package/dist/Comparison/Comparison.js +1 -0
  36. package/dist/Comparison/ComparisonSet.d.ts +1 -1
  37. package/dist/ExecutiveBio/ExecutiveBio.d.ts +1 -1
  38. package/dist/ExecutiveBio/ExecutiveBio.js +1 -0
  39. package/dist/ExecutiveBio/ExecutiveBioSet.d.ts +1 -1
  40. package/dist/ExecutiveBio/Overlay.d.ts +1 -1
  41. package/dist/FaqAccordion/index.d.ts +5 -5
  42. package/dist/FaqAccordion/index.js +1 -0
  43. package/dist/FdicCallout/index.d.ts +1 -1
  44. package/dist/FooterDisclosure/FooterDisclosure.d.ts +4 -4
  45. package/dist/FooterDisclosure/LVF/LaVictorieFooter.d.ts +1 -1
  46. package/dist/FooterSiteMap/AxosBank/FooterSiteMap.d.ts +1 -1
  47. package/dist/FooterSiteMap/AxosBank/FooterSiteMap.js +1 -0
  48. package/dist/Forms/ApplicationStart.d.ts +1 -1
  49. package/dist/Forms/ApplyNow.d.ts +1 -1
  50. package/dist/Forms/ApplyNow.js +1 -0
  51. package/dist/Forms/BoatMooringLocation.d.ts +1 -1
  52. package/dist/Forms/ClearingForm.d.ts +1 -1
  53. package/dist/Forms/CommercialDeposits.d.ts +1 -1
  54. package/dist/Forms/CommercialDepositsNoLendingOption.d.ts +1 -1
  55. package/dist/Forms/CommercialLending.d.ts +1 -1
  56. package/dist/Forms/CommercialPremiumFinance.d.ts +1 -1
  57. package/dist/Forms/ConstructionLendingDynamic.d.ts +1 -1
  58. package/dist/Forms/ContactCompany.d.ts +1 -1
  59. package/dist/Forms/ContactCompanyTitle.d.ts +1 -1
  60. package/dist/Forms/ContactUs.d.ts +1 -1
  61. package/dist/Forms/ContactUsAAS.d.ts +1 -1
  62. package/dist/Forms/ContactUsBusiness.d.ts +1 -1
  63. package/dist/Forms/ContactUsBusiness.js +1 -0
  64. package/dist/Forms/ContactUsBusinessNameEmail.d.ts +1 -1
  65. package/dist/Forms/ContactUsBusinessNameEmail.js +1 -0
  66. package/dist/Forms/ContactUsLVF.d.ts +1 -1
  67. package/dist/Forms/ContactUsNMLSId.d.ts +1 -1
  68. package/dist/Forms/ContactUsNMLSId.js +1 -0
  69. package/dist/Forms/ContactUsSchwabAAS.d.ts +1 -1
  70. package/dist/Forms/CpraRequest.d.ts +1 -1
  71. package/dist/Forms/CpraRequest.js +1 -0
  72. package/dist/Forms/CraPublicFile.d.ts +1 -1
  73. package/dist/Forms/CraPublicFile.js +1 -0
  74. package/dist/Forms/DealerServices.d.ts +1 -1
  75. package/dist/Forms/EmailOnly.d.ts +1 -1
  76. package/dist/Forms/EmailOnly.js +1 -0
  77. package/dist/Forms/EmailUs.d.ts +1 -1
  78. package/dist/Forms/HoneyPot/index.d.ts +1 -1
  79. package/dist/Forms/MortgageRate/MortgageRateForm.d.ts +1 -1
  80. package/dist/Forms/MortgageRate/MortgageRateForm.js +1 -0
  81. package/dist/Forms/MortgageRate/MortgageRateQuoteFilters.d.ts +1 -1
  82. package/dist/Forms/MortgageRate/MortgageRateWatch.d.ts +1 -1
  83. package/dist/Forms/MortgageRate/MortgageRateWatch.js +1 -0
  84. package/dist/Forms/MortgageWarehouseLending.d.ts +2 -2
  85. package/dist/Forms/MortgageWarehouseLending.js +8 -7
  86. package/dist/Forms/QuickPricer/QuickPricerForm.d.ts +1 -1
  87. package/dist/Forms/QuickPricer/UserInformation.d.ts +1 -1
  88. package/dist/Forms/ScheduleCall.d.ts +1 -1
  89. package/dist/Forms/ScheduleCallPremier.d.ts +1 -1
  90. package/dist/Forms/SuccesForm.d.ts +1 -1
  91. package/dist/Forms/SuccesForm.js +2 -1
  92. package/dist/Forms/VendorQuestionnaire.d.ts +1 -1
  93. package/dist/Forms/WcplSurvey.d.ts +1 -1
  94. package/dist/HeroBanner/HeroBanner.d.ts +1 -1
  95. package/dist/HeroBanner/HeroVideoPoster.d.ts +1 -1
  96. package/dist/HeroBanner/LargeHeroBanner.d.ts +1 -1
  97. package/dist/Hyperlink/index.js +1 -0
  98. package/dist/IconBillboard/IconBillboard.d.ts +1 -1
  99. package/dist/IconBillboard/IconBillboardSet.d.ts +1 -1
  100. package/dist/IconBillboard/sections/CallToActionSection.d.ts +1 -1
  101. package/dist/IconBillboard/sections/HeaderSection.d.ts +2 -2
  102. package/dist/IconBillboard/sections/IconSection.d.ts +1 -1
  103. package/dist/IconBillboard/sections/ItemsSection.d.ts +1 -1
  104. package/dist/IconBillboard/sections/LayoutSection.d.ts +1 -1
  105. package/dist/ImageBillboard/ExitIntentModal/ModalWrapper.d.ts +1 -1
  106. package/dist/ImageBillboard/ImageBillboard.d.ts +1 -1
  107. package/dist/ImageBillboard/ImageBillboardSet.d.ts +1 -1
  108. package/dist/ImageLink/ImageLink.d.ts +1 -1
  109. package/dist/ImageLink/ImageLink.js +1 -0
  110. package/dist/ImageLink/ImageLinkSet.d.ts +1 -1
  111. package/dist/ImageLink/ImageLinkSet.js +1 -0
  112. package/dist/ImageLink/index.js +1 -0
  113. package/dist/ImageWrapper/ImageWrapper.d.ts +1 -1
  114. package/dist/Insight/Featured/CategorySelector.d.ts +2 -2
  115. package/dist/Insight/Featured/CategorySelector.js +1 -0
  116. package/dist/Insight/Featured/Featured.d.ts +2 -2
  117. package/dist/Insight/Featured/Featured.js +1 -0
  118. package/dist/Insight/Featured/Header.d.ts +1 -1
  119. package/dist/Insight/Featured/Header.js +1 -0
  120. package/dist/LandingPageHeader/LandingPageHeader.d.ts +1 -1
  121. package/dist/LoadingIndicator/index.d.ts +1 -1
  122. package/dist/MainHTML/index.d.ts +1 -1
  123. package/dist/Modal/Modal.js +1 -0
  124. package/dist/Modal/contextApi/store.d.ts +1 -4
  125. package/dist/Modal/contextApi/store.js +34 -3
  126. package/dist/NavigationMenu/AxosALTS/index.d.ts +1 -1
  127. package/dist/NavigationMenu/AxosALTS/index.js +1 -0
  128. package/dist/NavigationMenu/AxosAdvisor/SubNavBar.d.ts +1 -1
  129. package/dist/NavigationMenu/AxosAdvisor/index.d.ts +1 -1
  130. package/dist/NavigationMenu/AxosAdvisorServices/SubNavBar.d.ts +1 -1
  131. package/dist/NavigationMenu/AxosAdvisorServices/index.d.ts +1 -1
  132. package/dist/NavigationMenu/AxosBank/MobileMenu/MobileMenu.d.ts +1 -1
  133. package/dist/NavigationMenu/AxosBank/MobileMenu/MobileMenu.js +1 -0
  134. package/dist/NavigationMenu/AxosBank/SubNavBar.d.ts +1 -1
  135. package/dist/NavigationMenu/AxosBank/SubNavBar.js +1 -0
  136. package/dist/NavigationMenu/AxosBank/index.d.ts +1 -1
  137. package/dist/NavigationMenu/AxosBank/index.js +2 -0
  138. package/dist/NavigationMenu/AxosClearing/SubNavBar.d.ts +1 -1
  139. package/dist/NavigationMenu/AxosClearing/index.d.ts +1 -1
  140. package/dist/NavigationMenu/AxosFiduciary/index.d.ts +1 -1
  141. package/dist/NavigationMenu/LaVictoire/SubNavBar.d.ts +1 -1
  142. package/dist/NavigationMenu/LaVictoire/index.d.ts +1 -1
  143. package/dist/NavigationMenu/LaVictoire/index.js +1 -0
  144. package/dist/NavigationMenu/NavItem/index.d.ts +1 -1
  145. package/dist/NavigationMenu/Navbar.d.ts +1 -1
  146. package/dist/NavigationMenu/Navbar.js +1 -0
  147. package/dist/NavigationMenu/SignInNavButton.d.ts +1 -3
  148. package/dist/NavigationMenu/SignInNavButton.js +2 -0
  149. package/dist/Pagination/Pagination.d.ts +1 -1
  150. package/dist/SecondaryFooter/index.d.ts +1 -1
  151. package/dist/SetContainer/SetContainer.d.ts +1 -1
  152. package/dist/SetContainer/SetContainer.js +1 -0
  153. package/dist/SocialMediaBar/iconsRepository.d.ts +14 -14
  154. package/dist/SocialMediaBar/iconsRepository.js +1 -0
  155. package/dist/SocialMediaBar/index.d.ts +1 -1
  156. package/dist/Tab/Tab.d.ts +1 -1
  157. package/dist/Tab/TabContainer.d.ts +1 -1
  158. package/dist/Table/Table.d.ts +5 -5
  159. package/dist/TextBlock/TextBlock.d.ts +1 -1
  160. package/dist/Topic/Topic.d.ts +4 -4
  161. package/dist/VideoTile/VideoInit.d.ts +1 -1
  162. package/dist/VideoTile/VideoTile.js +1 -0
  163. package/dist/VideoWrapper/index.js +1 -0
  164. package/dist/WalnutIframe/index.d.ts +1 -1
  165. package/dist/assets/Chatbot/ChatWindow.css +69 -57
  166. package/dist/assets/globals.css +3 -0
  167. package/dist/assets/notification.mp3.js +4 -0
  168. package/dist/icons/AxosX/Blue.d.ts +1 -1
  169. package/dist/icons/AxosX/index.d.ts +1 -1
  170. package/dist/icons/CheckCircle.d.ts +1 -1
  171. package/dist/icons/CheckCircleLight.d.ts +1 -1
  172. package/dist/icons/CheckIcon/index.d.ts +1 -1
  173. package/dist/icons/ChevronDown.d.ts +1 -1
  174. package/dist/icons/ChevronUp.d.ts +1 -1
  175. package/dist/icons/Clock/index.d.ts +1 -1
  176. package/dist/icons/EqualHousingLender.d.ts +1 -1
  177. package/dist/icons/Logos/AAS.d.ts +1 -1
  178. package/dist/icons/Logos/AFS.d.ts +1 -1
  179. package/dist/icons/Logos/AXA.d.ts +1 -1
  180. package/dist/icons/Logos/AXB.d.ts +1 -1
  181. package/dist/icons/Logos/AXC.d.ts +1 -1
  182. package/dist/icons/Logos/AXI.d.ts +1 -1
  183. package/dist/icons/Logos/AXOS.d.ts +1 -1
  184. package/dist/icons/Logos/GBLVF.d.ts +1 -1
  185. package/dist/icons/Logos/LVF.d.ts +1 -1
  186. package/dist/icons/Logos/LVFText.d.ts +1 -1
  187. package/dist/icons/Logos/SPB.d.ts +1 -1
  188. package/dist/icons/MemberFdicLogo.d.ts +1 -1
  189. package/dist/icons/QuoteIconGrey.d.ts +1 -1
  190. package/dist/icons/QuoteIconWhite.d.ts +1 -1
  191. package/dist/icons/QuoteIconYellow.d.ts +1 -1
  192. package/dist/main.js +5 -2
  193. package/dist/utils/useVisibility.d.ts +1 -0
  194. package/dist/utils/useVisibility.js +18 -0
  195. package/dist/vite-env.d.js +1 -0
  196. package/package.json +147 -147
  197. package/dist/Chatbot/Chat.d.ts +0 -1
  198. package/dist/Chatbot/Chat.js +0 -158
  199. package/dist/Chatbot/useHeadlessChat.d.ts +0 -27
  200. package/dist/Chatbot/useHeadlessChat.js +0 -240
@@ -2,5 +2,5 @@ import { SVGProps } from 'react';
2
2
 
3
3
  declare const SvgComponent: (props: SVGProps<SVGSVGElement> & {
4
4
  classNameFill?: string;
5
- }) => import("react").JSX.Element;
5
+ }) => import("react/jsx-runtime").JSX.Element;
6
6
  export default SvgComponent;
@@ -2,5 +2,5 @@ import { SVGProps } from 'react';
2
2
 
3
3
  declare const SvgComponent: (props: SVGProps<SVGSVGElement> & {
4
4
  classNameFill?: string;
5
- }) => import("react").JSX.Element;
5
+ }) => import("react/jsx-runtime").JSX.Element;
6
6
  export default SvgComponent;
@@ -2,5 +2,5 @@ import { SVGProps } from 'react';
2
2
 
3
3
  declare const SvgComponent: (props: SVGProps<SVGSVGElement> & {
4
4
  classNameFill?: string;
5
- }) => import("react").JSX.Element;
5
+ }) => import("react/jsx-runtime").JSX.Element;
6
6
  export default SvgComponent;
@@ -1,4 +1,4 @@
1
1
  import { SVGProps } from 'react';
2
2
 
3
- declare const SvgComponent: (props: SVGProps<SVGSVGElement>) => import("react").JSX.Element;
3
+ declare const SvgComponent: (props: SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
4
4
  export default SvgComponent;
@@ -2,5 +2,5 @@ import { SVGProps } from 'react';
2
2
 
3
3
  declare const SvgComponent: (props: SVGProps<SVGSVGElement> & {
4
4
  classNameFill?: string;
5
- }) => import("react").JSX.Element;
5
+ }) => import("react/jsx-runtime").JSX.Element;
6
6
  export default SvgComponent;
@@ -1,4 +1,4 @@
1
1
  import { SVGProps } from 'react';
2
2
 
3
- declare const SvgComponent: (props: SVGProps<SVGSVGElement>) => import("react").JSX.Element;
3
+ declare const SvgComponent: (props: SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
4
4
  export default SvgComponent;
@@ -1,4 +1,4 @@
1
1
  import { SVGProps } from 'react';
2
2
 
3
- declare const SvgComponent: (props: SVGProps<SVGSVGElement>) => import("react").JSX.Element;
3
+ declare const SvgComponent: (props: SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
4
4
  export default SvgComponent;
@@ -1,4 +1,4 @@
1
1
  import { SVGProps } from 'react';
2
2
 
3
- declare const SvgMemberFdicLogo: (props: SVGProps<SVGSVGElement>) => import("react").JSX.Element;
3
+ declare const SvgMemberFdicLogo: (props: SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
4
4
  export default SvgMemberFdicLogo;
@@ -1,4 +1,4 @@
1
1
  import { SVGProps } from 'react';
2
2
 
3
- declare const SvgQuoteIconGrey: (props: SVGProps<SVGSVGElement>) => import("react").JSX.Element;
3
+ declare const SvgQuoteIconGrey: (props: SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
4
4
  export default SvgQuoteIconGrey;
@@ -1,4 +1,4 @@
1
1
  import { SVGProps } from 'react';
2
2
 
3
- declare const SvgQuoteIconWhite: (props: SVGProps<SVGSVGElement>) => import("react").JSX.Element;
3
+ declare const SvgQuoteIconWhite: (props: SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
4
4
  export default SvgQuoteIconWhite;
@@ -1,4 +1,4 @@
1
1
  import { SVGProps } from 'react';
2
2
 
3
- declare const SvgQuoteIconYellow: (props: SVGProps<SVGSVGElement>) => import("react").JSX.Element;
3
+ declare const SvgQuoteIconYellow: (props: SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
4
4
  export default SvgQuoteIconYellow;
package/dist/main.js CHANGED
@@ -39,10 +39,10 @@ import { CallToActionBar } from "./CallToActionBar/index.js";
39
39
  import { Carousel, CarouselSlide } from "./Carousel/index.js";
40
40
  import { Bubble } from "./Chatbot/Bubble.js";
41
41
  import { borderHoverGradient, bubbleButton, bubbleText, bubbleWrapper, inner, svgFill } from "./Chatbot/Bubble.css.js";
42
- import { Chatbot } from "./Chatbot/Chatbot.js";
42
+ import { Chatbot, audioManager } from "./Chatbot/Chatbot.js";
43
43
  import { chatbotAXB, chatbotUFB } from "./Chatbot/Chatbot.css.js";
44
44
  import { ChatWindow } from "./Chatbot/ChatWindow.js";
45
- import { agent_msg, arrowFill, autoResize, button_bar, button_reset, buttonss_section, chatEndCircle, chatEndDialogOverlay, chatFinishDialog, chatNetworkStatus, chat_title, chatbotMenu, chatbotMenuItem, endChatButtonStyle, inline_button, inline_button_wrapper, inputStyle, left_bar_section, messageStyle, messagesContainerStyle, noAnswerButton, notificationStyle, sendButtonStyle, shimmerText, thankyou_image, thankyou_message, thankyou_overlay, user_msg, windowBarStyle, windowOpenStyle, windowStyle } from "./Chatbot/ChatWindow.css.js";
45
+ import { agent_msg, arrowFill, autoResize, button_bar, button_reset, buttonss_section, chatEndCircle, chatEndDialogOverlay, chatFinishDialog, chatNetworkStatus, chat_title, chatbotMenu, chatbotMenuItem, endChatButtonStyle, expandToggleStyle, inline_button, inline_button_wrapper, inputStyle, left_bar_section, messageStyle, messagesContainerStyle, noAnswerButton, notificationStyle, sendButtonStyle, shimmerText, thankyou_image, thankyou_message, thankyou_overlay, user_msg, windowBarStyle, windowExpandedStyle, windowOpenStyle, windowStyle } from "./Chatbot/ChatWindow.css.js";
46
46
  import { useOpenChat } from "./Chatbot/store/chat.js";
47
47
  import { useMessages } from "./Chatbot/store/messages.js";
48
48
  import { Chevron } from "./Chevron/index.js";
@@ -442,6 +442,7 @@ export {
442
442
  article_share_svg,
443
443
  article_spacer,
444
444
  associatedEmail,
445
+ audioManager,
445
446
  autoResize,
446
447
  award_company,
447
448
  award_item,
@@ -558,6 +559,7 @@ export {
558
559
  executive_bio,
559
560
  exit_intent,
560
561
  exit_intent_backdrop,
562
+ expandToggleStyle,
561
563
  expand_icon,
562
564
  fadeInUp,
563
565
  feature_header,
@@ -859,6 +861,7 @@ export {
859
861
  vidyard_height,
860
862
  w_100,
861
863
  windowBarStyle,
864
+ windowExpandedStyle,
862
865
  windowOpenStyle,
863
866
  windowStyle,
864
867
  wrapper,
@@ -0,0 +1 @@
1
+ export declare function usePageVisibility(): boolean;
@@ -0,0 +1,18 @@
1
+ "use client";
2
+ import { useState, useEffect } from "react";
3
+ function usePageVisibility() {
4
+ const [isVisible, setIsVisible] = useState(!document.hidden);
5
+ useEffect(() => {
6
+ const handleVisibilityChange = () => {
7
+ setIsVisible(!document.hidden);
8
+ };
9
+ document.addEventListener("visibilitychange", handleVisibilityChange);
10
+ return () => {
11
+ document.removeEventListener("visibilitychange", handleVisibilityChange);
12
+ };
13
+ }, []);
14
+ return isVisible;
15
+ }
16
+ export {
17
+ usePageVisibility
18
+ };
@@ -0,0 +1 @@
1
+
package/package.json CHANGED
@@ -1,147 +1,147 @@
1
- {
2
- "name": "@axos-web-dev/shared-components",
3
- "description": "Axos shared components library for web.",
4
- "version": "2.2.5",
5
- "type": "module",
6
- "main": "dist/main.js",
7
- "module": "dist/main.js",
8
- "types": "dist/main.d.ts",
9
- "exports": {
10
- ".": {
11
- "types": "./dist/main.d.ts",
12
- "import": "./dist/main.js"
13
- },
14
- "./styles.css": "./dist/assets/index.css",
15
- "./globals.css": "./dist/assets/globals.css",
16
- "./themes/axos.css": "./dist/assets/themes/axos.css",
17
- "./themes/premier.css": "./dist/assets/themes/premier.css",
18
- "./dist/*": "./dist/*"
19
- },
20
- "files": [
21
- "dist"
22
- ],
23
- "sideEffects": [
24
- "dist/assets/**/*.css"
25
- ],
26
- "scripts": {
27
- "dev": "vite",
28
- "build": "tsc --p ./tsconfig.build.json && vite build",
29
- "lint": "eslint . --report-unused-disable-directives --max-warnings 0",
30
- "preview": "vite preview",
31
- "prepublishOnly": "npm run build",
32
- "check-types": "tsc --pretty --noEmit",
33
- "check-format": "prettier --check .",
34
- "check-lint": "eslint .",
35
- "format": "prettier --write .",
36
- "test-all": "npm run check-format && npm run check-lint && npm run check-types && npm run build",
37
- "prepare": "npm run build",
38
- "storybook": "storybook dev -p 6006",
39
- "build-storybook": "storybook build",
40
- "npm:link": "npm run build && npm link"
41
- },
42
- "dependencies": {
43
- "@headlessui/react": "^2.2.0",
44
- "@hookform/resolvers": "^5.0.1",
45
- "@next-safe-action/adapter-react-hook-form": "^2.0.2",
46
- "@react-input/mask": "^1.2.15",
47
- "@react-input/number-format": "^1.1.3",
48
- "@storybook/icons": "^1.3.0",
49
- "@storybook/preview-api": "^8.4.7",
50
- "@ts-stack/markdown": "^1.5.0",
51
- "@types/iframe-resizer": "3.5.13",
52
- "@ujet/websdk-headless": "^3.41.4",
53
- "@vanilla-extract/css": "^1.16.1",
54
- "@vanilla-extract/recipes": "^0.5.1 || ^0.5.5",
55
- "antd": "^5.22.5",
56
- "clsx": "^2.1.1",
57
- "framer-motion": "^12.9.2",
58
- "iframe-resizer": "^3.6.6",
59
- "lodash": "^4.17.21",
60
- "moment": "^2.30.1",
61
- "next-safe-action": "^8.0.2",
62
- "react-date-picker": "^11.0.0",
63
- "react-date-range": "^2.0.1",
64
- "react-hook-form": "^7.56.4",
65
- "react-markdown": "^9.1.0",
66
- "react-slick": "^0.30.2",
67
- "react-use": "^17.6.0",
68
- "react-wrap-balancer": "^1.1.1",
69
- "remark-gfm": "^4.0.1",
70
- "rsuite": "^5.75.0",
71
- "slick-carousel": "^1.8.1",
72
- "typed-css-modules": "^0.9.1",
73
- "vite-plugin-svgr": "^4.3.0",
74
- "zod": "^3.24.1",
75
- "zustand": "^4.5.5"
76
- },
77
- "peerDependencies": {
78
- "@vanilla-extract/css-utils": "^0.1.3 || ^0.1.4",
79
- "@vanilla-extract/recipes": "^0.5.1 || ^0.5.5",
80
- "next": "^14.1.4 || ^15.0.0 || ^16.0.0",
81
- "react": "^18.2.0 || ^19.0.0",
82
- "react-date-range": "^2.0.1",
83
- "react-dom": "^18.2.0 || ^19.0.0",
84
- "react-slick": "^0.30.2",
85
- "slick-carousel": "^1.8.1"
86
- },
87
- "devDependencies": {
88
- "@chromatic-com/storybook": "^1.9.0",
89
- "@eslint/js": "^9.39.4",
90
- "@rollup/plugin-alias": "^5.1.1",
91
- "@storybook/addon-essentials": "^8.4.7",
92
- "@storybook/addon-interactions": "^8.4.7",
93
- "@storybook/addon-links": "^8.4.7",
94
- "@storybook/addon-mdx-gfm": "^8.4.7",
95
- "@storybook/addon-onboarding": "^8.4.7",
96
- "@storybook/addon-themes": "^8.4.7",
97
- "@storybook/blocks": "^8.4.7",
98
- "@storybook/react": "^8.6.14",
99
- "@storybook/react-vite": "^8.4.7",
100
- "@storybook/test": "^8.6.14",
101
- "@svgr/core": "^8.1.0",
102
- "@svgr/plugin-prettier": "^8.1.0",
103
- "@svgr/plugin-svgo": "^8.1.0",
104
- "@types/lodash": "^4.17.17",
105
- "@types/node": "^20.19.0",
106
- "@types/react": "^19.0.0",
107
- "@types/react-date-range": "^1.4.9",
108
- "@types/react-datepicker": "^6.2.0",
109
- "@types/react-dom": "^19.0.0",
110
- "@types/react-slick": "^0.23.13",
111
- "@typescript-eslint/eslint-plugin": "^8.0.0",
112
- "@typescript-eslint/parser": "^8.0.0",
113
- "@vanilla-extract/css-utils": "^0.1.4",
114
- "@vanilla-extract/recipes": "^0.5.5",
115
- "@vanilla-extract/vite-plugin": "^4.0.18",
116
- "@vitejs/plugin-react-swc": "^3.7.2",
117
- "esbuild-vanilla-image-loader": "^0.1.3",
118
- "eslint": "^9.0.0",
119
- "eslint-plugin-react-hooks": "^5.1.0",
120
- "eslint-plugin-react-refresh": "^0.4.16",
121
- "eslint-plugin-storybook": "^0.8.0",
122
- "glob": "^10.4.5",
123
- "globals": "^15.15.0",
124
- "husky": "^9.1.7",
125
- "next": "^16.0.0",
126
- "prettier": "3.2.5",
127
- "react": "^19.0.0",
128
- "react-dom": "^19.0.0",
129
- "rollup-plugin-preserve-directives": "^0.4.0",
130
- "rollup-plugin-svg-import": "^3.0.0",
131
- "rollup-plugin-svgo": "^2.0.0",
132
- "storybook": "^8.4.7",
133
- "typescript": "^5.7.2",
134
- "typescript-eslint": "^8.57.0",
135
- "typescript-plugin-css-modules": "^5.1.0",
136
- "vite": "^5.4.11",
137
- "vite-plugin-dts": "^3.9.1",
138
- "vite-plugin-lib-inject-css": "^2.1.1",
139
- "vite-plugin-setting-css-module": "^1.1.4",
140
- "vite-tsconfig-paths": "^4.3.2"
141
- },
142
- "directories": {
143
- "lib": "lib"
144
- },
145
- "author": "axos-web-dev",
146
- "license": "ISC"
147
- }
1
+ {
2
+ "name": "@axos-web-dev/shared-components",
3
+ "description": "Axos shared components library for web.",
4
+ "version": "2.2.7-2",
5
+ "type": "module",
6
+ "main": "dist/main.js",
7
+ "module": "dist/main.js",
8
+ "types": "dist/main.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/main.d.ts",
12
+ "import": "./dist/main.js"
13
+ },
14
+ "./styles.css": "./dist/assets/index.css",
15
+ "./globals.css": "./dist/assets/globals.css",
16
+ "./themes/axos.css": "./dist/assets/themes/axos.css",
17
+ "./themes/premier.css": "./dist/assets/themes/premier.css",
18
+ "./dist/*": "./dist/*"
19
+ },
20
+ "files": [
21
+ "dist"
22
+ ],
23
+ "sideEffects": [
24
+ "dist/assets/**/*.css"
25
+ ],
26
+ "scripts": {
27
+ "dev": "vite",
28
+ "build": "tsc --p ./tsconfig.build.json && vite build",
29
+ "lint": "eslint . --report-unused-disable-directives --max-warnings 0",
30
+ "preview": "vite preview",
31
+ "prepublishOnly": "npm run build",
32
+ "check-types": "tsc --pretty --noEmit",
33
+ "check-format": "prettier --check .",
34
+ "check-lint": "eslint .",
35
+ "format": "prettier --write .",
36
+ "test-all": "npm run check-format && npm run check-lint && npm run check-types && npm run build",
37
+ "prepare": "npm run build",
38
+ "storybook": "storybook dev -p 6006",
39
+ "build-storybook": "storybook build",
40
+ "npm:link": "npm run build && npm link"
41
+ },
42
+ "dependencies": {
43
+ "@headlessui/react": "^2.2.0",
44
+ "@hookform/resolvers": "^5.0.1",
45
+ "@next-safe-action/adapter-react-hook-form": "^2.0.2",
46
+ "@react-input/mask": "^1.2.15",
47
+ "@react-input/number-format": "^1.1.3",
48
+ "@storybook/icons": "^1.3.0",
49
+ "@storybook/preview-api": "^8.4.7",
50
+ "@ts-stack/markdown": "^1.5.0",
51
+ "@types/iframe-resizer": "3.5.13",
52
+ "@ujet/websdk-headless": "^3.41.4",
53
+ "@vanilla-extract/css": "^1.16.1",
54
+ "@vanilla-extract/recipes": "^0.5.1 || ^0.5.5",
55
+ "antd": "^5.22.5",
56
+ "clsx": "^2.1.1",
57
+ "framer-motion": "^12.9.2",
58
+ "iframe-resizer": "^3.6.6",
59
+ "lodash": "^4.17.21",
60
+ "moment": "^2.30.1",
61
+ "next-safe-action": "^8.0.2",
62
+ "react-date-picker": "^11.0.0",
63
+ "react-date-range": "^2.0.1",
64
+ "react-hook-form": "^7.56.4",
65
+ "react-markdown": "^9.1.0",
66
+ "react-slick": "^0.30.2",
67
+ "react-use": "^17.6.0",
68
+ "react-wrap-balancer": "^1.1.1",
69
+ "remark-gfm": "^4.0.1",
70
+ "rsuite": "^5.75.0",
71
+ "slick-carousel": "^1.8.1",
72
+ "typed-css-modules": "^0.9.1",
73
+ "vite-plugin-svgr": "^4.3.0",
74
+ "zod": "^3.24.1",
75
+ "zustand": "^4.5.5"
76
+ },
77
+ "peerDependencies": {
78
+ "@vanilla-extract/css-utils": "^0.1.3 || ^0.1.4",
79
+ "@vanilla-extract/recipes": "^0.5.1 || ^0.5.5",
80
+ "next": "^14.1.4 || ^15.0.0 || ^16.0.0",
81
+ "react": "^18.2.0 || ^19.0.0",
82
+ "react-date-range": "^2.0.1",
83
+ "react-dom": "^18.2.0 || ^19.0.0",
84
+ "react-slick": "^0.30.2",
85
+ "slick-carousel": "^1.8.1"
86
+ },
87
+ "devDependencies": {
88
+ "@chromatic-com/storybook": "^1.9.0",
89
+ "@eslint/js": "^9.39.4",
90
+ "@rollup/plugin-alias": "^5.1.1",
91
+ "@storybook/addon-essentials": "^8.4.7",
92
+ "@storybook/addon-interactions": "^8.4.7",
93
+ "@storybook/addon-links": "^8.4.7",
94
+ "@storybook/addon-mdx-gfm": "^8.4.7",
95
+ "@storybook/addon-onboarding": "^8.4.7",
96
+ "@storybook/addon-themes": "^8.4.7",
97
+ "@storybook/blocks": "^8.4.7",
98
+ "@storybook/react": "^8.6.14",
99
+ "@storybook/react-vite": "^8.4.7",
100
+ "@storybook/test": "^8.6.14",
101
+ "@svgr/core": "^8.1.0",
102
+ "@svgr/plugin-prettier": "^8.1.0",
103
+ "@svgr/plugin-svgo": "^8.1.0",
104
+ "@types/lodash": "^4.17.17",
105
+ "@types/node": "^20.19.0",
106
+ "@types/react": "^19.0.0",
107
+ "@types/react-date-range": "^1.4.9",
108
+ "@types/react-datepicker": "^6.2.0",
109
+ "@types/react-dom": "^19.0.0",
110
+ "@types/react-slick": "^0.23.13",
111
+ "@typescript-eslint/eslint-plugin": "^8.0.0",
112
+ "@typescript-eslint/parser": "^8.0.0",
113
+ "@vanilla-extract/css-utils": "^0.1.4",
114
+ "@vanilla-extract/recipes": "^0.5.5",
115
+ "@vanilla-extract/vite-plugin": "^4.0.18",
116
+ "@vitejs/plugin-react-swc": "^3.7.2",
117
+ "esbuild-vanilla-image-loader": "^0.1.3",
118
+ "eslint": "^9.0.0",
119
+ "eslint-plugin-react-hooks": "^5.1.0",
120
+ "eslint-plugin-react-refresh": "^0.4.16",
121
+ "eslint-plugin-storybook": "^0.8.0",
122
+ "glob": "^10.4.5",
123
+ "globals": "^15.15.0",
124
+ "husky": "^9.1.7",
125
+ "next": "^16.0.0",
126
+ "prettier": "3.2.5",
127
+ "react": "^19.0.0",
128
+ "react-dom": "^19.0.0",
129
+ "rollup-plugin-preserve-directives": "^0.4.0",
130
+ "rollup-plugin-svg-import": "^3.0.0",
131
+ "rollup-plugin-svgo": "^2.0.0",
132
+ "storybook": "^8.4.7",
133
+ "typescript": "^5.7.2",
134
+ "typescript-eslint": "^8.57.0",
135
+ "typescript-plugin-css-modules": "^5.1.0",
136
+ "vite": "^5.4.11",
137
+ "vite-plugin-dts": "^3.9.1",
138
+ "vite-plugin-lib-inject-css": "^2.1.1",
139
+ "vite-plugin-setting-css-module": "^1.1.4",
140
+ "vite-tsconfig-paths": "^4.3.2"
141
+ },
142
+ "directories": {
143
+ "lib": "lib"
144
+ },
145
+ "author": "axos-web-dev",
146
+ "license": "ISC"
147
+ }
@@ -1 +0,0 @@
1
- export default function Chat(): import("react").JSX.Element;
@@ -1,158 +0,0 @@
1
- "use client";
2
- import { jsxs, jsx } from "react/jsx-runtime";
3
- import { useRef, useEffect } from "react";
4
- import { authenticate } from "./authenticate.js";
5
- import { useMessages } from "./store/messages.js";
6
- const companyId = process.env.CCAI_COMPANY_ID || "";
7
- const tenant = process.env.CCAI_TENANT_NAME || "";
8
- const host = process.env.CCAI_HOST || "";
9
- const COBROWSE_CONSENT_TEMPLATE = `
10
- <script class="cobrowse-template" type="text/template">
11
- <div class="cobrowse">
12
- <div class="cobrowse-title">$title</div>
13
- <div class="cobrowse-content">$content</div>
14
- <div class="cobrowse-footer">
15
- <button class="cobrowse-deny js-cobrowse-deny">$deny</button>
16
- <button class="cobrowse-allow js-cobrowse-allow">$allow</button>
17
- </div>
18
- </div>
19
- <\/script>
20
- `;
21
- function Chat() {
22
- const clientRef = useRef(null);
23
- const hasLoadedBefore = useRef(true);
24
- const addMessages = useMessages((state) => state.addMessages);
25
- const addMessage = useMessages((state) => state.addMessage);
26
- const chatRef = useRef(null);
27
- const isMounted = useRef(true);
28
- useEffect(() => {
29
- let messageHandler;
30
- let identityHandler;
31
- let chatUpdatedHandler;
32
- let memberJoinedHandler;
33
- let chatConnectedHandler;
34
- async function initChat() {
35
- const { Client, consoleLoggerHandler, Logger } = await import("@ujet/websdk-headless");
36
- Logger.addHandler(consoleLoggerHandler);
37
- clientRef.current = new Client({
38
- companyId,
39
- tenant,
40
- cobrowse: {
41
- enabled: true,
42
- template: COBROWSE_CONSENT_TEMPLATE,
43
- messages: {
44
- confirmSessionTitle: "...",
45
- confirmSessionContent: "...",
46
- endSessionText: "...",
47
- confirmRemoteControlTitle: "...",
48
- confirmRemoteControlContent: "...",
49
- confirmFullDeviceTitle: "...",
50
- confirmFullDeviceContent: "...",
51
- allowText: "...",
52
- denyText: "..."
53
- }
54
- },
55
- host,
56
- authenticate
57
- });
58
- const menus = await clientRef.current?.getMenus();
59
- try {
60
- chatRef.current = await clientRef.current?.loadOngoingChat();
61
- console.log("chat:", chatRef.current);
62
- if (!chatRef.current) {
63
- chatRef.current = await clientRef.current?.createChat(
64
- menus?.menus[5].id
65
- );
66
- }
67
- } catch (error) {
68
- console.error("Error creating chat:", error);
69
- chatRef.current = await clientRef.current?.createChat(
70
- menus?.menus[5].id
71
- );
72
- }
73
- identityHandler = (identity) => {
74
- if (!isMounted.current) return;
75
- console.log("identity:", identity);
76
- };
77
- messageHandler = (msg) => {
78
- addMessage(msg);
79
- };
80
- chatUpdatedHandler = (chat) => {
81
- console.log("chat updated:", chat);
82
- };
83
- chatConnectedHandler = async () => {
84
- console.log("connected");
85
- const messagesFetched = await clientRef.current?.fetchMessages();
86
- addMessages(messagesFetched || []);
87
- };
88
- memberJoinedHandler = (identity) => {
89
- console.log("member joined:", identity);
90
- };
91
- clientRef.current?.on("authenticated", () => {
92
- console.log("authenticated");
93
- });
94
- clientRef.current?.on("chat.ongoing", (chat) => {
95
- if (!isMounted.current) return;
96
- console.log("chat:", chat);
97
- });
98
- clientRef.current?.on("chat.connected", chatConnectedHandler);
99
- clientRef.current?.on("chat.updated", chatUpdatedHandler);
100
- clientRef.current?.on("chat.identity", identityHandler);
101
- clientRef.current?.on("chat.message", messageHandler);
102
- clientRef.current?.on("cobrowse.request", ({ from }) => {
103
- console.log("request by", from);
104
- });
105
- clientRef.current?.on("chat.memberJoined", memberJoinedHandler);
106
- }
107
- if (hasLoadedBefore.current) {
108
- console.log("Initial setup");
109
- initChat();
110
- hasLoadedBefore.current = false;
111
- }
112
- return () => {
113
- isMounted.current = false;
114
- console.log("Component unmounted. Cancelling pending async operations.");
115
- if (clientRef.current) {
116
- if (messageHandler)
117
- clientRef.current.off("chat.message", messageHandler);
118
- if (identityHandler)
119
- clientRef.current.off("chat.identity", identityHandler);
120
- clientRef.current.off("chat.connected", chatConnectedHandler);
121
- clientRef.current.off("chat.updated", chatUpdatedHandler);
122
- clientRef.current.off("chat.memberJoined", memberJoinedHandler);
123
- if (typeof clientRef.current.destroyChat === "function") {
124
- console.log("Destroying chat:", chatRef.current);
125
- clientRef.current.destroyChat();
126
- }
127
- }
128
- };
129
- }, [addMessage, addMessages]);
130
- return /* @__PURE__ */ jsxs("div", { children: [
131
- /* @__PURE__ */ jsx("h2", { children: "Chat" }),
132
- /* @__PURE__ */ jsxs(
133
- "form",
134
- {
135
- style: { marginTop: "1rem", display: "flex", gap: "0.5rem" },
136
- onSubmit: async (e) => {
137
- e.preventDefault();
138
- const form = e.target;
139
- const input = form.elements[0];
140
- const message = input.value;
141
- try {
142
- await clientRef.current?.sendTextMessage(message);
143
- input.value = "";
144
- } catch (error) {
145
- console.error("Error sending message:", error);
146
- }
147
- },
148
- children: [
149
- /* @__PURE__ */ jsx("input", { type: "text", name: "message", placeholder: "Type a message..." }),
150
- /* @__PURE__ */ jsx("button", { type: "submit", children: "Send" })
151
- ]
152
- }
153
- )
154
- ] });
155
- }
156
- export {
157
- Chat as default
158
- };
@@ -1,27 +0,0 @@
1
- import { TokenResponse } from '@ujet/websdk-headless';
2
-
3
- interface UseHeadlessChatOptions {
4
- companyId: string;
5
- tenant: string;
6
- host: string;
7
- getToken: () => Promise<TokenResponse>;
8
- channelId?: string;
9
- projectId?: "axos" | "" | "ufb" | string;
10
- debug?: boolean;
11
- menuOption?: string;
12
- }
13
- export interface ChatMessage {
14
- id: string;
15
- body: string;
16
- sender?: string;
17
- timestamp?: string;
18
- }
19
- export declare function useHeadlessChat({ companyId, tenant, host, getToken, projectId, debug, menuOption, }: UseHeadlessChatOptions): {
20
- status: "error" | "idle" | "connected" | "connecting" | "finished";
21
- sendMessage: (body: string) => Promise<void>;
22
- showReconnect: boolean;
23
- setShowReconnect: import('react').Dispatch<import('react').SetStateAction<boolean>>;
24
- endChat: () => Promise<void>;
25
- virtualAgent: any;
26
- };
27
- export {};