@ultraviolet/plus 3.0.0-beta.16 → 3.0.0-beta.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.
Files changed (109) hide show
  1. package/dist/components/CodeEditor/CodeEditor.d.ts +1 -1
  2. package/dist/components/CodeEditor/CodeEditor.js +41 -11
  3. package/dist/components/ContentCard/Skeleton.d.ts +1 -1
  4. package/dist/components/ContentCard/Skeleton.js +13 -8
  5. package/dist/components/ContentCard/index.js +131 -51
  6. package/dist/components/ContentCardGroup/Card.js +63 -22
  7. package/dist/components/ContentCardGroup/SkeletonCard.d.ts +1 -1
  8. package/dist/components/ContentCardGroup/SkeletonCard.js +1 -1
  9. package/dist/components/ContentCardGroup/index.js +11 -6
  10. package/dist/components/ContentCardGroup/styles.css.js +1 -0
  11. package/dist/components/Conversation/index.d.ts +9 -9
  12. package/dist/components/Conversation/index.js +23 -6
  13. package/dist/components/CustomerSatisfaction/index.d.ts +1 -1
  14. package/dist/components/CustomerSatisfaction/index.js +68 -39
  15. package/dist/components/EstimateCost/Components/CustomUnitInput.d.ts +1 -1
  16. package/dist/components/EstimateCost/Components/CustomUnitInput.js +47 -27
  17. package/dist/components/EstimateCost/Components/Item.d.ts +1 -1
  18. package/dist/components/EstimateCost/Components/Item.js +303 -203
  19. package/dist/components/EstimateCost/Components/LineThrough.d.ts +1 -1
  20. package/dist/components/EstimateCost/Components/LineThrough.js +8 -2
  21. package/dist/components/EstimateCost/Components/NumberInput.d.ts +1 -1
  22. package/dist/components/EstimateCost/Components/NumberInput.js +17 -9
  23. package/dist/components/EstimateCost/Components/Region.d.ts +1 -1
  24. package/dist/components/EstimateCost/Components/Region.js +43 -25
  25. package/dist/components/EstimateCost/Components/Regular.d.ts +1 -1
  26. package/dist/components/EstimateCost/Components/Regular.js +20 -16
  27. package/dist/components/EstimateCost/Components/Strong.d.ts +1 -1
  28. package/dist/components/EstimateCost/Components/Strong.js +11 -10
  29. package/dist/components/EstimateCost/Components/Unit.d.ts +1 -1
  30. package/dist/components/EstimateCost/Components/Unit.js +20 -13
  31. package/dist/components/EstimateCost/Components/Zone.d.ts +1 -1
  32. package/dist/components/EstimateCost/Components/Zone.js +41 -24
  33. package/dist/components/EstimateCost/EstimateCost.d.ts +11 -11
  34. package/dist/components/EstimateCost/EstimateCost.js +61 -10
  35. package/dist/components/EstimateCost/EstimateCostContent.d.ts +1 -1
  36. package/dist/components/EstimateCost/EstimateCostContent.js +264 -120
  37. package/dist/components/EstimateCost/EstimateCostProvider.d.ts +1 -1
  38. package/dist/components/EstimateCost/EstimateCostProvider.js +24 -21
  39. package/dist/components/EstimateCost/OverlayComponent.d.ts +1 -1
  40. package/dist/components/EstimateCost/OverlayComponent.js +53 -41
  41. package/dist/components/EstimateCost/OverlayContext.d.ts +1 -1
  42. package/dist/components/EstimateCost/OverlayContext.js +2 -4
  43. package/dist/components/FAQ/index.d.ts +1 -1
  44. package/dist/components/FAQ/index.js +1 -1
  45. package/dist/components/InfoTable/InfoTable.d.ts +3 -3
  46. package/dist/components/InfoTable/InfoTable.js +10 -4
  47. package/dist/components/InfoTable/components/Cell.d.ts +1 -1
  48. package/dist/components/InfoTable/components/Cell.js +24 -4
  49. package/dist/components/InfoTable/components/Row.d.ts +1 -1
  50. package/dist/components/InfoTable/components/Row.js +16 -10
  51. package/dist/components/InfoTable/styles.css.d.ts +0 -1
  52. package/dist/components/InfoTable/styles.css.js +0 -2
  53. package/dist/components/Navigation/Footer.d.ts +1 -1
  54. package/dist/components/Navigation/Footer.js +34 -19
  55. package/dist/components/Navigation/Header.d.ts +1 -1
  56. package/dist/components/Navigation/Header.js +12 -9
  57. package/dist/components/Navigation/Navigation.d.ts +5 -5
  58. package/dist/components/Navigation/Navigation.js +2 -5
  59. package/dist/components/Navigation/NavigationContent.d.ts +1 -1
  60. package/dist/components/Navigation/NavigationContent.js +56 -18
  61. package/dist/components/Navigation/NavigationProvider.d.ts +1 -1
  62. package/dist/components/Navigation/NavigationProvider.js +108 -70
  63. package/dist/components/Navigation/components/Group.d.ts +1 -1
  64. package/dist/components/Navigation/components/Group.js +20 -19
  65. package/dist/components/Navigation/components/Item.d.ts +1 -1
  66. package/dist/components/Navigation/components/Item.js +551 -254
  67. package/dist/components/Navigation/components/ItemProvider.d.ts +1 -1
  68. package/dist/components/Navigation/components/ItemProvider.js +2 -4
  69. package/dist/components/Navigation/components/PinnedItems.d.ts +1 -1
  70. package/dist/components/Navigation/components/PinnedItems.js +91 -37
  71. package/dist/components/Navigation/components/Separator.d.ts +1 -1
  72. package/dist/components/Navigation/components/Separator.js +1 -1
  73. package/dist/components/Navigation/styles.css.js +0 -1
  74. package/dist/components/Navigation/variables.css.js +1 -0
  75. package/dist/components/OfferList/OfferList.d.ts +3 -3
  76. package/dist/components/OfferList/OfferList.js +41 -9
  77. package/dist/components/OfferList/OfferListProvider.d.ts +1 -1
  78. package/dist/components/OfferList/OfferListProvider.js +25 -15
  79. package/dist/components/OfferList/components/Banner.d.ts +1 -1
  80. package/dist/components/OfferList/components/Banner.js +30 -8
  81. package/dist/components/OfferList/components/Cell.d.ts +1 -1
  82. package/dist/components/OfferList/components/Cell.js +12 -5
  83. package/dist/components/OfferList/components/Row.d.ts +1 -1
  84. package/dist/components/OfferList/components/Row.js +135 -42
  85. package/dist/components/OrderSummary/NonScrollableContent.d.ts +1 -1
  86. package/dist/components/OrderSummary/NonScrollableContent.js +68 -22
  87. package/dist/components/OrderSummary/Provider.js +1 -4
  88. package/dist/components/OrderSummary/ScrollableContent.d.ts +1 -1
  89. package/dist/components/OrderSummary/ScrollableContent.js +174 -33
  90. package/dist/components/OrderSummary/constants.js +7 -1
  91. package/dist/components/OrderSummary/helpers.js +36 -18
  92. package/dist/components/OrderSummary/index.d.ts +1 -1
  93. package/dist/components/OrderSummary/index.js +135 -48
  94. package/dist/components/Plans/FeatureHint.d.ts +1 -1
  95. package/dist/components/Plans/FeatureHint.js +26 -8
  96. package/dist/components/Plans/PlanHeader.d.ts +1 -1
  97. package/dist/components/Plans/PlanHeader.js +79 -25
  98. package/dist/components/Plans/index.d.ts +1 -1
  99. package/dist/components/Plans/index.js +142 -53
  100. package/dist/components/Plans/styles.css.js +0 -1
  101. package/dist/components/SteppedListCard/Step.d.ts +1 -1
  102. package/dist/components/SteppedListCard/Step.js +42 -2
  103. package/dist/components/SteppedListCard/SteppedListCard.d.ts +2 -2
  104. package/dist/components/SteppedListCard/SteppedListCard.js +66 -19
  105. package/dist/components/SteppedListCard/SteppedListContent.d.ts +1 -1
  106. package/dist/components/SteppedListCard/SteppedListContent.js +13 -11
  107. package/dist/components/SteppedListCard/helper.js +3 -1
  108. package/dist/plus.css +1 -1
  109. package/package.json +6 -6
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { jsxs, jsx, Fragment } from "@emotion/react/jsx-runtime";
2
+ import { jsxs, jsx, Fragment } from "react/jsx-runtime";
3
3
  import { HelpCircleOutlineIcon } from "@ultraviolet/icons";
