@ultraviolet/plus 3.4.5 → 3.5.1

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 (222) hide show
  1. package/dist/.vite/license.md +3 -0
  2. package/dist/_virtual/_@oxc-project_runtime@0.113.0/helpers/defineProperty.js +15 -0
  3. package/dist/_virtual/_@oxc-project_runtime@0.113.0/helpers/objectSpread2.js +28 -0
  4. package/dist/_virtual/_@oxc-project_runtime@0.113.0/helpers/objectWithoutProperties.js +18 -0
  5. package/dist/_virtual/_@oxc-project_runtime@0.113.0/helpers/objectWithoutPropertiesLoose.js +15 -0
  6. package/dist/_virtual/_@oxc-project_runtime@0.113.0/helpers/toPrimitive.js +17 -0
  7. package/dist/_virtual/_@oxc-project_runtime@0.113.0/helpers/toPropertyKey.js +12 -0
  8. package/dist/_virtual/_@oxc-project_runtime@0.113.0/helpers/typeof.js +14 -0
  9. package/dist/_virtual/_rolldown/runtime.js +9 -0
  10. package/dist/components/CodeEditor/CodeEditor.d.ts +1 -1
  11. package/dist/components/CodeEditor/CodeEditor.d.ts.map +1 -1
  12. package/dist/components/CodeEditor/CodeEditor.js +111 -137
  13. package/dist/components/CodeEditor/styles.css.js +18 -15
  14. package/dist/components/ContentCard/Skeleton.d.ts.map +1 -1
  15. package/dist/components/ContentCard/Skeleton.js +31 -27
  16. package/dist/components/ContentCard/index.js +107 -140
  17. package/dist/components/ContentCard/styles.css.d.ts +1 -1
  18. package/dist/components/ContentCard/styles.css.js +23 -19
  19. package/dist/components/ContentCardGroup/Card.js +55 -69
  20. package/dist/components/ContentCardGroup/SkeletonCard.js +28 -14
  21. package/dist/components/ContentCardGroup/index.d.ts +7 -7
  22. package/dist/components/ContentCardGroup/index.js +20 -25
  23. package/dist/components/ContentCardGroup/styles.css.js +6 -11
  24. package/dist/components/Conversation/index.d.ts +29 -23
  25. package/dist/components/Conversation/index.d.ts.map +1 -1
  26. package/dist/components/Conversation/index.js +46 -48
  27. package/dist/components/Conversation/styles.css.js +19 -13
  28. package/dist/components/CustomerSatisfaction/assets/1-5.js +5 -0
  29. package/dist/components/CustomerSatisfaction/assets/1-5NB.js +5 -0
  30. package/dist/components/CustomerSatisfaction/assets/2-5.js +5 -0
  31. package/dist/components/CustomerSatisfaction/assets/2-5NB.js +5 -0
  32. package/dist/components/CustomerSatisfaction/assets/3-5.js +5 -0
  33. package/dist/components/CustomerSatisfaction/assets/3-5NB.js +5 -0
  34. package/dist/components/CustomerSatisfaction/assets/4-5.js +5 -0
  35. package/dist/components/CustomerSatisfaction/assets/4-5NB.js +5 -0
  36. package/dist/components/CustomerSatisfaction/assets/5-5.js +5 -0
  37. package/dist/components/CustomerSatisfaction/assets/5-5NB.js +5 -0
  38. package/dist/components/CustomerSatisfaction/index.d.ts +1 -1
  39. package/dist/components/CustomerSatisfaction/index.d.ts.map +1 -1
  40. package/dist/components/CustomerSatisfaction/index.js +85 -100
  41. package/dist/components/CustomerSatisfaction/styles.css.js +18 -6
  42. package/dist/components/EstimateCost/Components/CustomUnitInput.d.ts.map +1 -1
  43. package/dist/components/EstimateCost/Components/CustomUnitInput.js +39 -52
  44. package/dist/components/EstimateCost/Components/Item.d.ts.map +1 -1
  45. package/dist/components/EstimateCost/Components/Item.js +223 -323
  46. package/dist/components/EstimateCost/Components/LineThrough.d.ts.map +1 -1
  47. package/dist/components/EstimateCost/Components/LineThrough.js +16 -16
  48. package/dist/components/EstimateCost/Components/NumberInput.d.ts.map +1 -1
  49. package/dist/components/EstimateCost/Components/NumberInput.js +33 -37
  50. package/dist/components/EstimateCost/Components/Region.d.ts.map +1 -1
  51. package/dist/components/EstimateCost/Components/Region.js +34 -57
  52. package/dist/components/EstimateCost/Components/Regular.d.ts.map +1 -1
  53. package/dist/components/EstimateCost/Components/Regular.js +21 -26
  54. package/dist/components/EstimateCost/Components/Strong.d.ts.map +1 -1
  55. package/dist/components/EstimateCost/Components/Strong.js +14 -19
  56. package/dist/components/EstimateCost/Components/Unit.d.ts.map +1 -1
  57. package/dist/components/EstimateCost/Components/Unit.js +47 -40
  58. package/dist/components/EstimateCost/Components/Zone.d.ts.map +1 -1
  59. package/dist/components/EstimateCost/Components/Zone.js +33 -55
  60. package/dist/components/EstimateCost/Components/components.css.js +122 -86
  61. package/dist/components/EstimateCost/EstimateCost.d.ts +138 -121
  62. package/dist/components/EstimateCost/EstimateCost.d.ts.map +1 -1
  63. package/dist/components/EstimateCost/EstimateCost.js +79 -124
  64. package/dist/components/EstimateCost/EstimateCostContent.d.ts.map +1 -1
  65. package/dist/components/EstimateCost/EstimateCostContent.js +284 -394
  66. package/dist/components/EstimateCost/EstimateCostProvider.d.ts +1 -1
  67. package/dist/components/EstimateCost/EstimateCostProvider.d.ts.map +1 -1
  68. package/dist/components/EstimateCost/EstimateCostProvider.js +30 -37
  69. package/dist/components/EstimateCost/OverlayComponent.d.ts.map +1 -1
  70. package/dist/components/EstimateCost/OverlayComponent.js +95 -93
  71. package/dist/components/EstimateCost/OverlayContext.d.ts.map +1 -1
  72. package/dist/components/EstimateCost/OverlayContext.js +12 -10
  73. package/dist/components/EstimateCost/constants.js +19 -21
  74. package/dist/components/EstimateCost/helper.d.ts +2 -2
  75. package/dist/components/EstimateCost/helper.d.ts.map +1 -1
  76. package/dist/components/EstimateCost/helper.js +9 -14
  77. package/dist/components/EstimateCost/locales/en.js +24 -23
  78. package/dist/components/EstimateCost/styles.css.d.ts +2 -2
  79. package/dist/components/EstimateCost/styles.css.js +50 -36
  80. package/dist/components/EstimateCost/types.d.ts +1 -1
  81. package/dist/components/EstimateCost/types.d.ts.map +1 -1
  82. package/dist/components/FAQ/index.d.ts.map +1 -1
  83. package/dist/components/FAQ/index.js +37 -31
  84. package/dist/components/FAQ/styles.css.js +6 -4
  85. package/dist/components/InfoTable/InfoTable.d.ts +10 -13
  86. package/dist/components/InfoTable/InfoTable.d.ts.map +1 -1
  87. package/dist/components/InfoTable/InfoTable.js +24 -15
  88. package/dist/components/InfoTable/components/Cell.d.ts.map +1 -1
  89. package/dist/components/InfoTable/components/Cell.js +37 -45
  90. package/dist/components/InfoTable/components/Row.d.ts.map +1 -1
  91. package/dist/components/InfoTable/components/Row.js +19 -27
  92. package/dist/components/InfoTable/context.d.ts +1 -1
  93. package/dist/components/InfoTable/context.d.ts.map +1 -1
  94. package/dist/components/InfoTable/context.js +5 -3
  95. package/dist/components/InfoTable/styles.css.js +6 -10
  96. package/dist/components/Navigation/Footer.d.ts.map +1 -1
  97. package/dist/components/Navigation/Footer.js +59 -75
  98. package/dist/components/Navigation/Header.d.ts.map +1 -1
  99. package/dist/components/Navigation/Header.js +20 -17
  100. package/dist/components/Navigation/Navigation.d.ts +46 -43
  101. package/dist/components/Navigation/Navigation.d.ts.map +1 -1
  102. package/dist/components/Navigation/Navigation.js +23 -27
  103. package/dist/components/Navigation/NavigationContent.d.ts +1 -1
  104. package/dist/components/Navigation/NavigationContent.d.ts.map +1 -1
  105. package/dist/components/Navigation/NavigationContent.js +100 -138
  106. package/dist/components/Navigation/NavigationProvider.d.ts.map +1 -1
  107. package/dist/components/Navigation/NavigationProvider.js +116 -165
  108. package/dist/components/Navigation/components/Group.d.ts.map +1 -1
  109. package/dist/components/Navigation/components/Group.js +36 -43
  110. package/dist/components/Navigation/components/Item.d.ts +1 -1
  111. package/dist/components/Navigation/components/Item.d.ts.map +1 -1
  112. package/dist/components/Navigation/components/Item.js +440 -607
  113. package/dist/components/Navigation/components/ItemProvider.d.ts.map +1 -1
  114. package/dist/components/Navigation/components/ItemProvider.js +13 -8
  115. package/dist/components/Navigation/components/PinnedItems.d.ts.map +1 -1
  116. package/dist/components/Navigation/components/PinnedItems.js +101 -132
  117. package/dist/components/Navigation/components/Separator.js +10 -7
  118. package/dist/components/Navigation/components/ShowHide.d.ts +1 -1
  119. package/dist/components/Navigation/components/ShowHide.d.ts.map +1 -1
  120. package/dist/components/Navigation/components/ShowHide.js +51 -75
  121. package/dist/components/Navigation/components/items.css.js +72 -30
  122. package/dist/components/Navigation/components/styles.css.js +23 -13
  123. package/dist/components/Navigation/locales/en.js +12 -11
  124. package/dist/components/Navigation/styles.css.js +28 -14
  125. package/dist/components/Navigation/variables.css.js +6 -4
  126. package/dist/components/OfferList/OfferList.d.ts +5 -51
  127. package/dist/components/OfferList/OfferList.d.ts.map +1 -1
  128. package/dist/components/OfferList/OfferList.js +11 -78
  129. package/dist/components/OrderSummary/index.d.ts +5 -2
  130. package/dist/components/OrderSummary/index.d.ts.map +1 -1
  131. package/dist/components/OrderSummary/index.js +11 -204
  132. package/dist/components/Plans/index.d.ts +5 -21
  133. package/dist/components/Plans/index.d.ts.map +1 -1
  134. package/dist/components/Plans/index.js +11 -214
  135. package/dist/components/SteppedListCard/index.d.ts +5 -1
  136. package/dist/components/SteppedListCard/index.d.ts.map +1 -1
  137. package/dist/components/SteppedListCard/index.js +11 -0
  138. package/dist/index.js +5 -21
  139. package/dist/plus.css +2 -1
  140. package/package.json +9 -8
  141. package/LICENSE +0 -189
  142. package/dist/components/CustomerSatisfaction/assets/1-5.svg.js +0 -4
  143. package/dist/components/CustomerSatisfaction/assets/1-5NB.svg.js +0 -4
  144. package/dist/components/CustomerSatisfaction/assets/2-5.svg.js +0 -4
  145. package/dist/components/CustomerSatisfaction/assets/2-5NB.svg.js +0 -4
  146. package/dist/components/CustomerSatisfaction/assets/3-5.svg.js +0 -4
  147. package/dist/components/CustomerSatisfaction/assets/3-5NB.svg.js +0 -4
  148. package/dist/components/CustomerSatisfaction/assets/4-5.svg.js +0 -4
  149. package/dist/components/CustomerSatisfaction/assets/4-5NB.svg.js +0 -4
  150. package/dist/components/CustomerSatisfaction/assets/5-5.svg.js +0 -4
  151. package/dist/components/CustomerSatisfaction/assets/5-5NB.svg.js +0 -4
  152. package/dist/components/Navigation/constants.js +0 -10
  153. package/dist/components/OfferList/OfferListProvider.d.ts +0 -30
  154. package/dist/components/OfferList/OfferListProvider.d.ts.map +0 -1
  155. package/dist/components/OfferList/OfferListProvider.js +0 -48
  156. package/dist/components/OfferList/components/Banner.d.ts +0 -13
  157. package/dist/components/OfferList/components/Banner.d.ts.map +0 -1
  158. package/dist/components/OfferList/components/Banner.js +0 -43
  159. package/dist/components/OfferList/components/Cell.d.ts +0 -4
  160. package/dist/components/OfferList/components/Cell.d.ts.map +0 -1
  161. package/dist/components/OfferList/components/Cell.js +0 -35
  162. package/dist/components/OfferList/components/OfferListRowProvider.d.ts +0 -9
  163. package/dist/components/OfferList/components/OfferListRowProvider.d.ts.map +0 -1
  164. package/dist/components/OfferList/components/OfferListRowProvider.js +0 -10
  165. package/dist/components/OfferList/components/Row.d.ts +0 -18
  166. package/dist/components/OfferList/components/Row.d.ts.map +0 -1
  167. package/dist/components/OfferList/components/Row.js +0 -258
  168. package/dist/components/OfferList/styles.css.d.ts +0 -44
  169. package/dist/components/OfferList/styles.css.d.ts.map +0 -1
  170. package/dist/components/OfferList/styles.css.js +0 -40
  171. package/dist/components/OrderSummary/NonScrollableContent.d.ts +0 -20
  172. package/dist/components/OrderSummary/NonScrollableContent.d.ts.map +0 -1
  173. package/dist/components/OrderSummary/NonScrollableContent.js +0 -136
  174. package/dist/components/OrderSummary/Provider.d.ts +0 -15
  175. package/dist/components/OrderSummary/Provider.d.ts.map +0 -1
  176. package/dist/components/OrderSummary/Provider.js +0 -15
  177. package/dist/components/OrderSummary/ScrollableContent.d.ts +0 -2
  178. package/dist/components/OrderSummary/ScrollableContent.d.ts.map +0 -1
  179. package/dist/components/OrderSummary/ScrollableContent.js +0 -314
  180. package/dist/components/OrderSummary/constants.d.ts +0 -3
  181. package/dist/components/OrderSummary/constants.d.ts.map +0 -1
  182. package/dist/components/OrderSummary/constants.js +0 -18
  183. package/dist/components/OrderSummary/helpers.d.ts +0 -28
  184. package/dist/components/OrderSummary/helpers.d.ts.map +0 -1
  185. package/dist/components/OrderSummary/helpers.js +0 -156
  186. package/dist/components/OrderSummary/locales/en.d.ts +0 -11
  187. package/dist/components/OrderSummary/locales/en.d.ts.map +0 -1
  188. package/dist/components/OrderSummary/locales/en.js +0 -12
  189. package/dist/components/OrderSummary/styles.css.d.ts +0 -21
  190. package/dist/components/OrderSummary/styles.css.d.ts.map +0 -1
  191. package/dist/components/OrderSummary/styles.css.js +0 -26
  192. package/dist/components/OrderSummary/types.d.ts +0 -125
  193. package/dist/components/OrderSummary/types.d.ts.map +0 -1
  194. package/dist/components/Plans/FeatureHint.d.ts +0 -7
  195. package/dist/components/Plans/FeatureHint.d.ts.map +0 -1
  196. package/dist/components/Plans/FeatureHint.js +0 -42
  197. package/dist/components/Plans/PlanHeader.d.ts +0 -14
  198. package/dist/components/Plans/PlanHeader.d.ts.map +0 -1
  199. package/dist/components/Plans/PlanHeader.js +0 -96
  200. package/dist/components/Plans/locales/en.d.ts +0 -7
  201. package/dist/components/Plans/locales/en.d.ts.map +0 -1
  202. package/dist/components/Plans/locales/en.js +0 -8
  203. package/dist/components/Plans/styles.css.d.ts +0 -67
  204. package/dist/components/Plans/styles.css.d.ts.map +0 -1
  205. package/dist/components/Plans/styles.css.js +0 -26
  206. package/dist/components/Plans/types.d.ts +0 -38
  207. package/dist/components/Plans/types.d.ts.map +0 -1
  208. package/dist/components/SteppedListCard/Step.d.ts +0 -23
  209. package/dist/components/SteppedListCard/Step.d.ts.map +0 -1
  210. package/dist/components/SteppedListCard/Step.js +0 -61
  211. package/dist/components/SteppedListCard/SteppedListCard.d.ts +0 -69
  212. package/dist/components/SteppedListCard/SteppedListCard.d.ts.map +0 -1
  213. package/dist/components/SteppedListCard/SteppedListCard.js +0 -105
  214. package/dist/components/SteppedListCard/SteppedListContent.d.ts +0 -12
  215. package/dist/components/SteppedListCard/SteppedListContent.d.ts.map +0 -1
  216. package/dist/components/SteppedListCard/SteppedListContent.js +0 -53
  217. package/dist/components/SteppedListCard/helper.d.ts +0 -27
  218. package/dist/components/SteppedListCard/helper.d.ts.map +0 -1
  219. package/dist/components/SteppedListCard/helper.js +0 -41
  220. package/dist/components/SteppedListCard/styles.css.d.ts +0 -9
  221. package/dist/components/SteppedListCard/styles.css.d.ts.map +0 -1
  222. package/dist/components/SteppedListCard/styles.css.js +0 -19
