@meetelise/chat 1.24.2 → 1.25.0

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 (26) hide show
  1. package/package.json +1 -1
  2. package/public/dist/index.js +946 -265
  3. package/src/WebComponent/FeeCalculator/components/collapsible-fee-section/collapsible-fee-section-styles.ts +86 -0
  4. package/src/WebComponent/FeeCalculator/components/collapsible-fee-section/collapsible-fee-section.ts +94 -0
  5. package/src/WebComponent/FeeCalculator/components/fee-item/fee-item-styles.ts +47 -0
  6. package/src/WebComponent/FeeCalculator/components/fee-item/fee-item.ts +50 -0
  7. package/src/WebComponent/FeeCalculator/components/floor-plan-selector/floor-plan-selector-styles.ts +46 -0
  8. package/src/WebComponent/FeeCalculator/components/floor-plan-selector/floor-plan-selector.ts +70 -0
  9. package/src/WebComponent/FeeCalculator/components/index.ts +3 -0
  10. package/src/WebComponent/FeeCalculator/components/promo-card/promo-card-styles.ts +39 -0
  11. package/src/WebComponent/FeeCalculator/components/promo-card/promo-card.ts +39 -0
  12. package/src/WebComponent/FeeCalculator/fee-calculator-styles.ts +280 -0
  13. package/src/WebComponent/FeeCalculator/fee-calculator.ts +256 -0
  14. package/src/WebComponent/FeeCalculator/index.ts +4 -0
  15. package/src/WebComponent/FeeCalculator/model/building-fee.ts +83 -0
  16. package/src/WebComponent/FeeCalculator/model/transaction-category.ts +23 -0
  17. package/src/WebComponent/chat-additional-actions.ts +9 -7
  18. package/src/WebComponent/icons/CalculatorOutlineIcon.ts +22 -0
  19. package/src/WebComponent/icons/DollarOutlineIcon.ts +18 -0
  20. package/src/WebComponent/launcher/Launcher.ts +114 -1
  21. package/src/WebComponent/launcher/mobile-launcher.ts +13 -0
  22. package/src/WebComponent/me-chat.ts +23 -1
  23. package/src/fetchBuildingWebchatView.ts +5 -3
  24. package/src/globals.ts +1 -0
  25. package/src/services/fees/fetchBuildingFees.ts +28 -0
  26. package/src/utils.ts +32 -0