4
4
  import { Stack, Text, Tooltip, Badge } from "@ultraviolet/ui";
5
5
  import { assignInlineVars } from "@vanilla-extract/dynamic";
@@ -10,212 +10,312 @@ import { calculatePrice } from "../helper.js";
10
10
  import { useOverlay } from "../OverlayContext.js";
11
11
  import { estimateCostOverlayRow, estimateCostCell, paddingLeftCell, estimateCostPriceCell } from "../styles.css.js";
12
12
  import { estimateCostTr, estimateCostLeftSide, styledDiv, estimateCostTooltip, estimateCostTextItem, estimateCostBadgeItem, estimateCostMaxWidthText, estimateCostResourceName } from "./components.css.js";
13
- const TIME_RELATED_UNIT = ["seconds", "minutes", "hours", "days", "months"];
14
- const Item = memo(({
15
- discount = 0,
16
- priceText,
17
- discountText,
18
- label,
19
- tooltipInfo,
20
- // Shows an icon with tooltip that contains this text
21
- subLabel = "",
22
- // Usually used for showing amount that is free
23
- price: basePrice = 0,
24
- // Hourly price for one unit
25
- monthlyPrice = 0,
26
- // Price per month
27
- unit: baseUnit,
28
- // Can be GB, MB, Node, Queries, etc.
29
- amount: currentAmount = 1,
30
- // Current number of items
31
- onAmountChange,
32
- amountFree = 0,
33
- // Amount that is free - offered by company
34
- maxAmount = 0,
35
- // Max amount - used for kubernetes for example
36
- longFractionDigits = false,
37
- // In case price is really long 0.0000076 - up 7 fraction digits
38
- noIteration = false,
39
- // if item is not based on time (ex: download, upload, transfer)
40
- noIterationText,
41
- noBorder,
42
- // remove the border bottom of the item
43
- noPrice,
44
- // remove the price on right side of the table
45
- isDefined = true,
46
- children = null,
47
- isFirstElement = false,
48
- isLastElement = false,
49
- isPrimaryBackground = false,
50
- productsCallback,
51
- iteration: receivedIteration,
52
- // Object from parent that contains time period (hours, days, months)
53
- shouldBeHidden = false,
54
- // Hide element from overlay if screen width is small
55
- hideFromOverlay = false,
56
- // Hide element from overlay in any case
57
- textNotDefined,
58
- // Text to display in case of not defined value
59
- animated = false,
60
- // if true, zoomIn animation is triggered
61
- tabulation,
62
- // Increase left padding of the item
63
- labelTextVariant,
64
- // To change left cell typography variant
65
- labelTextProminence,
66
- // To change left cell typography prominence
67
- notice,
68
- // To display a gray text below the label
69
- strikeThrough,
70
- // To strike through the price
71
- style
72
- }) => {
73
- const {
74
- locales,
75
- formatNumber
76
- } = useEstimateCost();
77
- let iteration;
78
- if (noIteration) {
79
- iteration = {
80
- ...receivedIteration ?? {
81
- value: 0
82
- },
83
- unit: "hours"
84
- };
85
- } else {
86
- iteration = receivedIteration;
87
- }
88
- const price = useMemo(() => {
89
- if (monthlyPrice && basePrice === 0) {
90
- return monthlyPrice / multiplier.months;
91
- }
92
- return basePrice;
93
- }, [basePrice, monthlyPrice]);
94
- const unit = useMemo(() => {
95
- if (!baseUnit) {
96
- return locales["estimate.cost.units.gb.label"];
13
+ const TIME_RELATED_UNIT = [
14
+ "seconds",
15
+ "minutes",
16
+ "hours",
17
+ "days",
18
+ "months"
19
+ ];
20
+ const Item = memo(
21
+ ({
22
+ discount = 0,
23
+ priceText,
24
+ discountText,
25
+ label,
26
+ tooltipInfo,
27
+ // Shows an icon with tooltip that contains this text
28
+ subLabel = "",
29
+ // Usually used for showing amount that is free
30
+ price: basePrice = 0,
31
+ // Hourly price for one unit
32
+ monthlyPrice = 0,
33
+ // Price per month
34
+ unit: baseUnit,
35
+ // Can be GB, MB, Node, Queries, etc.
36
+ amount: currentAmount = 1,
37
+ // Current number of items
38
+ onAmountChange,
39
+ amountFree = 0,
40
+ // Amount that is free - offered by company
41
+ maxAmount = 0,
42
+ // Max amount - used for kubernetes for example
43
+ longFractionDigits = false,
44
+ // In case price is really long 0.0000076 - up 7 fraction digits
45
+ noIteration = false,
46
+ // if item is not based on time (ex: download, upload, transfer)
47
+ noIterationText,
48
+ noBorder,
49
+ // remove the border bottom of the item
50
+ noPrice,
51
+ // remove the price on right side of the table
52
+ isDefined = true,
53
+ children = null,
54
+ isFirstElement = false,
55
+ isLastElement = false,
56
+ isPrimaryBackground = false,
57
+ productsCallback,
58
+ iteration: receivedIteration,
59
+ // Object from parent that contains time period (hours, days, months)
60
+ shouldBeHidden = false,
61
+ // Hide element from overlay if screen width is small
62
+ hideFromOverlay = false,
63
+ // Hide element from overlay in any case
64
+ textNotDefined,
65
+ // Text to display in case of not defined value
66
+ animated = false,
67
+ // if true, zoomIn animation is triggered
68
+ tabulation,
69
+ // Increase left padding of the item
70
+ labelTextVariant,
71
+ // To change left cell typography variant
72
+ labelTextProminence,
73
+ // To change left cell typography prominence
74
+ notice,
75
+ // To display a gray text below the label
76
+ strikeThrough,
77
+ // To strike through the price
78
+ style
79
+ }) => {
80
+ const { locales, formatNumber } = useEstimateCost();
81
+ let iteration;
82
+ if (noIteration) {
83
+ iteration = {
84
+ ...receivedIteration ?? { value: 0 },
85
+ unit: "hours"
86
+ };
87
+ } else {
88
+ iteration = receivedIteration;
97
89
  }
98
- return baseUnit;
99
- }, [baseUnit, locales]);
100
- const {
101
- isOverlay
102
- } = useOverlay();
103
- const Row = isOverlay ? "li" : "tr";
104
- const Cell = isOverlay ? "div" : "td";
105
- const LeftSide = "div";
106
- const [amount, setAmount] = useState(currentAmount);
107
- const [isVariant, setIsVariant] = useState(false);
108
- useEffect(() => setAmount(currentAmount), [setAmount, currentAmount]);
109
- useEffect(() => onAmountChange?.(amount), [onAmountChange, amount]);
110
- const itemCallback = useCallback((localAmount, localIsVariant) => {
111
- setAmount(localAmount);
112
- setIsVariant(localIsVariant);
113
- }, [setAmount, setIsVariant]);
114
- const id = useId();
115
- useEffect(() => () => productsCallback?.remove({
116
- id
117
- }), [id, productsCallback]);
118
- useEffect(() => {
119
- if (!isOverlay) {
120
- productsCallback?.add({
90
+ const price = useMemo(() => {
91
+ if (monthlyPrice && basePrice === 0) {
92
+ return monthlyPrice / multiplier.months;
93
+ }
94
+ return basePrice;
95
+ }, [basePrice, monthlyPrice]);
96
+ const unit = useMemo(() => {
97
+ if (!baseUnit) {
98
+ return locales["estimate.cost.units.gb.label"];
99
+ }
100
+ return baseUnit;
101
+ }, [baseUnit, locales]);
102
+ const { isOverlay } = useOverlay();
103
+ const Row = isOverlay ? "li" : "tr";
104
+ const Cell = isOverlay ? "div" : "td";
105
+ const LeftSide = "div";
106
+ const [amount, setAmount] = useState(currentAmount);
107
+ const [isVariant, setIsVariant] = useState(false);
108
+ useEffect(() => setAmount(currentAmount), [setAmount, currentAmount]);
109
+ useEffect(() => onAmountChange?.(amount), [onAmountChange, amount]);
110
+ const itemCallback = useCallback(
111
+ (localAmount, localIsVariant) => {
112
+ setAmount(localAmount);
113
+ setIsVariant(localIsVariant);
114
+ },
115
+ [setAmount, setIsVariant]
116
+ );
117
+ const id = useId();
118
+ useEffect(
119
+ () => () => productsCallback?.remove({ id }),
120
+ [id, productsCallback]
121
+ );
122
+ useEffect(() => {
123
+ if (!isOverlay) {
124
+ productsCallback?.add({
125
+ amount,
126
+ amountFree,
127
+ discount,
128
+ id,
129
+ isVariant,
130
+ longFractionDigits,
131
+ maxAmount,
132
+ noIteration,
133
+ price
134
+ });
135
+ }
136
+ }, [
137
+ price,
138
+ discount,
139
+ amount,
140
+ id,
141
+ productsCallback,
142
+ maxAmount,
143
+ noIteration,
144
+ isVariant,
145
+ amountFree,
146
+ isOverlay,
147
+ longFractionDigits
148
+ ]);
149
+ const computedItemPrice = useMemo(
150
+ () => calculatePrice({
121
151
  amount,
122
152
  amountFree,
123
153
  discount,
124
- id,
125
- isVariant,
126
- longFractionDigits,
127
- maxAmount,
128
- noIteration,
129
- price
130
- });
131
- }
132
- }, [price, discount, amount, id, productsCallback, maxAmount, noIteration, isVariant, amountFree, isOverlay, longFractionDigits]);
133
- const computedItemPrice = useMemo(() => calculatePrice({
134
- amount,
135
- amountFree,
136
- discount,
137
- price,
138
- timeAmount: noIteration ? 1 : iteration?.value ?? 1,
139
- timeUnit: noIteration ? "hours" : iteration?.unit ?? "hours"
140
- }), [price, amount, amountFree, iteration, noIteration, discount]);
141
- const computedMaxItemPrice = useMemo(() => calculatePrice({
142
- amount: maxAmount,
143
- amountFree,
144
- discount,
145
- price,
146
- timeAmount: noIteration ? 1 : iteration?.value ?? 1,
147
- timeUnit: noIteration ? "hours" : iteration?.unit ?? "hours"
148
- }), [price, maxAmount, amountFree, iteration, noIteration, discount]);
149
- const formatMaximumFractionDigits = useMemo(() => {
150
- if (!iteration?.unit) {
151
- return void 0;
152
- }
153
- return longFractionDigits ? maximumFractionDigitsLong[iteration?.unit] : maximumFractionDigits[iteration?.unit];
154
- }, [iteration?.unit, longFractionDigits]);
155
- return /* @__PURE__ */ jsxs(Row, { className: isOverlay ? estimateCostOverlayRow({
156
- hideFromOverlay,
157
- isFirstElement,
158
- shouldBeHidden
159
- }) : estimateCostTr, style, children: [
160
- /* @__PURE__ */ jsx(Cell, { className: estimateCostCell({
161
- hasBorder: !isLastElement && !noBorder && !isOverlay
162
- }), style: assignInlineVars({
163
- [paddingLeftCell]: `${(tabulation ?? 0) * 8 + 16}px`
164
- }), children: /* @__PURE__ */ jsxs(LeftSide, { className: isOverlay ? "" : estimateCostLeftSide, children: [
165
- /* @__PURE__ */ jsxs(Stack, { children: [
166
- /* @__PURE__ */ jsxs(Stack, { direction: "row", children: [
167
- /* @__PURE__ */ jsx(Text, { as: "p", prominence: labelTextProminence ?? "default", variant: labelTextVariant ?? "body", children: label }),
168
- tooltipInfo ? /* @__PURE__ */ jsx("div", { className: styledDiv, children: /* @__PURE__ */ jsx(Tooltip, { className: estimateCostTooltip, text: tooltipInfo, children: /* @__PURE__ */ jsx(HelpCircleOutlineIcon, { size: "medium" }) }) }) : null,
169
- subLabel && !isOverlay ? /* @__PURE__ */ jsx(Text, { as: "p", className: estimateCostTextItem, italic: true, sentiment: "primary", variant: "body", children: subLabel }) : null,
170
- discount > 0 && discountText ? /* @__PURE__ */ jsx(Badge, { className: estimateCostBadgeItem, prominence: "strong", sentiment: "warning", size: "small", children: discountText }) : null
171
- ] }),
172
- notice ? /* @__PURE__ */ jsx(Text, { as: "p", className: estimateCostMaxWidthText, prominence: "weak", variant: "caption", children: notice }) : null
173
- ] }),
174
- /* @__PURE__ */ jsx("div", { className: estimateCostResourceName({
175
- isAnimated: isOverlay && animated,
176
- isOverlay
177
- }), children: isDefined ? Children.map(children, (child) => isValidElement(child) ? cloneElement(child, {
178
- amount,
179
- itemCallback,
180
- maxAmount,
181
- unit
182
- }) : null) : textNotDefined || locales["estimate.cost.notDefined"] })
183
- ] }) }),
184
- !isOverlay ? /* @__PURE__ */ jsx("td", { className: `${estimateCostCell({
185
- hasBorder: !isLastElement && !noBorder,
186
- primary: isPrimaryBackground
187
- })} ${estimateCostPriceCell}`, style: assignInlineVars({
188
- [paddingLeftCell]: `16px`
189
- }), children: !noPrice ? /* @__PURE__ */ jsxs(Fragment, { children: [
190
- /* @__PURE__ */ jsxs(Text, { as: "p", placement: "right", prominence: computedItemPrice === 0 && computedMaxItemPrice === 0 ? "weak" : "default", sentiment: computedItemPrice === 0 && computedMaxItemPrice === 0 ? "neutral" : "primary", strikeThrough, variant: noIterationText ? "headingSmall" : "bodyStrong", children: [
191
- priceText,
192
- !priceText ? formatNumber(computedItemPrice, {
193
- maximumFractionDigits: formatMaximumFractionDigits
194
- }) : null,
195
- noIterationText ? /* @__PURE__ */ jsxs(Text, { as: "span", sentiment: "primary", variant: "bodySmall", children: [
196
- "/",
197
- noIterationText
198
- ] }) : null,
199
- !priceText && computedMaxItemPrice > 0 ? ` - ${formatNumber(computedMaxItemPrice, {
200
- maximumFractionDigits: formatMaximumFractionDigits
201
- })}` : null
202
- ] }),
203
- amount - amountFree !== 1 && computedItemPrice > 0 || maxAmount > 0 && computedMaxItemPrice > 0 ? /* @__PURE__ */ jsxs(Text, { as: "p", placement: "right", variant: "body", children: [
204
- formatNumber(calculatePrice({
205
- amount: 1,
206
- discount,
207
- price,
208
- timeAmount: 1,
209
- timeUnit: "hours"
210
- }), {
211
- maximumFractionDigits: longFractionDigits ? maximumFractionDigitsLong.hours : maximumFractionDigits.hours
212
- }),
213
- TIME_RELATED_UNIT.includes(unit) ? locales[`estimate.cost.units.${unit}.label`].toLowerCase() : `/${unit}`,
214
- !noIteration ? `/${locales["estimate.cost.units.hours.label"].toLowerCase()}` : null
215
- ] }) : null
216
- ] }) : null }) : null
217
- ] });
218
- });
154
+ price,
155
+ timeAmount: noIteration ? 1 : iteration?.value ?? 1,
156
+ timeUnit: noIteration ? "hours" : iteration?.unit ?? "hours"
157
+ }),
158
+ [price, amount, amountFree, iteration, noIteration, discount]
159
+ );
160
+ const computedMaxItemPrice = useMemo(
161
+ () => calculatePrice({
162
+ amount: maxAmount,
163
+ amountFree,
164
+ discount,
165
+ price,
166
+ timeAmount: noIteration ? 1 : iteration?.value ?? 1,
167
+ timeUnit: noIteration ? "hours" : iteration?.unit ?? "hours"
168
+ }),
169
+ [price, maxAmount, amountFree, iteration, noIteration, discount]
170
+ );
171
+ const formatMaximumFractionDigits = useMemo(() => {
172
+ if (!iteration?.unit) {
173
+ return void 0;
174
+ }
175
+ return longFractionDigits ? maximumFractionDigitsLong[iteration?.unit] : maximumFractionDigits[iteration?.unit];
176
+ }, [iteration?.unit, longFractionDigits]);
177
+ return /* @__PURE__ */ jsxs(
178
+ Row,
179
+ {
180
+ className: isOverlay ? estimateCostOverlayRow({
181
+ hideFromOverlay,
182
+ isFirstElement,
183
+ shouldBeHidden
184
+ }) : estimateCostTr,
185
+ style,
186
+ children: [
187
+ /* @__PURE__ */ jsx(
188
+ Cell,
189
+ {
190
+ className: estimateCostCell({
191
+ hasBorder: !isLastElement && !noBorder && !isOverlay
192
+ }),
193
+ style: assignInlineVars({
194
+ [paddingLeftCell]: `${(tabulation ?? 0) * 8 + 16}px`
195
+ }),
196
+ children: /* @__PURE__ */ jsxs(LeftSide, { className: isOverlay ? "" : estimateCostLeftSide, children: [
197
+ /* @__PURE__ */ jsxs(Stack, { children: [
198
+ /* @__PURE__ */ jsxs(Stack, { direction: "row", children: [
199
+ /* @__PURE__ */ jsx(
200
+ Text,
201
+ {
202
+ as: "p",
203
+ prominence: labelTextProminence ?? "default",
204
+ variant: labelTextVariant ?? "body",
205
+ children: label
206
+ }
207
+ ),
208
+ tooltipInfo ? /* @__PURE__ */ jsx("div", { className: styledDiv, children: /* @__PURE__ */ jsx(Tooltip, { className: estimateCostTooltip, text: tooltipInfo, children: /* @__PURE__ */ jsx(HelpCircleOutlineIcon, { size: "medium" }) }) }) : null,
209
+ subLabel && !isOverlay ? /* @__PURE__ */ jsx(
210
+ Text,
211
+ {
212
+ as: "p",
213
+ className: estimateCostTextItem,
214
+ italic: true,
215
+ sentiment: "primary",
216
+ variant: "body",
217
+ children: subLabel
218
+ }
219
+ ) : null,
220
+ discount > 0 && discountText ? /* @__PURE__ */ jsx(
221
+ Badge,
222
+ {
223
+ className: estimateCostBadgeItem,
224
+ prominence: "strong",
225
+ sentiment: "warning",
226
+ size: "small",
227
+ children: discountText
228
+ }
229
+ ) : null
230
+ ] }),
231
+ notice ? /* @__PURE__ */ jsx(
232
+ Text,
233
+ {
234
+ as: "p",
235
+ className: estimateCostMaxWidthText,
236
+ prominence: "weak",
237
+ variant: "caption",
238
+ children: notice
239
+ }
240
+ ) : null
241
+ ] }),
242
+ /* @__PURE__ */ jsx(
243
+ "div",
244
+ {
245
+ className: estimateCostResourceName({
246
+ isAnimated: isOverlay && animated,
247
+ isOverlay
248
+ }),
249
+ children: isDefined ? Children.map(
250
+ children,
251
+ (child) => isValidElement(child) ? cloneElement(child, {
252
+ amount,
253
+ itemCallback,
254
+ maxAmount,
255
+ unit
256
+ }) : null
257
+ ) : textNotDefined || locales["estimate.cost.notDefined"]
258
+ }
259
+ )
260
+ ] })
261
+ }
262
+ ),
263
+ !isOverlay ? /* @__PURE__ */ jsx(
264
+ "td",
265
+ {
266
+ className: `${estimateCostCell({ hasBorder: !isLastElement && !noBorder, primary: isPrimaryBackground })} ${estimateCostPriceCell}`,
267
+ style: assignInlineVars({
268
+ [paddingLeftCell]: `16px`
269
+ }),
270
+ children: !noPrice ? /* @__PURE__ */ jsxs(Fragment, { children: [
271
+ /* @__PURE__ */ jsxs(
272
+ Text,
273
+ {
274
+ as: "p",
275
+ placement: "right",
276
+ prominence: computedItemPrice === 0 && computedMaxItemPrice === 0 ? "weak" : "default",
277
+ sentiment: computedItemPrice === 0 && computedMaxItemPrice === 0 ? "neutral" : "primary",
278
+ strikeThrough,
279
+ variant: noIterationText ? "headingSmall" : "bodyStrong",
280
+ children: [
281
+ priceText,
282
+ !priceText ? formatNumber(computedItemPrice, {
283
+ maximumFractionDigits: formatMaximumFractionDigits
284
+ }) : null,
285
+ noIterationText ? /* @__PURE__ */ jsxs(Text, { as: "span", sentiment: "primary", variant: "bodySmall", children: [
286
+ "/",
287
+ noIterationText
288
+ ] }) : null,
289
+ !priceText && computedMaxItemPrice > 0 ? ` - ${formatNumber(computedMaxItemPrice, {
290
+ maximumFractionDigits: formatMaximumFractionDigits
291
+ })}` : null
292
+ ]
293
+ }
294
+ ),
295
+ amount - amountFree !== 1 && computedItemPrice > 0 || maxAmount > 0 && computedMaxItemPrice > 0 ? /* @__PURE__ */ jsxs(Text, { as: "p", placement: "right", variant: "body", children: [
296
+ formatNumber(
297
+ calculatePrice({
298
+ amount: 1,
299
+ discount,
300
+ price,
301
+ timeAmount: 1,
302
+ timeUnit: "hours"
303
+ }),
304
+ {
305
+ maximumFractionDigits: longFractionDigits ? maximumFractionDigitsLong.hours : maximumFractionDigits.hours
306
+ }
307
+ ),
308
+ TIME_RELATED_UNIT.includes(unit) ? locales[`estimate.cost.units.${unit}.label`].toLowerCase() : `/${unit}`,
309
+ !noIteration ? `/${locales["estimate.cost.units.hours.label"].toLowerCase()}` : null
310
+ ] }) : null
311
+ ] }) : null
312
+ }
313
+ ) : null
314
+ ]
315
+ }
316
+ );
317
+ }
318
+ );
219
319
  export {
220
320
  Item
221
321
  };
@@ -2,5 +2,5 @@ import type { ComponentProps } from 'react';
2
2
  type LineThroughProps = ComponentProps<'span'> & {
3
3
  isActive?: boolean;
4
4
  };
5
- export declare const LineThrough: ({ isActive, className, ...props }: LineThroughProps) => import("@emotion/react/jsx-runtime").JSX.Element;
5
+ export declare const LineThrough: ({ isActive, className, ...props }: LineThroughProps) => import("react/jsx-runtime").JSX.Element;
6
6
  export {};
@@ -1,11 +1,17 @@
1
1
  "use client";
2
- import { jsx } from "@emotion/react/jsx-runtime";
2
+ import { jsx } from "react/jsx-runtime";
3
3
  import { estimateCostLineThrough } from "./components.css.js";
4
4
  const LineThrough = ({
5
5
  isActive,
6
6
  className,
7
7
  ...props
8
- }) => /* @__PURE__ */ jsx("span", { className: `${className ? `${className} ` : ""} ${isActive ? estimateCostLineThrough : ""}`, ...props });
8
+ }) => /* @__PURE__ */ jsx(
9
+ "span",
10
+ {
11
+ className: `${className ? `${className} ` : ""} ${isActive ? estimateCostLineThrough : ""}`,
12
+ ...props
13
+ }
14
+ );
9
15
  export {
10
16
  LineThrough
11
17
  };