@@ -1,399 +1,289 @@
1
- "use client";
2
- import { jsxs, Fragment, jsx } from "react/jsx-runtime";
3
- import { CalculatorIcon } from "@ultraviolet/icons/CalculatorIcon";
4
- import { Stack, Text, Alert, Badge } from "@ultraviolet/ui";
5
- import { cn } from "@ultraviolet/utils";
6
- import { assignInlineVars } from "@vanilla-extract/dynamic";
7
- import { useState, useMemo, useEffect, memo, Children, cloneElement, isValidElement } from "react";
8
- import { useInView } from "react-intersection-observer";
9
- import { CustomUnitInput } from "./Components/CustomUnitInput.js";
10
- import { Item } from "./Components/Item.js";
11
- import { LineThrough } from "./Components/LineThrough.js";
12
- import { maximumFractionDigitsLong, maximumFractionDigits } from "./constants.js";
1
+ 'use client';
2
+ import { __name } from "../../_virtual/_rolldown/runtime.js";
3
+ import en_default from "./locales/en.js";
4
+ import { maximumFractionDigits, maximumFractionDigitsLong } from "./constants.js";
13
5
  import { useEstimateCost } from "./EstimateCostProvider.js";
14
6
  import { calculatePrice } from "./helper.js";
15
- import EstimateCostLocales from "./locales/en.js";
16
- import { OverlayComponent } from "./OverlayComponent.js";
17
7
  import { OverlayContextProvider } from "./OverlayContext.js";