@@ -0,0 +1,86 @@
1
+ import { css } from "lit";
2
+
3
+ const collapsibleFeeSectionStyles = css`
4
+ :host {
5
+ display: block;
6
+ margin-bottom: 20px;
7
+ }
8
+
9
+ .calculator-fees-collapse-container {
10
+ width: 100%;
11
+ border-radius: 8px;
12
+ overflow: hidden;
13
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
14
+ }
15
+
16
+ .calculator-fees-collapse-header {
17
+ cursor: pointer;
18
+ padding: 12px 16px;
19
+ background-color: #ffffff;
20
+ }
21
+
22
+ .calculator-fees-collapse-header > div {
23
+ display: flex;
24
+ justify-content: space-between;
25
+ align-items: center;
26
+ }
27
+
28
+ .title,
29
+ .large-amount {
30
+ font-size: 1.2rem;
31
+ font-weight: 510;
32
+ }
33
+
34
+ .details-toggle {
35
+ display: flex;
36
+ align-items: center;
37
+ gap: 8px;
38
+ color: var(--primary-color, #007bff);
39
+ font-size: 0.9rem;
40
+ }
41
+
42
+ .chevron {
43
+ display: inline-flex;
44
+ transition: transform 0.2s ease;
45
+ transform: rotate(90deg);
46
+ }
47
+
48
+ .chevron-down {
49
+ transform: rotate(180deg);
50
+ }
51
+
52
+ .calculator-fees-collapse-content {
53
+ transition: max-height 0.3s ease, opacity 0.3s ease;
54
+ overflow: hidden;
55
+ background-color: #f8f9fa;
56
+ padding: 0 16px;
57
+ }
58
+
59
+ .calculator-fees-collapse-content.hidden {
60
+ max-height: 0;
61
+ opacity: 0;
62
+ padding-top: 0;
63
+ padding-bottom: 0;
64
+ }
65
+
66
+ .calculator-fees-collapse-content.visible {
67
+ max-height: 500px;
68
+ opacity: 1;
69
+ padding-top: 16px;
70
+ padding-bottom: 16px;
71
+ }
72
+
73
+ .calculator-fees-collapse-footer {
74
+ padding: 16px;
75
+ border-top: 1px solid #eee;
76
+ background-color: #ffffff;
77
+ }
78
+
79
+ .calculator-fees-collapse-footer > div {
80
+ display: flex;
81
+ justify-content: space-between;
82
+ align-items: center;
83
+ }
84
+ `;
85
+
86
+ export default collapsibleFeeSectionStyles;
@@ -0,0 +1,94 @@
1
+ import { LitElement, html, TemplateResult } from "lit";
2
+ import { customElement, property, state } from "lit/decorators.js";
3
+ import { ChevronRightIcon } from "../../../icons/ChevronRightIcon";
4
+ import { BuildingFee } from "../../model/building-fee";
5
+
6
+ import "../fee-item/fee-item";
7
+ import collapsibleFeeSectionStyles from "./collapsible-fee-section-styles";
8
+ import { formatCurrency } from "../../../../utils";
9
+
10
+ @customElement("collapsible-fee-section")
11
+ export class CollapsibleFeeSection extends LitElement {
12
+ static styles = collapsibleFeeSectionStyles;
13
+
14
+ @property({ type: String })
15
+ primaryColor = "#007bff";
16
+
17
+ @property({ type: String })
18
+ title = "Fees";
19
+
20
+ @property({ type: String })
21
+ totalLabel = "Total";
22
+
23
+ @property({ type: Array })
24
+ buildingFees: BuildingFee[] = [];
25
+
26
+ @state()
27
+ private isDetailsVisible = false;
28
+
29
+ get totalAmount(): string {
30
+ return formatCurrency(
31
+ this.buildingFees.reduce(
32
+ (acc, item) => acc + (item.blueprint?.transactionAmount ?? 0),
33
+ 0
34
+ )
35
+ );
36
+ }
37
+
38
+ toggleDetails = (): void => {
39
+ this.isDetailsVisible = !this.isDetailsVisible;
40
+ };
41
+
42
+ get detailsText(): string {
43
+ return this.isDetailsVisible ? "Hide Details" : "Fees & Cost Breakdown";
44
+ }
45
+
46
+ render(): TemplateResult {
47
+ return html`
48
+ <div class="calculator-fees-collapse-container">
49
+ <div
50
+ class="calculator-fees-collapse-header"
51
+ @click=${this.toggleDetails}
52
+ >
53
+ <div>
54
+ <h1 class="title">${this.title}</h1>
55
+ <div class="details-toggle">
56
+ <span>${this.detailsText}</span>
57
+ <span
58
+ class="chevron ${this.isDetailsVisible ? "chevron-down" : ""}"
59
+ >
60
+ ${ChevronRightIcon(this.primaryColor)}
61
+ </span>
62
+ </div>
63
+ </div>
64
+ </div>
65
+
66
+ <div
67
+ class="calculator-fees-collapse-content ${this.isDetailsVisible
68
+ ? "visible"
69
+ : "hidden"}"
70
+ >
71
+ ${this.buildingFees.map(
72
+ (item) => html`
73
+ <fee-item .feeItem=${item}></fee-item>
74
+ <hr />
75
+ `
76
+ )}
77
+ </div>
78
+
79
+ <div class="calculator-fees-collapse-footer">
80
+ <div>
81
+ <h1 class="title">${this.totalLabel}</h1>
82
+ <h1 class="large-amount">${this.totalAmount}</h1>
83
+ </div>
84
+ </div>
85
+ </div>
86
+ `;
87
+ }
88
+ }
89
+
90
+ declare global {
91
+ interface HTMLElementTagNameMap {
92
+ "collapsible-fee-section": CollapsibleFeeSection;
93
+ }
94
+ }
@@ -0,0 +1,47 @@
1
+ import { css } from "lit";
2
+
3
+ const feeItemStyles = css`
4
+ :host {
5
+ display: block;
6
+ }
7
+
8
+ .fee-item {
9
+ display: flex;
10
+ justify-content: space-between;
11
+ border-bottom: 1px solid rgba(255, 255, 255, 0.2);
12
+ }
13
+
14
+ .result-item:last-child {
15
+ border-bottom: none;
16
+ margin-bottom: 0;
17
+ }
18
+
19
+ .fee-info {
20
+ display: flex;
21
+ flex-direction: column;
22
+ align-items: flex-start;
23
+ }
24
+
25
+ .required-label {
26
+ color: #868e96;
27
+ font-size: 0.8rem;
28
+ }
29
+
30
+ .fee-name {
31
+ font-size: 1rem;
32
+ font-weight: 500;
33
+ margin: 0.4rem 0;
34
+ }
35
+
36
+ .fee-description {
37
+ color: #868e96;
38
+ font-size: 0.8rem;
39
+ }
40
+
41
+ .fee-amount {
42
+ font-size: 1rem;
43
+ align-self: center;
44
+ }
45
+ `;
46
+
47
+ export default feeItemStyles;
@@ -0,0 +1,50 @@
1
+ import { LitElement, html, TemplateResult } from "lit";
2
+ import { customElement, property } from "lit/decorators.js";
3
+ import { BuildingFee } from "../../model/building-fee";
4
+ import { formatCurrency, sentenceTitleCase } from "../../../../utils";
5
+
6
+ import feeItemStyles from "./fee-item-styles";
7
+
8
+ @customElement("fee-item")
9
+ export class FeeItemComponent extends LitElement {
10
+ static styles = feeItemStyles;
11
+
12
+ @property({ type: Object })
13
+ feeItem: BuildingFee | null = null;
14
+
15
+ get feeName(): string {
16
+ const category = this.feeItem?.blueprint.category;
17
+ if (!category) return "Fee";
18
+ return sentenceTitleCase(category);
19
+ }
20
+
21
+ get feeAmount(): string {
22
+ const amount = this.feeItem?.blueprint.transactionAmount;
23
+ return formatCurrency(amount ?? 0);
24
+ }
25
+
26
+ render(): TemplateResult {
27
+ if (!this.feeItem) return html``;
28
+
29
+ return html`
30
+ <div class="fee-item">
31
+ <div class="fee-info">
32
+ ${this.feeItem.required
33
+ ? html`<div class="required-label">Required</div>`
34
+ : ""}
35
+ <div class="fee-name">${this.feeName}</div>
36
+ <div class="fee-description">
37
+ ${this.feeItem.blueprint.transactionDescription}
38
+ </div>
39
+ </div>
40
+ <div class="fee-amount">${this.feeAmount}</div>
41
+ </div>
42
+ `;
43
+ }
44
+ }
45
+
46
+ declare global {
47
+ interface HTMLElementTagNameMap {
48
+ "fee-item": FeeItemComponent;
49
+ }
50
+ }
@@ -0,0 +1,46 @@
1
+ import { css } from "lit";
2
+
3
+ const floorPlanSelectorStyles = css`
4
+ :host {
5
+ display: block;
6
+ margin-bottom: 16px;
7
+ }
8
+
9
+ .floor-plan-selector {
10
+ flex-wrap: wrap;
11
+ gap: 8px;
12
+ }
13
+
14
+ .floor-plan-selector-label {
15
+ font-size: 0.9rem;
16
+ margin-bottom: 8px;
17
+ }
18
+
19
+ .floor-plan-selector-badges {
20
+ display: flex;
21
+ flex-wrap: wrap;
22
+ gap: 8px;
23
+ }
24
+
25
+ .floor-plan-badge {
26
+ padding: 6px 12px;
27
+ border-radius: 16px;
28
+ font-size: 0.9rem;
29
+ cursor: pointer;
30
+ background-color: #f0f0f0;
31
+ border: 1px solid #ddd;
32
+ transition: all 0.2s ease;
33
+ }
34
+
35
+ .floor-plan-badge:hover {
36
+ background-color: #e6e6e6;
37
+ }
38
+
39
+ .floor-plan-badge.selected {
40
+ background-color: var(--primary-color, #007bff);
41
+ color: white;
42
+ border-color: var(--primary-color, #007bff);
43
+ }
44
+ `;
45
+
46
+ export default floorPlanSelectorStyles;
@@ -0,0 +1,70 @@
1
+ import { LitElement, html, TemplateResult } from "lit";
2
+ import { customElement, property } from "lit/decorators.js";
3
+ import { LayoutOption } from "../../../../fetchBuildingWebchatView";
4
+
5
+ import floorPlanSelectorStyles from "./floor-plan-selector-styles";
6
+
7
+ @customElement("floor-plan-selector")
8
+ export class FloorPlanSelector extends LitElement {
9
+ static styles = floorPlanSelectorStyles;
10
+
11
+ @property({ type: Array })
12
+ floorPlans: LayoutOption[] = [];
13
+
14
+ @property({ type: Number })
15
+ selectedLayoutId: number | null = null;
16
+
17
+ @property({ type: String })
18
+ primaryColor = "#007bff";
19
+
20
+ @property({ type: String })
21
+ allOptionId = "all";
22
+
23
+ private handleFloorPlanClick(id: number) {
24
+ this.selectedLayoutId = id;
25
+ this.dispatchEvent(
26
+ new CustomEvent("floor-plan-selected", {
27
+ detail: { id },
28
+ bubbles: true,
29
+ composed: true,
30
+ })
31
+ );
32
+ }
33
+
34
+ private get displayOptions(): LayoutOption[] {
35
+ const allOption: LayoutOption = {
36
+ value: -1,
37
+ label: "All",
38
+ };
39
+
40
+ return [allOption, ...this.floorPlans].sort((a, b) => a.value - b.value);
41
+ }
42
+
43
+ render(): TemplateResult {
44
+ return html`
45
+ <div class="floor-plan-selector">
46
+ <div class="floor-plan-selector-label">Select Floor Plan</div>
47
+ <div class="floor-plan-selector-badges">
48
+ ${this.displayOptions.map(
49
+ (opt) => html`
50
+ <div
51
+ class="floor-plan-badge ${opt.value === this.selectedLayoutId
52
+ ? "selected"
53
+ : ""}"
54
+ @click=${() => this.handleFloorPlanClick(opt.value)}
55
+ >
56
+ ${opt.label}
57
+ </div>
58
+ `
59
+ )}
60
+ </div>
61
+ </div>
62
+ `;
63
+ }
64
+ }
65
+
66
+ declare global {
67
+ interface HTMLElementTagNameMap {
68
+ "floor-plan-selector": FloorPlanSelector;
69
+ }
70
+ }
@@ -0,0 +1,3 @@
1
+ export * from "./promo-card/promo-card";
2
+ export * from "./floor-plan-selector/floor-plan-selector";
3
+ export * from "./collapsible-fee-section/collapsible-fee-section";
@@ -0,0 +1,39 @@
1
+ import { css } from "lit";
2
+
3
+ const promoCardStyles = css`
4
+ :host {
5
+ display: block;
6
+ margin-bottom: 20px;
7
+ }
8
+
9
+ .promo-card {
10
+ background-color: #e6f2ff;
11
+ border-radius: 8px;
12
+ padding: 16px;
13
+ display: flex;
14
+ align-items: center;
15
+ }
16
+
17
+ .icon-container {
18
+ display: flex;
19
+ justify-content: center;
20
+ margin-right: 16px;
21
+ }
22
+
23
+ .content-container {
24
+ flex: 1;
25
+ }
26
+
27
+ .promo-heading {
28
+ font-size: 1.2rem;
29
+ font-weight: normal;
30
+ margin: 0 0 4px 0;
31
+ }
32
+
33
+ .promo-subtitle {
34
+ color: #868e96;
35
+ font-size: 0.8rem;
36
+ }
37
+ `;
38
+
39
+ export default promoCardStyles;
@@ -0,0 +1,39 @@
1
+ import { LitElement, html, TemplateResult } from "lit";
2
+ import { customElement, property } from "lit/decorators.js";
3
+ import DollarOutlineIcon from "../../../icons/DollarOutlineIcon";
4
+
5
+ import promoCardStyles from "./promo-card-styles";
6
+
7
+ @customElement("promo-card")
8
+ export class PromoCard extends LitElement {
9
+ static styles = promoCardStyles;
10
+
11
+ @property({ type: String })
12
+ promoAmount = "0";
13
+
14
+ @property({ type: String })
15
+ promoDescription = "";
16
+
17
+ @property({ type: String })
18
+ promoValidity = "";
19
+
20
+ render(): TemplateResult {
21
+ return html`
22
+ <div class="promo-card">
23
+ <div class="icon-container">${DollarOutlineIcon()}</div>
24
+ <div class="content-container">
25
+ <h2 class="promo-heading">
26
+ ${this.promoAmount} ${this.promoDescription}
27
+ </h2>
28
+ <div class="promo-subtitle">${this.promoValidity}</div>
29
+ </div>
30
+ </div>
31
+ `;
32
+ }
33
+ }
34
+
35
+ declare global {
36
+ interface HTMLElementTagNameMap {
37
+ "promo-card": PromoCard;
38
+ }
39
+ }