@@ -6,5 +6,5 @@ type NumberInputProps = {
6
6
  maxValue?: number;
7
7
  controls?: boolean;
8
8
  };
9
- export declare const NumberInput: ({ amount, minValue, maxValue, getAmountValue, itemCallback, controls, }: NumberInputProps) => import("@emotion/react/jsx-runtime").JSX.Element;
9
+ export declare const NumberInput: ({ amount, minValue, maxValue, getAmountValue, itemCallback, controls, }: NumberInputProps) => import("react/jsx-runtime").JSX.Element;
10
10
  export {};
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { jsx } from "@emotion/react/jsx-runtime";
2
+ import { jsx } from "react/jsx-runtime";
3
3
  import { NumberInput as NumberInput$1 } from "@ultraviolet/ui";
4
4
  import { useState, useEffect } from "react";
5
5
  import { useOverlay } from "../OverlayContext.js";
@@ -13,18 +13,26 @@ const NumberInput = ({
13
13
  itemCallback,
14
14
  controls = true
15
15
  }) => {
16
- const {
17
- isOverlay
18
- } = useOverlay();
16
+ const { isOverlay } = useOverlay();
19
17
  const [value, setValue] = useState(amount);
20
18
  useEffect(() => {
21
19
  getAmountValue?.(amount);
22
20
  }, [getAmountValue, amount]);
23
- return isOverlay ? /* @__PURE__ */ jsx("div", { className: estimateCostItemResourceName(), children: /* @__PURE__ */ jsx(Regular, { children: amount }) }) : /* @__PURE__ */ jsx(NumberInput$1, { controls, max: maxValue, min: minValue, onChange: (newValue) => {
24
- setValue(newValue);
25
- itemCallback?.(newValue, true);
26
- getAmountValue?.(newValue);
27
- }, size: "small", value });
21
+ return isOverlay ? /* @__PURE__ */ jsx("div", { className: estimateCostItemResourceName(), children: /* @__PURE__ */ jsx(Regular, { children: amount }) }) : /* @__PURE__ */ jsx(
22
+ NumberInput$1,
23
+ {
24
+ controls,
25
+ max: maxValue,
26
+ min: minValue,
27
+ onChange: (newValue) => {
28
+ setValue(newValue);
29
+ itemCallback?.(newValue, true);
30
+ getAmountValue?.(newValue);
31
+ },
32
+ size: "small",
33
+ value
34
+ }
35
+ );
28
36
  };
29
37
  export {
30
38
  NumberInput
@@ -18,5 +18,5 @@ type RegionProps = {
18
18
  noBorder?: boolean;
19
19
  noPrice?: boolean;
20
20
  } & Pick<ComponentProps<typeof Item>, 'hideFromOverlay' | 'style'>;
21
- export declare const Region: import("react").MemoExoticComponent<({ label, image, shouldBeHidden, priceText, animated, isFirstElement, isLastElement, productsCallback, iteration, discount, noBorder, noPrice, hideFromOverlay, style, }: RegionProps) => import("@emotion/react/jsx-runtime").JSX.Element>;
21
+ export declare const Region: import("react").MemoExoticComponent<({ label, image, shouldBeHidden, priceText, animated, isFirstElement, isLastElement, productsCallback, iteration, discount, noBorder, noPrice, hideFromOverlay, style, }: RegionProps) => import("react/jsx-runtime").JSX.Element>;
22
22
  export {};