18
- import { estimateCostCompact, estimateCostCompactText, estimateCostContent, estimateCostTable, estimateCostPriceColumn, estimateCostTimeCell, estimateCostPriceCellContent, estimateCostPriceCell, estimateCostEmptyTable, estimateCostEmptyCell, estimateCostBadgeBeta, estimateCostText, paddingLeftCell, estimateCostCell, estimateCostTotalPriceCell, estimatecostFeesText, estimateCostFeesTable, estimateCostTitle, estimateCostCalculatorIcon } from "./styles.css.js";
19
- const DEFAULT_UNIT_LIST = ["hours", "days", "months"];
20
- const DescriptionComponent = memo(
21
- ({
22
- description,
23
- locales
24
- }) => description === void 0 || typeof description === "string" ? /* @__PURE__ */ jsx(Text, { as: "span", variant: "body", children: description || locales["estimate.cost.description"] }) : description
25
- );
26
- const TitleComponent = memo(
27
- ({
28
- locales
29
- }) => /* @__PURE__ */ jsxs("h3", { className: estimateCostTitle, children: [
30
- /* @__PURE__ */ jsx(
31
- CalculatorIcon,
32
- {
33
- className: estimateCostCalculatorIcon,
34
- sentiment: "primary",
35
- size: "medium"
36
- }
37
- ),
38
- locales?.["estimate.cost.label"]
39
- ] })
40
- );
41
- const EstimateCostContent = ({
42
- description,
43
- alert,
44
- alertTitle,
45
- alertVariant = "warning",
46
- defaultTimeUnit = "hours",
47
- timeUnits = DEFAULT_UNIT_LIST,
48
- hideOverlay = false,
49
- disableOverlayLeft = false,
50
- disableOverlayRight = false,
51
- hideTimeUnit = false,
52
- hideTotal = false,
53
- hideHourlyPriceOnTotal = false,
54
- discount = 0,
55
- OverlayRight,
56
- OverlayLeft,
57
- isBeta = false,
58
- commitmentFees,
59
- commitmentFeesContent,
60
- monthlyFees,
61
- monthlyFeesLabel,
62
- monthlyFeesContent,
63
- overlayUnit = "hours",
64
- children = null,
65
- locales = EstimateCostLocales,
66
- overlayMargin,
67
- onTotalPriceChange,
68
- style,
69
- compact
70
- }) => {
71
- const { formatNumber } = useEstimateCost();
72
- const [ref, inView] = useInView();
73
- const [products, setProducts] = useState([]);
74
- const [totalPrice, setTotalPrice] = useState({
75
- hourly: 0,
76
- maxHourly: 0,
77
- maxOverlayHourly: 0,
78
- maxTotal: 0,
79
- overlayHourly: 0,
80
- total: 0
81
- });
82
- const [iteration, setIteration] = useState({
83
- unit: defaultTimeUnit ?? "hours",
84
- value: 1
85
- });
86
- const [isLongFractionDigits, setIsLongFractionDigits] = useState(false);
87
- const providerValue = useMemo(() => ({ isOverlay: false }), []);
88
- const totalValue = useMemo(
89
- () => formatNumber(totalPrice.total < 0 ? 0 : totalPrice.total, {
90
- maximumFractionDigits: isLongFractionDigits ? maximumFractionDigitsLong[iteration.unit] : maximumFractionDigits[iteration.unit]
91
- }),
92
- [formatNumber, isLongFractionDigits, iteration.unit, totalPrice.total]
93
- );
94
- const totalMaxValue = useMemo(
95
- () => formatNumber(totalPrice.maxTotal < 0 ? 0 : totalPrice.maxTotal, {
96
- maximumFractionDigits: isLongFractionDigits ? maximumFractionDigitsLong[iteration.unit] : maximumFractionDigits[iteration.unit]
97
- }),
98
- [formatNumber, isLongFractionDigits, iteration.unit, totalPrice.maxTotal]
99
- );
100
- const productsCallback = useMemo(
101
- () => ({
102
- add: (newProduct) => {
103
- setProducts((total) => {
104
- if (total.find((product) => product.id === newProduct.id)) {
105
- return total.map(
106
- (product) => product.id === newProduct.id ? newProduct : product
107
- );
108
- }
109
- return [...total, newProduct];
110
- });
111
- },
112
- remove: ({ id }) => {
113
- setProducts((total) => total.filter((product) => product.id !== id));
114
- }
115
- }),
116
- [setProducts]
117
- );
118
- useEffect(() => {
119
- const isMaxAmountInProducts = products.find((product) => product.maxAmount);
120
- setIsLongFractionDigits(
121
- !!products.find((product) => product.longFractionDigits)
122
- );
123
- setTotalPrice({
124
- hourly: products.reduce(
125
- (acc, product) => acc + (product.noIteration ? 0 : (product.price - product.price * product.discount) * Math.max(product.amount - product.amountFree, 0)),
126
- 0
127
- ),
128
- maxHourly: isMaxAmountInProducts ? products.reduce(
129
- (acc, product) => acc && product.noIteration ? 0 : (product.price - product.price * product.discount) * Math.max(product.maxAmount - product.amountFree, 0),
130
- 0
131
- ) : 0,
132
- maxOverlayHourly: isMaxAmountInProducts ? products.reduce(
133
- (acc, product) => acc + (product.noIteration ? 0 : (product.price - product.price * product.discount) * Math.max(product.maxAmount - product.amountFree, 0)),
134
- 0
135
- ) : 0,
136
- maxTotal: isMaxAmountInProducts ? products.reduce(
137
- (acc, product) => acc + calculatePrice({
138
- amount: product.maxAmount || product.amount,
139
- // Not all products have maxAmount, so we need to check both
140
- amountFree: product.amountFree,
141
- discount: product.discount,
142
- price: product.price,
143
- timeAmount: product.noIteration ? 1 : iteration.value,
144
- timeUnit: product.noIteration ? "hours" : iteration.unit
145
- }),
146
- 0
147
- ) : 0,
148
- overlayHourly: products.reduce(
149
- (acc, product) => acc + (product.noIteration ? 0 : (product.price - product.price * product.discount) * Math.max(product.amount - product.amountFree, 0)),
150
- 0
151
- ),
152
- total: hideTotal ? 0 : products.reduce(
153
- (acc, product) => acc + calculatePrice({
154
- amount: product.amount,
155
- amountFree: product.amountFree,
156
- discount: product.discount,
157
- price: product.price,
158
- timeAmount: product.noIteration ? 1 : iteration.value,
159
- timeUnit: product.noIteration ? "hours" : iteration.unit
160
- }),
161
- 0
162
- )
163
- });
164
- onTotalPriceChange?.({
165
- total: totalPrice.total,
166
- totalMax: totalPrice.maxTotal > 0 ? totalPrice.maxTotal : void 0
167
- });
168
- }, [
169
- hideTotal,
170
- products,
171
- iteration,
172
- setTotalPrice,
173
- onTotalPriceChange,
174
- totalPrice.total,
175
- totalPrice.maxTotal,
176
- totalValue,
177
- totalMaxValue
178
- ]);
179
- useEffect(() => {
180
- if (hideTimeUnit && (iteration.value > 1 || iteration.unit !== (defaultTimeUnit ?? "hours"))) {
181
- setIteration({ unit: defaultTimeUnit ?? "hours", value: 1 });
182
- }
183
- }, [hideTimeUnit, iteration, defaultTimeUnit]);
184
- return /* @__PURE__ */ jsxs(Fragment, { children: [
185
- compact ? /* @__PURE__ */ jsxs(
186
- Stack,
187
- {
188
- alignItems: "center",
189
- className: estimateCostCompact,
190
- direction: "row",
191
- justifyContent: "space-between",
192
- children: [
193
- /* @__PURE__ */ jsxs(Text, { as: "p", className: estimateCostCompactText, variant: "bodyStrong", children: [
194
- /* @__PURE__ */ jsx(CalculatorIcon, { sentiment: "primary", size: "medium" }),
195
- locales["estimate.cost.label"]
196
- ] }),
197
- /* @__PURE__ */ jsxs(Stack, { alignItems: "center", direction: "row", children: [
198
- /* @__PURE__ */ jsxs(Text, { as: "span", variant: "headingSmallStrong", children: [
199
- "",
200
- totalPrice.total
201
- ] }),
202
- /* @__PURE__ */ jsxs(Text, { as: "span", variant: "bodyStrong", children: [
203
- "/",
204
- iteration.unit.length > 1 && iteration.unit.endsWith("s") ? iteration.unit.slice(0, -1) : iteration.unit
205
- ] })
206
- ] })
207
- ]
208
- }
209
- ) : null,
210
- /* @__PURE__ */ jsxs(
211
- Stack,
212
- {
213
- className: estimateCostContent[compact ? "compact" : "default"],
214
- gap: 2,
215
- style,
216
- children: [
217
- hideOverlay ? null : /* @__PURE__ */ jsx(
218
- OverlayComponent,
219
- {
220
- disableOverlayLeft,
221
- disableOverlayRight,
222
- discount,
223
- inView,
224
- isBeta,
225
- OverlayLeft,
226
- OverlayRight,
227
- overlayMargin,
228
- totalPrice,
229
- unit: overlayUnit ?? "hours",
230
- children
231
- }
232
- ),
233
- description === false ? null : /* @__PURE__ */ jsx(DescriptionComponent, { description, locales }),
234
- alert ? /* @__PURE__ */ jsx(Alert, { sentiment: alertVariant, title: alertTitle, children: alert }) : null,
235
- /* @__PURE__ */ jsx(OverlayContextProvider, { value: providerValue, children: /* @__PURE__ */ jsxs("div", { children: [
236
- children ? /* @__PURE__ */ jsxs(
237
- "table",
238
- {
239
- cellPadding: "0",
240
- cellSpacing: "0",
241
- className: estimateCostTable[hideTotal ? "noTotal" : "total"],
242
- "data-testid": "summary",
243
- ref,
244
- children: [
245
- /* @__PURE__ */ jsxs("colgroup", { children: [
246
- /* @__PURE__ */ jsx("col", {}),
247
- /* @__PURE__ */ jsx("col", { className: estimateCostPriceColumn })
248
- ] }),
249
- hideTimeUnit ? null : /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { children: [
250
- /* @__PURE__ */ jsx("th", { children: /* @__PURE__ */ jsx(TitleComponent, { locales }) }),
251
- /* @__PURE__ */ jsx(
252
- "th",
253
- {
254
- className: cn(
255
- estimateCostPriceCellContent,
256
- estimateCostPriceCell
257
- ),
258
- children: /* @__PURE__ */ jsx("div", { className: estimateCostTimeCell, children: /* @__PURE__ */ jsx(
259
- CustomUnitInput,
260
- {
261
- defaultTimeUnit,
262
- iteration,
263
- setIteration,
264
- timeUnits
265
- }
266
- ) })
267
- }
268
- )
269
- ] }) }),
270
- /* @__PURE__ */ jsx("tbody", { children: Children.map(
271
- children,
272
- (child, index) => isValidElement(child) ? cloneElement(child, {
273
- discount: discount && !child.props.discount ? discount : child.props.discount,
274
- isLastElement: index === Children.count(children) - 1,
275
- iteration,
276
- productsCallback
277
- }) : child
278
- ) })
279
- ]
280
- }
281
- ) : null,
282
- hideTotal ? null : /* @__PURE__ */ jsxs(
283
- "table",
284
- {
285
- cellPadding: "0",
286
- cellSpacing: "0",
287
- className: estimateCostEmptyTable,
288
- children: [
289
- /* @__PURE__ */ jsxs("colgroup", { children: [
290
- /* @__PURE__ */ jsx("col", {}),
291
- /* @__PURE__ */ jsx("col", { className: estimateCostPriceColumn })
292
- ] }),
293
- /* @__PURE__ */ jsx("tbody", { children: /* @__PURE__ */ jsxs("tr", { children: [
294
- /* @__PURE__ */ jsx(
295
- "td",
296
- {
297
- "aria-label": "control",
298
- className: estimateCostEmptyCell
299
- }
300
- ),
301
- /* @__PURE__ */ jsxs(
302
- "td",
303
- {
304
- className: cn(
305
- estimateCostCell({ hasBorder: false, primary: false }),
306
- estimateCostTotalPriceCell
307
- ),
308
- style: assignInlineVars({
309
- [paddingLeftCell]: "16px"
310
- }),
311
- children: [
312
- isBeta ? /* @__PURE__ */ jsx(
313
- Badge,
314
- {
315
- className: estimateCostBadgeBeta[locales[`estimate.cost.beta.${discount > 0 ? "discount" : "free"}`].length > 25 ? "long" : "short"],
316
- prominence: "strong",
317
- sentiment: "warning",
318
- children: `${discount > 0 ? discount * 100 : ""}
8
+ import { estimateCostBadgeBeta, estimateCostCalculatorIcon, estimateCostCell, estimateCostCompact, estimateCostCompactText, estimateCostContent, estimateCostEmptyCell, estimateCostEmptyTable, estimateCostFeesTable, estimateCostPriceCell, estimateCostPriceCellContent, estimateCostPriceColumn, estimateCostTable, estimateCostText, estimateCostTimeCell, estimateCostTitle, estimateCostTotalPriceCell, estimatecostFeesText, paddingLeftCell } from "./styles.css.js";
9
+ import { Item } from "./Components/Item.js";
10
+ import { LineThrough } from "./Components/LineThrough.js";
11
+ import { CustomUnitInput } from "./Components/CustomUnitInput.js";
12
+ import { OverlayComponent } from "./OverlayComponent.js";
13
+ import { Alert, Badge, Stack, Text } from "@ultraviolet/ui";
14
+ import { cn } from "@ultraviolet/utils";
15
+ import { assignInlineVars } from "@vanilla-extract/dynamic";
16
+ import { Children, cloneElement, isValidElement, memo, useEffect, useMemo, useState } from "react";
17
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
18
+ import { CalculatorIcon } from "@ultraviolet/icons/CalculatorIcon";
19
+ import { useInView } from "react-intersection-observer";
20
+
21
+ //#region src/components/EstimateCost/EstimateCostContent.tsx
22
+ const DEFAULT_UNIT_LIST = [
23
+ "hours",
24
+ "days",
25
+ "months"
26
+ ];
27
+ const DescriptionComponent = memo(({ description, locales }) => description === void 0 || typeof description === "string" ? /* @__PURE__ */ jsx(Text, {
28
+ as: "span",
29
+ variant: "body",
30
+ children: description || locales["estimate.cost.description"]
31
+ }) : description);
32
+ const TitleComponent = memo(({ locales }) => /* @__PURE__ */ jsxs("h3", {
33
+ className: estimateCostTitle,
34
+ children: [/* @__PURE__ */ jsx(CalculatorIcon, {
35
+ className: estimateCostCalculatorIcon,
36
+ sentiment: "primary",
37
+ size: "medium"
38
+ }), locales === null || locales === void 0 ? void 0 : locales["estimate.cost.label"]]
39
+ }));
40
+ const EstimateCostContent = ({ description, alert, alertTitle, alertVariant = "warning", defaultTimeUnit = "hours", timeUnits = DEFAULT_UNIT_LIST, hideOverlay = false, disableOverlayLeft = false, disableOverlayRight = false, hideTimeUnit = false, hideTotal = false, hideHourlyPriceOnTotal = false, discount = 0, OverlayRight, OverlayLeft, isBeta = false, commitmentFees, commitmentFeesContent, monthlyFees, monthlyFeesLabel, monthlyFeesContent, overlayUnit = "hours", children = null, locales = en_default, overlayMargin, onTotalPriceChange, style, compact }) => {
41
+ const { formatNumber } = useEstimateCost();
42
+ const [ref, inView] = useInView();
43
+ const [products, setProducts] = useState([]);
44
+ const [totalPrice, setTotalPrice] = useState({
45
+ hourly: 0,
46
+ maxHourly: 0,
47
+ maxOverlayHourly: 0,
48
+ maxTotal: 0,
49
+ overlayHourly: 0,
50
+ total: 0
51
+ });
52
+ const [iteration, setIteration] = useState({
53
+ unit: defaultTimeUnit !== null && defaultTimeUnit !== void 0 ? defaultTimeUnit : "hours",
54
+ value: 1
55
+ });
56
+ const [isLongFractionDigits, setIsLongFractionDigits] = useState(false);
57
+ const providerValue = useMemo(() => ({ isOverlay: false }), []);
58
+ const totalValue = useMemo(() => formatNumber(totalPrice.total < 0 ? 0 : totalPrice.total, { maximumFractionDigits: isLongFractionDigits ? maximumFractionDigitsLong[iteration.unit] : maximumFractionDigits[iteration.unit] }), [
59
+ formatNumber,
60
+ isLongFractionDigits,
61
+ iteration.unit,
62
+ totalPrice.total
63
+ ]);
64
+ const totalMaxValue = useMemo(() => formatNumber(totalPrice.maxTotal < 0 ? 0 : totalPrice.maxTotal, { maximumFractionDigits: isLongFractionDigits ? maximumFractionDigitsLong[iteration.unit] : maximumFractionDigits[iteration.unit] }), [
65
+ formatNumber,
66
+ isLongFractionDigits,
67
+ iteration.unit,
68
+ totalPrice.maxTotal
69
+ ]);
70
+ const productsCallback = useMemo(() => ({
71
+ add: (newProduct) => {
72
+ setProducts((total) => {
73
+ if (total.find((product) => product.id === newProduct.id)) return total.map((product) => product.id === newProduct.id ? newProduct : product);
74
+ return [...total, newProduct];
75
+ });
76
+ },
77
+ remove: ({ id }) => {
78
+ setProducts((total) => total.filter((product) => product.id !== id));
79
+ }
80
+ }), [setProducts]);
81
+ useEffect(() => {
82
+ const isMaxAmountInProducts = products.find((product) => product.maxAmount);
83
+ setIsLongFractionDigits(!!products.find((product) => product.longFractionDigits));
84
+ setTotalPrice({
85
+ hourly: products.reduce((acc, product) => acc + (product.noIteration ? 0 : (product.price - product.price * product.discount) * Math.max(product.amount - product.amountFree, 0)), 0),
86
+ maxHourly: isMaxAmountInProducts ? products.reduce((acc, product) => acc && product.noIteration ? 0 : (product.price - product.price * product.discount) * Math.max(product.maxAmount - product.amountFree, 0), 0) : 0,
87
+ maxOverlayHourly: isMaxAmountInProducts ? products.reduce((acc, product) => acc + (product.noIteration ? 0 : (product.price - product.price * product.discount) * Math.max(product.maxAmount - product.amountFree, 0)), 0) : 0,
88
+ maxTotal: isMaxAmountInProducts ? products.reduce((acc, product) => acc + calculatePrice({
89
+ amount: product.maxAmount || product.amount,
90
+ amountFree: product.amountFree,
91
+ discount: product.discount,
92
+ price: product.price,
93
+ timeAmount: product.noIteration ? 1 : iteration.value,
94
+ timeUnit: product.noIteration ? "hours" : iteration.unit
95
+ }), 0) : 0,
96
+ overlayHourly: products.reduce((acc, product) => acc + (product.noIteration ? 0 : (product.price - product.price * product.discount) * Math.max(product.amount - product.amountFree, 0)), 0),
97
+ total: hideTotal ? 0 : products.reduce((acc, product) => acc + calculatePrice({
98
+ amount: product.amount,
99
+ amountFree: product.amountFree,
100
+ discount: product.discount,
101
+ price: product.price,
102
+ timeAmount: product.noIteration ? 1 : iteration.value,
103
+ timeUnit: product.noIteration ? "hours" : iteration.unit
104
+ }), 0)
105
+ });
106
+ onTotalPriceChange === null || onTotalPriceChange === void 0 || onTotalPriceChange({
107
+ total: totalPrice.total,
108
+ totalMax: totalPrice.maxTotal > 0 ? totalPrice.maxTotal : void 0
109
+ });
110
+ }, [
111
+ hideTotal,
112
+ products,
113
+ iteration,
114
+ setTotalPrice,
115
+ onTotalPriceChange,
116
+ totalPrice.total,
117
+ totalPrice.maxTotal,
118
+ totalValue,
119
+ totalMaxValue
120
+ ]);
121
+ useEffect(() => {
122
+ if (hideTimeUnit && (iteration.value > 1 || iteration.unit !== (defaultTimeUnit !== null && defaultTimeUnit !== void 0 ? defaultTimeUnit : "hours"))) setIteration({
123
+ unit: defaultTimeUnit !== null && defaultTimeUnit !== void 0 ? defaultTimeUnit : "hours",
124
+ value: 1
125
+ });
126
+ }, [
127
+ hideTimeUnit,
128
+ iteration,
129
+ defaultTimeUnit
130
+ ]);
131
+ return /* @__PURE__ */ jsxs(Fragment, { children: [compact ? /* @__PURE__ */ jsxs(Stack, {
132
+ alignItems: "center",
133
+ className: estimateCostCompact,
134
+ direction: "row",
135
+ justifyContent: "space-between",
136
+ children: [/* @__PURE__ */ jsxs(Text, {
137
+ as: "p",
138
+ className: estimateCostCompactText,
139
+ variant: "bodyStrong",
140
+ children: [/* @__PURE__ */ jsx(CalculatorIcon, {
141
+ sentiment: "primary",
142
+ size: "medium"
143
+ }), locales["estimate.cost.label"]]
144
+ }), /* @__PURE__ */ jsxs(Stack, {
145
+ alignItems: "center",
146
+ direction: "row",
147
+ children: [/* @__PURE__ */ jsxs(Text, {
148
+ as: "span",
149
+ variant: "headingSmallStrong",
150
+ children: ["€", totalPrice.total]
151
+ }), /* @__PURE__ */ jsxs(Text, {
152
+ as: "span",
153
+ variant: "bodyStrong",
154
+ children: ["/", iteration.unit.length > 1 && iteration.unit.endsWith("s") ? iteration.unit.slice(0, -1) : iteration.unit]
155
+ })]
156
+ })]
157
+ }) : null, /* @__PURE__ */ jsxs(Stack, {
158
+ className: estimateCostContent[compact ? "compact" : "default"],
159
+ gap: 2,
160
+ style,
161
+ children: [
162
+ hideOverlay ? null : /* @__PURE__ */ jsx(OverlayComponent, {
163
+ disableOverlayLeft,
164
+ disableOverlayRight,
165
+ discount,
166
+ inView,
167
+ isBeta,
168
+ OverlayLeft,
169
+ OverlayRight,
170
+ overlayMargin,
171
+ totalPrice,
172
+ unit: overlayUnit !== null && overlayUnit !== void 0 ? overlayUnit : "hours",
173
+ children
174
+ }),
175
+ description === false ? null : /* @__PURE__ */ jsx(DescriptionComponent, {
176
+ description,
177
+ locales
178
+ }),
179
+ alert ? /* @__PURE__ */ jsx(Alert, {
180
+ sentiment: alertVariant,
181
+ title: alertTitle,
182
+ children: alert
183
+ }) : null,
184
+ /* @__PURE__ */ jsx(OverlayContextProvider, {
185
+ value: providerValue,
186
+ children: /* @__PURE__ */ jsxs("div", { children: [
187
+ children ? /* @__PURE__ */ jsxs("table", {
188
+ cellPadding: "0",
189
+ cellSpacing: "0",
190
+ className: estimateCostTable[hideTotal ? "noTotal" : "total"],
191
+ "data-testid": "summary",
192
+ ref,
193
+ children: [
194
+ /* @__PURE__ */ jsxs("colgroup", { children: [/* @__PURE__ */ jsx("col", {}), /* @__PURE__ */ jsx("col", { className: estimateCostPriceColumn })] }),
195
+ hideTimeUnit ? null : /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { children: [/* @__PURE__ */ jsx("th", { children: /* @__PURE__ */ jsx(TitleComponent, { locales }) }), /* @__PURE__ */ jsx("th", {
196
+ className: cn(estimateCostPriceCellContent, estimateCostPriceCell),
197
+ children: /* @__PURE__ */ jsx("div", {
198
+ className: estimateCostTimeCell,
199
+ children: /* @__PURE__ */ jsx(CustomUnitInput, {
200
+ defaultTimeUnit,
201
+ iteration,
202
+ setIteration,
203
+ timeUnits
204
+ })
205
+ })
206
+ })] }) }),
207
+ /* @__PURE__ */ jsx("tbody", { children: Children.map(children, (child, index) => isValidElement(child) ? cloneElement(child, {
208
+ discount: discount && !child.props.discount ? discount : child.props.discount,
209
+ isLastElement: index === Children.count(children) - 1,
210
+ iteration,
211
+ productsCallback
212
+ }) : child) })
213
+ ]
214
+ }) : null,
215
+ hideTotal ? null : /* @__PURE__ */ jsxs("table", {
216
+ cellPadding: "0",
217
+ cellSpacing: "0",
218
+ className: estimateCostEmptyTable,
219
+ children: [/* @__PURE__ */ jsxs("colgroup", { children: [/* @__PURE__ */ jsx("col", {}), /* @__PURE__ */ jsx("col", { className: estimateCostPriceColumn })] }), /* @__PURE__ */ jsx("tbody", { children: /* @__PURE__ */ jsxs("tr", { children: [/* @__PURE__ */ jsx("td", {
220
+ "aria-label": "control",
221
+ className: estimateCostEmptyCell
222
+ }), /* @__PURE__ */ jsxs("td", {
223
+ className: cn(estimateCostCell({
224
+ hasBorder: false,
225
+ primary: false
226
+ }), estimateCostTotalPriceCell),
227
+ style: assignInlineVars({ [paddingLeftCell]: "16px" }),
228
+ children: [
229
+ isBeta ? /* @__PURE__ */ jsx(Badge, {
230
+ className: estimateCostBadgeBeta[locales[`estimate.cost.beta.${discount > 0 ? "discount" : "free"}`].length > 25 ? "long" : "short"],
231
+ prominence: "strong",
232
+ sentiment: "warning",
233
+ children: `${discount > 0 ? discount * 100 : ""}
319
234
  ${locales[`estimate.cost.beta.${discount > 0 ? "discount" : "free"}`]}`
320
- }
321
- ) : null,
322
- /* @__PURE__ */ jsx(
323
- Text,
324
- {
325
- as: "h3",
326
- className: estimateCostText[isBeta ? "beta" : "notBeta"],
327
- sentiment: "primary",
328
- variant: "heading",
329
- children: /* @__PURE__ */ jsxs(
330
- LineThrough,
331
- {
332
- isActive: isBeta && (discount === 0 || discount >= 1),
333
- children: [
334
- totalValue,
335
- totalPrice.maxTotal > 0 ? ` - ${totalMaxValue}` : null
336
- ]
337
- }
338
- )
339
- }
340
- ),
341
- hideHourlyPriceOnTotal && totalPrice.hourly > 0 && totalPrice.hourly !== totalPrice.total && totalPrice.total > 0 ? /* @__PURE__ */ jsx(Text, { as: "p", placement: "right", variant: "body", children: /* @__PURE__ */ jsxs(
342
- LineThrough,
343
- {
344
- isActive: isBeta && (discount === 0 || discount >= 1),
345
- children: [
346
- formatNumber(totalPrice.hourly, {
347
- maximumFractionDigits: isLongFractionDigits ? maximumFractionDigitsLong.hours : maximumFractionDigits.hours
348
- }),
349
- totalPrice.maxHourly > 0 ? ` - ${formatNumber(totalPrice.maxHourly, {
350
- maximumFractionDigits: isLongFractionDigits ? maximumFractionDigitsLong.hours : maximumFractionDigits.hours
351
- })}` : null,
352
- "/",
353
- locales["estimate.cost.units.hours.label"].toLowerCase()
354
- ]
355
- }
356
- ) }) : null
357
- ]
358
- }
359
- )
360
- ] }) })
361
- ]
362
- }
363
- ),
364
- commitmentFees !== void 0 || monthlyFees !== void 0 ? /* @__PURE__ */ jsxs(Fragment, { children: [
365
- /* @__PURE__ */ jsx(
366
- Text,
367
- {
368
- as: "h3",
369
- className: estimatecostFeesText,
370
- variant: "headingSmall",
371
- children: locales[`estimate.cost.fees.${commitmentFees ? "oneTime" : "monthly"}.title`]
372
- }
373
- ),
374
- /* @__PURE__ */ jsx("table", { className: estimateCostFeesTable, children: /* @__PURE__ */ jsx("tbody", { children: /* @__PURE__ */ jsx(
375
- Item,
376
- {
377
- isLastElement: true,
378
- label: commitmentFees ? locales["estimate.cost.fees.commitment"] : monthlyFeesLabel,
379
- noIteration: true,
380
- price: commitmentFees || monthlyFees,
381
- productsCallback: {
382
- add: () => {
383
- },
384
- remove: () => {
385
- }
386
- },
387
- children: commitmentFees ? commitmentFeesContent : monthlyFeesContent
388
- }
389
- ) }) })
390
- ] }) : null
391
- ] }) })
392
- ]
393
- }
394
- )
395
- ] });
396
- };
397
- export {
398
- EstimateCostContent
235
+ }) : null,
236
+ /* @__PURE__ */ jsx(Text, {
237
+ as: "h3",
238
+ className: estimateCostText[isBeta ? "beta" : "notBeta"],
239
+ sentiment: "primary",
240
+ variant: "heading",
241
+ children: /* @__PURE__ */ jsxs(LineThrough, {
242
+ isActive: isBeta && (discount === 0 || discount >= 1),
243
+ children: [totalValue, totalPrice.maxTotal > 0 ? ` - ${totalMaxValue}` : null]
244
+ })
245
+ }),
246
+ hideHourlyPriceOnTotal && totalPrice.hourly > 0 && totalPrice.hourly !== totalPrice.total && totalPrice.total > 0 ? /* @__PURE__ */ jsx(Text, {
247
+ as: "p",
248
+ placement: "right",
249
+ variant: "body",
250
+ children: /* @__PURE__ */ jsxs(LineThrough, {
251
+ isActive: isBeta && (discount === 0 || discount >= 1),
252
+ children: [
253
+ formatNumber(totalPrice.hourly, { maximumFractionDigits: isLongFractionDigits ? maximumFractionDigitsLong.hours : maximumFractionDigits.hours }),
254
+ totalPrice.maxHourly > 0 ? ` - ${formatNumber(totalPrice.maxHourly, { maximumFractionDigits: isLongFractionDigits ? maximumFractionDigitsLong.hours : maximumFractionDigits.hours })}` : null,
255
+ "/",
256
+ locales["estimate.cost.units.hours.label"].toLowerCase()
257
+ ]
258
+ })
259
+ }) : null
260
+ ]
261
+ })] }) })]
262
+ }),
263
+ commitmentFees !== void 0 || monthlyFees !== void 0 ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Text, {
264
+ as: "h3",
265
+ className: estimatecostFeesText,
266
+ variant: "headingSmall",
267
+ children: locales[`estimate.cost.fees.${commitmentFees ? "oneTime" : "monthly"}.title`]
268
+ }), /* @__PURE__ */ jsx("table", {
269
+ className: estimateCostFeesTable,
270
+ children: /* @__PURE__ */ jsx("tbody", { children: /* @__PURE__ */ jsx(Item, {
271
+ isLastElement: true,
272
+ label: commitmentFees ? locales["estimate.cost.fees.commitment"] : monthlyFeesLabel,
273
+ noIteration: true,
274
+ price: commitmentFees || monthlyFees,
275
+ productsCallback: {
276
+ add: () => {},
277
+ remove: () => {}
278
+ },
279
+ children: commitmentFees ? commitmentFeesContent : monthlyFeesContent
280
+ }) })
281
+ })] }) : null
282
+ ] })
283
+ })
284
+ ]
285
+ })] });
399
286
  };
287
+
288
+ //#endregion
289
+ export { EstimateCostContent };