@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.
- package/dist/.vite/license.md +3 -0
- package/dist/_virtual/_@oxc-project_runtime@0.113.0/helpers/defineProperty.js +15 -0
- package/dist/_virtual/_@oxc-project_runtime@0.113.0/helpers/objectSpread2.js +28 -0
- package/dist/_virtual/_@oxc-project_runtime@0.113.0/helpers/objectWithoutProperties.js +18 -0
- package/dist/_virtual/_@oxc-project_runtime@0.113.0/helpers/objectWithoutPropertiesLoose.js +15 -0
- package/dist/_virtual/_@oxc-project_runtime@0.113.0/helpers/toPrimitive.js +17 -0
- package/dist/_virtual/_@oxc-project_runtime@0.113.0/helpers/toPropertyKey.js +12 -0
- package/dist/_virtual/_@oxc-project_runtime@0.113.0/helpers/typeof.js +14 -0
- package/dist/_virtual/_rolldown/runtime.js +9 -0
- package/dist/components/CodeEditor/CodeEditor.d.ts +1 -1
- package/dist/components/CodeEditor/CodeEditor.d.ts.map +1 -1
- package/dist/components/CodeEditor/CodeEditor.js +111 -137
- package/dist/components/CodeEditor/styles.css.js +18 -15
- package/dist/components/ContentCard/Skeleton.d.ts.map +1 -1
- package/dist/components/ContentCard/Skeleton.js +31 -27
- package/dist/components/ContentCard/index.js +107 -140
- package/dist/components/ContentCard/styles.css.d.ts +1 -1
- package/dist/components/ContentCard/styles.css.js +23 -19
- package/dist/components/ContentCardGroup/Card.js +55 -69
- package/dist/components/ContentCardGroup/SkeletonCard.js +28 -14
- package/dist/components/ContentCardGroup/index.d.ts +7 -7
- package/dist/components/ContentCardGroup/index.js +20 -25
- package/dist/components/ContentCardGroup/styles.css.js +6 -11
- package/dist/components/Conversation/index.d.ts +29 -23
- package/dist/components/Conversation/index.d.ts.map +1 -1
- package/dist/components/Conversation/index.js +46 -48
- package/dist/components/Conversation/styles.css.js +19 -13
- package/dist/components/CustomerSatisfaction/assets/1-5.js +5 -0
- package/dist/components/CustomerSatisfaction/assets/1-5NB.js +5 -0
- package/dist/components/CustomerSatisfaction/assets/2-5.js +5 -0
- package/dist/components/CustomerSatisfaction/assets/2-5NB.js +5 -0
- package/dist/components/CustomerSatisfaction/assets/3-5.js +5 -0
- package/dist/components/CustomerSatisfaction/assets/3-5NB.js +5 -0
- package/dist/components/CustomerSatisfaction/assets/4-5.js +5 -0
- package/dist/components/CustomerSatisfaction/assets/4-5NB.js +5 -0
- package/dist/components/CustomerSatisfaction/assets/5-5.js +5 -0
- package/dist/components/CustomerSatisfaction/assets/5-5NB.js +5 -0
- package/dist/components/CustomerSatisfaction/index.d.ts +1 -1
- package/dist/components/CustomerSatisfaction/index.d.ts.map +1 -1
- package/dist/components/CustomerSatisfaction/index.js +85 -100
- package/dist/components/CustomerSatisfaction/styles.css.js +18 -6
- package/dist/components/EstimateCost/Components/CustomUnitInput.d.ts.map +1 -1
- package/dist/components/EstimateCost/Components/CustomUnitInput.js +39 -52
- package/dist/components/EstimateCost/Components/Item.d.ts.map +1 -1
- package/dist/components/EstimateCost/Components/Item.js +223 -323
- package/dist/components/EstimateCost/Components/LineThrough.d.ts.map +1 -1
- package/dist/components/EstimateCost/Components/LineThrough.js +16 -16
- package/dist/components/EstimateCost/Components/NumberInput.d.ts.map +1 -1
- package/dist/components/EstimateCost/Components/NumberInput.js +33 -37
- package/dist/components/EstimateCost/Components/Region.d.ts.map +1 -1
- package/dist/components/EstimateCost/Components/Region.js +34 -57
- package/dist/components/EstimateCost/Components/Regular.d.ts.map +1 -1
- package/dist/components/EstimateCost/Components/Regular.js +21 -26
- package/dist/components/EstimateCost/Components/Strong.d.ts.map +1 -1
- package/dist/components/EstimateCost/Components/Strong.js +14 -19
- package/dist/components/EstimateCost/Components/Unit.d.ts.map +1 -1
- package/dist/components/EstimateCost/Components/Unit.js +47 -40
- package/dist/components/EstimateCost/Components/Zone.d.ts.map +1 -1
- package/dist/components/EstimateCost/Components/Zone.js +33 -55
- package/dist/components/EstimateCost/Components/components.css.js +122 -86
- package/dist/components/EstimateCost/EstimateCost.d.ts +138 -121
- package/dist/components/EstimateCost/EstimateCost.d.ts.map +1 -1
- package/dist/components/EstimateCost/EstimateCost.js +79 -124
- package/dist/components/EstimateCost/EstimateCostContent.d.ts.map +1 -1
- package/dist/components/EstimateCost/EstimateCostContent.js +284 -394
- package/dist/components/EstimateCost/EstimateCostProvider.d.ts +1 -1
- package/dist/components/EstimateCost/EstimateCostProvider.d.ts.map +1 -1
- package/dist/components/EstimateCost/EstimateCostProvider.js +30 -37
- package/dist/components/EstimateCost/OverlayComponent.d.ts.map +1 -1
- package/dist/components/EstimateCost/OverlayComponent.js +95 -93
- package/dist/components/EstimateCost/OverlayContext.d.ts.map +1 -1
- package/dist/components/EstimateCost/OverlayContext.js +12 -10
- package/dist/components/EstimateCost/constants.js +19 -21
- package/dist/components/EstimateCost/helper.d.ts +2 -2
- package/dist/components/EstimateCost/helper.d.ts.map +1 -1
- package/dist/components/EstimateCost/helper.js +9 -14
- package/dist/components/EstimateCost/locales/en.js +24 -23
- package/dist/components/EstimateCost/styles.css.d.ts +2 -2
- package/dist/components/EstimateCost/styles.css.js +50 -36
- package/dist/components/EstimateCost/types.d.ts +1 -1
- package/dist/components/EstimateCost/types.d.ts.map +1 -1
- package/dist/components/FAQ/index.d.ts.map +1 -1
- package/dist/components/FAQ/index.js +37 -31
- package/dist/components/FAQ/styles.css.js +6 -4
- package/dist/components/InfoTable/InfoTable.d.ts +10 -13
- package/dist/components/InfoTable/InfoTable.d.ts.map +1 -1
- package/dist/components/InfoTable/InfoTable.js +24 -15
- package/dist/components/InfoTable/components/Cell.d.ts.map +1 -1
- package/dist/components/InfoTable/components/Cell.js +37 -45
- package/dist/components/InfoTable/components/Row.d.ts.map +1 -1
- package/dist/components/InfoTable/components/Row.js +19 -27
- package/dist/components/InfoTable/context.d.ts +1 -1
- package/dist/components/InfoTable/context.d.ts.map +1 -1
- package/dist/components/InfoTable/context.js +5 -3
- package/dist/components/InfoTable/styles.css.js +6 -10
- package/dist/components/Navigation/Footer.d.ts.map +1 -1
- package/dist/components/Navigation/Footer.js +59 -75
- package/dist/components/Navigation/Header.d.ts.map +1 -1
- package/dist/components/Navigation/Header.js +20 -17
- package/dist/components/Navigation/Navigation.d.ts +46 -43
- package/dist/components/Navigation/Navigation.d.ts.map +1 -1
- package/dist/components/Navigation/Navigation.js +23 -27
- package/dist/components/Navigation/NavigationContent.d.ts +1 -1
- package/dist/components/Navigation/NavigationContent.d.ts.map +1 -1
- package/dist/components/Navigation/NavigationContent.js +100 -138
- package/dist/components/Navigation/NavigationProvider.d.ts.map +1 -1
- package/dist/components/Navigation/NavigationProvider.js +116 -165
- package/dist/components/Navigation/components/Group.d.ts.map +1 -1
- package/dist/components/Navigation/components/Group.js +36 -43
- package/dist/components/Navigation/components/Item.d.ts +1 -1
- package/dist/components/Navigation/components/Item.d.ts.map +1 -1
- package/dist/components/Navigation/components/Item.js +440 -607
- package/dist/components/Navigation/components/ItemProvider.d.ts.map +1 -1
- package/dist/components/Navigation/components/ItemProvider.js +13 -8
- package/dist/components/Navigation/components/PinnedItems.d.ts.map +1 -1
- package/dist/components/Navigation/components/PinnedItems.js +101 -132
- package/dist/components/Navigation/components/Separator.js +10 -7
- package/dist/components/Navigation/components/ShowHide.d.ts +1 -1
- package/dist/components/Navigation/components/ShowHide.d.ts.map +1 -1
- package/dist/components/Navigation/components/ShowHide.js +51 -75
- package/dist/components/Navigation/components/items.css.js +72 -30
- package/dist/components/Navigation/components/styles.css.js +23 -13
- package/dist/components/Navigation/locales/en.js +12 -11
- package/dist/components/Navigation/styles.css.js +28 -14
- package/dist/components/Navigation/variables.css.js +6 -4
- package/dist/components/OfferList/OfferList.d.ts +5 -51
- package/dist/components/OfferList/OfferList.d.ts.map +1 -1
- package/dist/components/OfferList/OfferList.js +11 -78
- package/dist/components/OrderSummary/index.d.ts +5 -2
- package/dist/components/OrderSummary/index.d.ts.map +1 -1
- package/dist/components/OrderSummary/index.js +11 -204
- package/dist/components/Plans/index.d.ts +5 -21
- package/dist/components/Plans/index.d.ts.map +1 -1
- package/dist/components/Plans/index.js +11 -214
- package/dist/components/SteppedListCard/index.d.ts +5 -1
- package/dist/components/SteppedListCard/index.d.ts.map +1 -1
- package/dist/components/SteppedListCard/index.js +11 -0
- package/dist/index.js +5 -21
- package/dist/plus.css +2 -1
- package/package.json +9 -8
- package/LICENSE +0 -189
- package/dist/components/CustomerSatisfaction/assets/1-5.svg.js +0 -4
- package/dist/components/CustomerSatisfaction/assets/1-5NB.svg.js +0 -4
- package/dist/components/CustomerSatisfaction/assets/2-5.svg.js +0 -4
- package/dist/components/CustomerSatisfaction/assets/2-5NB.svg.js +0 -4
- package/dist/components/CustomerSatisfaction/assets/3-5.svg.js +0 -4
- package/dist/components/CustomerSatisfaction/assets/3-5NB.svg.js +0 -4
- package/dist/components/CustomerSatisfaction/assets/4-5.svg.js +0 -4
- package/dist/components/CustomerSatisfaction/assets/4-5NB.svg.js +0 -4
- package/dist/components/CustomerSatisfaction/assets/5-5.svg.js +0 -4
- package/dist/components/CustomerSatisfaction/assets/5-5NB.svg.js +0 -4
- package/dist/components/Navigation/constants.js +0 -10
- package/dist/components/OfferList/OfferListProvider.d.ts +0 -30
- package/dist/components/OfferList/OfferListProvider.d.ts.map +0 -1
- package/dist/components/OfferList/OfferListProvider.js +0 -48
- package/dist/components/OfferList/components/Banner.d.ts +0 -13
- package/dist/components/OfferList/components/Banner.d.ts.map +0 -1
- package/dist/components/OfferList/components/Banner.js +0 -43
- package/dist/components/OfferList/components/Cell.d.ts +0 -4
- package/dist/components/OfferList/components/Cell.d.ts.map +0 -1
- package/dist/components/OfferList/components/Cell.js +0 -35
- package/dist/components/OfferList/components/OfferListRowProvider.d.ts +0 -9
- package/dist/components/OfferList/components/OfferListRowProvider.d.ts.map +0 -1
- package/dist/components/OfferList/components/OfferListRowProvider.js +0 -10
- package/dist/components/OfferList/components/Row.d.ts +0 -18
- package/dist/components/OfferList/components/Row.d.ts.map +0 -1
- package/dist/components/OfferList/components/Row.js +0 -258
- package/dist/components/OfferList/styles.css.d.ts +0 -44
- package/dist/components/OfferList/styles.css.d.ts.map +0 -1
- package/dist/components/OfferList/styles.css.js +0 -40
- package/dist/components/OrderSummary/NonScrollableContent.d.ts +0 -20
- package/dist/components/OrderSummary/NonScrollableContent.d.ts.map +0 -1
- package/dist/components/OrderSummary/NonScrollableContent.js +0 -136
- package/dist/components/OrderSummary/Provider.d.ts +0 -15
- package/dist/components/OrderSummary/Provider.d.ts.map +0 -1
- package/dist/components/OrderSummary/Provider.js +0 -15
- package/dist/components/OrderSummary/ScrollableContent.d.ts +0 -2
- package/dist/components/OrderSummary/ScrollableContent.d.ts.map +0 -1
- package/dist/components/OrderSummary/ScrollableContent.js +0 -314
- package/dist/components/OrderSummary/constants.d.ts +0 -3
- package/dist/components/OrderSummary/constants.d.ts.map +0 -1
- package/dist/components/OrderSummary/constants.js +0 -18
- package/dist/components/OrderSummary/helpers.d.ts +0 -28
- package/dist/components/OrderSummary/helpers.d.ts.map +0 -1
- package/dist/components/OrderSummary/helpers.js +0 -156
- package/dist/components/OrderSummary/locales/en.d.ts +0 -11
- package/dist/components/OrderSummary/locales/en.d.ts.map +0 -1
- package/dist/components/OrderSummary/locales/en.js +0 -12
- package/dist/components/OrderSummary/styles.css.d.ts +0 -21
- package/dist/components/OrderSummary/styles.css.d.ts.map +0 -1
- package/dist/components/OrderSummary/styles.css.js +0 -26
- package/dist/components/OrderSummary/types.d.ts +0 -125
- package/dist/components/OrderSummary/types.d.ts.map +0 -1
- package/dist/components/Plans/FeatureHint.d.ts +0 -7
- package/dist/components/Plans/FeatureHint.d.ts.map +0 -1
- package/dist/components/Plans/FeatureHint.js +0 -42
- package/dist/components/Plans/PlanHeader.d.ts +0 -14
- package/dist/components/Plans/PlanHeader.d.ts.map +0 -1
- package/dist/components/Plans/PlanHeader.js +0 -96
- package/dist/components/Plans/locales/en.d.ts +0 -7
- package/dist/components/Plans/locales/en.d.ts.map +0 -1
- package/dist/components/Plans/locales/en.js +0 -8
- package/dist/components/Plans/styles.css.d.ts +0 -67
- package/dist/components/Plans/styles.css.d.ts.map +0 -1
- package/dist/components/Plans/styles.css.js +0 -26
- package/dist/components/Plans/types.d.ts +0 -38
- package/dist/components/Plans/types.d.ts.map +0 -1
- package/dist/components/SteppedListCard/Step.d.ts +0 -23
- package/dist/components/SteppedListCard/Step.d.ts.map +0 -1
- package/dist/components/SteppedListCard/Step.js +0 -61
- package/dist/components/SteppedListCard/SteppedListCard.d.ts +0 -69
- package/dist/components/SteppedListCard/SteppedListCard.d.ts.map +0 -1
- package/dist/components/SteppedListCard/SteppedListCard.js +0 -105
- package/dist/components/SteppedListCard/SteppedListContent.d.ts +0 -12
- package/dist/components/SteppedListCard/SteppedListContent.d.ts.map +0 -1
- package/dist/components/SteppedListCard/SteppedListContent.js +0 -53
- package/dist/components/SteppedListCard/helper.d.ts +0 -27
- package/dist/components/SteppedListCard/helper.d.ts.map +0 -1
- package/dist/components/SteppedListCard/helper.js +0 -41
- package/dist/components/SteppedListCard/styles.css.d.ts +0 -9
- package/dist/components/SteppedListCard/styles.css.d.ts.map +0 -1
- package/dist/components/SteppedListCard/styles.css.js +0 -19
|
@@ -1,328 +1,228 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { assignInlineVars } from "@vanilla-extract/dynamic";
|
|
7
|
-
import { memo, useMemo, useState, useEffect, useCallback, useId, Children, cloneElement, isValidElement } from "react";
|
|
8
|
-
import { multiplier, maximumFractionDigitsLong, maximumFractionDigits } from "../constants.js";
|
|
1
|
+
'use client';
|
|
2
|
+
import { __name } from "../../../_virtual/_rolldown/runtime.js";
|
|
3
|
+
import { estimateCostBadgeItem, estimateCostLeftSide, estimateCostMaxWidthText, estimateCostResourceName, estimateCostTextItem, estimateCostTooltip, estimateCostTr, styledDiv } from "./components.css.js";
|
|
4
|
+
import { maximumFractionDigits, maximumFractionDigitsLong, multiplier } from "../constants.js";
|
|
5
|
+
import { _objectSpread2 } from "../../../_virtual/_@oxc-project_runtime@0.113.0/helpers/objectSpread2.js";
|
|
9
6
|
import { useEstimateCost } from "../EstimateCostProvider.js";
|
|
10
7
|
import { calculatePrice } from "../helper.js";
|
|
11
8
|
import { useOverlay } from "../OverlayContext.js";
|
|
12
|
-
import { estimateCostOverlayRow,
|
|
13
|
-
import {
|
|
9
|
+
import { estimateCostCell, estimateCostOverlayRow, estimateCostPriceCell, paddingLeftCell } from "../styles.css.js";
|
|
10
|
+
import { Badge, Stack, Text, Tooltip } from "@ultraviolet/ui";
|
|
11
|
+
import { cn } from "@ultraviolet/utils";
|
|
12
|
+
import { assignInlineVars } from "@vanilla-extract/dynamic";
|
|
13
|
+
import { Children, cloneElement, isValidElement, memo, useCallback, useEffect, useId, useMemo, useState } from "react";
|
|
14
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
15
|
+
import { HelpCircleOutlineIcon } from "@ultraviolet/icons/HelpCircleOutlineIcon";
|
|
16
|
+
|
|
17
|
+
//#region src/components/EstimateCost/Components/Item.tsx
|
|
14
18
|
const TIME_RELATED_UNIT = [
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
"seconds",
|
|
20
|
+
"minutes",
|
|
21
|
+
"hours",
|
|
22
|
+
"days",
|
|
23
|
+
"months"
|
|
20
24
|
];
|
|
21
|
-
const Item = memo(
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
prominence: "strong",
|
|
226
|
-
sentiment: "warning",
|
|
227
|
-
size: "small",
|
|
228
|
-
children: discountText
|
|
229
|
-
}
|
|
230
|
-
) : null
|
|
231
|
-
] }),
|
|
232
|
-
notice ? /* @__PURE__ */ jsx(
|
|
233
|
-
Text,
|
|
234
|
-
{
|
|
235
|
-
as: "p",
|
|
236
|
-
className: estimateCostMaxWidthText,
|
|
237
|
-
prominence: "weak",
|
|
238
|
-
variant: "caption",
|
|
239
|
-
children: notice
|
|
240
|
-
}
|
|
241
|
-
) : null
|
|
242
|
-
] }),
|
|
243
|
-
/* @__PURE__ */ jsx(
|
|
244
|
-
"div",
|
|
245
|
-
{
|
|
246
|
-
className: estimateCostResourceName({
|
|
247
|
-
isAnimated: isOverlay && animated,
|
|
248
|
-
isOverlay
|
|
249
|
-
}),
|
|
250
|
-
children: isDefined ? Children.map(
|
|
251
|
-
children,
|
|
252
|
-
(child) => isValidElement(child) ? cloneElement(child, {
|
|
253
|
-
amount,
|
|
254
|
-
itemCallback,
|
|
255
|
-
maxAmount,
|
|
256
|
-
unit
|
|
257
|
-
}) : null
|
|
258
|
-
) : textNotDefined || locales["estimate.cost.notDefined"]
|
|
259
|
-
}
|
|
260
|
-
)
|
|
261
|
-
] })
|
|
262
|
-
}
|
|
263
|
-
),
|
|
264
|
-
isOverlay ? null : /* @__PURE__ */ jsx(
|
|
265
|
-
"td",
|
|
266
|
-
{
|
|
267
|
-
className: cn(
|
|
268
|
-
estimateCostCell({
|
|
269
|
-
hasBorder: !(isLastElement || noBorder),
|
|
270
|
-
primary: isPrimaryBackground
|
|
271
|
-
}),
|
|
272
|
-
estimateCostPriceCell
|
|
273
|
-
),
|
|
274
|
-
style: assignInlineVars({
|
|
275
|
-
[paddingLeftCell]: "16px"
|
|
276
|
-
}),
|
|
277
|
-
children: noPrice ? null : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
278
|
-
/* @__PURE__ */ jsxs(
|
|
279
|
-
Text,
|
|
280
|
-
{
|
|
281
|
-
as: "p",
|
|
282
|
-
placement: "right",
|
|
283
|
-
prominence: computedItemPrice === 0 && computedMaxItemPrice === 0 ? "weak" : "default",
|
|
284
|
-
sentiment: computedItemPrice === 0 && computedMaxItemPrice === 0 ? "neutral" : "primary",
|
|
285
|
-
strikeThrough,
|
|
286
|
-
variant: noIterationText ? "headingSmall" : "bodyStrong",
|
|
287
|
-
children: [
|
|
288
|
-
priceText,
|
|
289
|
-
priceText ? null : formatNumber(computedItemPrice, {
|
|
290
|
-
maximumFractionDigits: formatMaximumFractionDigits
|
|
291
|
-
}),
|
|
292
|
-
noIterationText ? /* @__PURE__ */ jsxs(Text, { as: "span", sentiment: "primary", variant: "bodySmall", children: [
|
|
293
|
-
"/",
|
|
294
|
-
noIterationText
|
|
295
|
-
] }) : null,
|
|
296
|
-
!priceText && computedMaxItemPrice > 0 ? ` - ${formatNumber(computedMaxItemPrice, {
|
|
297
|
-
maximumFractionDigits: formatMaximumFractionDigits
|
|
298
|
-
})}` : null
|
|
299
|
-
]
|
|
300
|
-
}
|
|
301
|
-
),
|
|
302
|
-
amount - amountFree !== 1 && computedItemPrice > 0 || maxAmount > 0 && computedMaxItemPrice > 0 ? /* @__PURE__ */ jsxs(Text, { as: "p", placement: "right", variant: "body", children: [
|
|
303
|
-
formatNumber(
|
|
304
|
-
calculatePrice({
|
|
305
|
-
amount: 1,
|
|
306
|
-
discount,
|
|
307
|
-
price,
|
|
308
|
-
timeAmount: 1,
|
|
309
|
-
timeUnit: "hours"
|
|
310
|
-
}),
|
|
311
|
-
{
|
|
312
|
-
maximumFractionDigits: longFractionDigits ? maximumFractionDigitsLong.hours : maximumFractionDigits.hours
|
|
313
|
-
}
|
|
314
|
-
),
|
|
315
|
-
TIME_RELATED_UNIT.includes(unit) ? locales[`estimate.cost.units.${unit}.label`].toLowerCase() : `/${unit}`,
|
|
316
|
-
noIteration ? null : `/${locales["estimate.cost.units.hours.label"].toLowerCase()}`
|
|
317
|
-
] }) : null
|
|
318
|
-
] })
|
|
319
|
-
}
|
|
320
|
-
)
|
|
321
|
-
]
|
|
322
|
-
}
|
|
323
|
-
);
|
|
324
|
-
}
|
|
325
|
-
);
|
|
326
|
-
export {
|
|
327
|
-
Item
|
|
328
|
-
};
|
|
25
|
+
const Item = memo(({ discount = 0, priceText, discountText, label, tooltipInfo, subLabel = "", price: basePrice = 0, monthlyPrice = 0, unit: baseUnit, amount: currentAmount = 1, onAmountChange, amountFree = 0, maxAmount = 0, longFractionDigits = false, noIteration = false, noIterationText, noBorder, noPrice, isDefined = true, children = null, isFirstElement = false, isLastElement = false, isPrimaryBackground = false, productsCallback, iteration: receivedIteration, shouldBeHidden = false, hideFromOverlay = false, textNotDefined, animated = false, tabulation, labelTextVariant, labelTextProminence, notice, strikeThrough, style }) => {
|
|
26
|
+
const { locales, formatNumber } = useEstimateCost();
|
|
27
|
+
let iteration;
|
|
28
|
+
if (noIteration) iteration = _objectSpread2(_objectSpread2({}, receivedIteration !== null && receivedIteration !== void 0 ? receivedIteration : { value: 0 }), {}, { unit: "hours" });
|
|
29
|
+
else iteration = receivedIteration;
|
|
30
|
+
const price = useMemo(() => {
|
|
31
|
+
if (monthlyPrice && basePrice === 0) return monthlyPrice / multiplier.months;
|
|
32
|
+
return basePrice;
|
|
33
|
+
}, [basePrice, monthlyPrice]);
|
|
34
|
+
const unit = useMemo(() => {
|
|
35
|
+
if (!baseUnit) return locales["estimate.cost.units.gb.label"];
|
|
36
|
+
return baseUnit;
|
|
37
|
+
}, [baseUnit, locales]);
|
|
38
|
+
const { isOverlay } = useOverlay();
|
|
39
|
+
const Row = isOverlay ? "li" : "tr";
|
|
40
|
+
const Cell = isOverlay ? "div" : "td";
|
|
41
|
+
const LeftSide = "div";
|
|
42
|
+
const [amount, setAmount] = useState(currentAmount);
|
|
43
|
+
const [isVariant, setIsVariant] = useState(false);
|
|
44
|
+
useEffect(() => setAmount(currentAmount), [setAmount, currentAmount]);
|
|
45
|
+
useEffect(() => onAmountChange === null || onAmountChange === void 0 ? void 0 : onAmountChange(amount), [onAmountChange, amount]);
|
|
46
|
+
const itemCallback = useCallback((localAmount, localIsVariant) => {
|
|
47
|
+
setAmount(localAmount);
|
|
48
|
+
setIsVariant(localIsVariant);
|
|
49
|
+
}, [setAmount, setIsVariant]);
|
|
50
|
+
const id = useId();
|
|
51
|
+
useEffect(() => () => productsCallback === null || productsCallback === void 0 ? void 0 : productsCallback.remove({ id }), [id, productsCallback]);
|
|
52
|
+
useEffect(() => {
|
|
53
|
+
if (!isOverlay) productsCallback === null || productsCallback === void 0 || productsCallback.add({
|
|
54
|
+
amount,
|
|
55
|
+
amountFree,
|
|
56
|
+
discount,
|
|
57
|
+
id,
|
|
58
|
+
isVariant,
|
|
59
|
+
longFractionDigits,
|
|
60
|
+
maxAmount,
|
|
61
|
+
noIteration,
|
|
62
|
+
price
|
|
63
|
+
});
|
|
64
|
+
}, [
|
|
65
|
+
price,
|
|
66
|
+
discount,
|
|
67
|
+
amount,
|
|
68
|
+
id,
|
|
69
|
+
productsCallback,
|
|
70
|
+
maxAmount,
|
|
71
|
+
noIteration,
|
|
72
|
+
isVariant,
|
|
73
|
+
amountFree,
|
|
74
|
+
isOverlay,
|
|
75
|
+
longFractionDigits
|
|
76
|
+
]);
|
|
77
|
+
const computedItemPrice = useMemo(() => {
|
|
78
|
+
var _iteration$value;
|
|
79
|
+
var _iteration$unit;
|
|
80
|
+
return calculatePrice({
|
|
81
|
+
amount,
|
|
82
|
+
amountFree,
|
|
83
|
+
discount,
|
|
84
|
+
price,
|
|
85
|
+
timeAmount: noIteration ? 1 : (_iteration$value = iteration === null || iteration === void 0 ? void 0 : iteration.value) !== null && _iteration$value !== void 0 ? _iteration$value : 1,
|
|
86
|
+
timeUnit: noIteration ? "hours" : (_iteration$unit = iteration === null || iteration === void 0 ? void 0 : iteration.unit) !== null && _iteration$unit !== void 0 ? _iteration$unit : "hours"
|
|
87
|
+
});
|
|
88
|
+
}, [
|
|
89
|
+
price,
|
|
90
|
+
amount,
|
|
91
|
+
amountFree,
|
|
92
|
+
iteration,
|
|
93
|
+
noIteration,
|
|
94
|
+
discount
|
|
95
|
+
]);
|
|
96
|
+
const computedMaxItemPrice = useMemo(() => {
|
|
97
|
+
var _iteration$value2;
|
|
98
|
+
var _iteration$unit2;
|
|
99
|
+
return calculatePrice({
|
|
100
|
+
amount: maxAmount,
|
|
101
|
+
amountFree,
|
|
102
|
+
discount,
|
|
103
|
+
price,
|
|
104
|
+
timeAmount: noIteration ? 1 : (_iteration$value2 = iteration === null || iteration === void 0 ? void 0 : iteration.value) !== null && _iteration$value2 !== void 0 ? _iteration$value2 : 1,
|
|
105
|
+
timeUnit: noIteration ? "hours" : (_iteration$unit2 = iteration === null || iteration === void 0 ? void 0 : iteration.unit) !== null && _iteration$unit2 !== void 0 ? _iteration$unit2 : "hours"
|
|
106
|
+
});
|
|
107
|
+
}, [
|
|
108
|
+
price,
|
|
109
|
+
maxAmount,
|
|
110
|
+
amountFree,
|
|
111
|
+
iteration,
|
|
112
|
+
noIteration,
|
|
113
|
+
discount
|
|
114
|
+
]);
|
|
115
|
+
const formatMaximumFractionDigits = useMemo(() => {
|
|
116
|
+
if (!(iteration === null || iteration === void 0 ? void 0 : iteration.unit)) return;
|
|
117
|
+
return longFractionDigits ? maximumFractionDigitsLong[iteration === null || iteration === void 0 ? void 0 : iteration.unit] : maximumFractionDigits[iteration === null || iteration === void 0 ? void 0 : iteration.unit];
|
|
118
|
+
}, [iteration === null || iteration === void 0 ? void 0 : iteration.unit, longFractionDigits]);
|
|
119
|
+
return /* @__PURE__ */ jsxs(Row, {
|
|
120
|
+
className: isOverlay ? estimateCostOverlayRow({
|
|
121
|
+
hideFromOverlay,
|
|
122
|
+
isFirstElement,
|
|
123
|
+
shouldBeHidden
|
|
124
|
+
}) : estimateCostTr,
|
|
125
|
+
style,
|
|
126
|
+
children: [/* @__PURE__ */ jsx(Cell, {
|
|
127
|
+
className: estimateCostCell({ hasBorder: !(isLastElement || noBorder || isOverlay) }),
|
|
128
|
+
style: assignInlineVars({ [paddingLeftCell]: `${(tabulation !== null && tabulation !== void 0 ? tabulation : 0) * 8 + 16}px` }),
|
|
129
|
+
children: /* @__PURE__ */ jsxs(LeftSide, {
|
|
130
|
+
className: isOverlay ? "" : estimateCostLeftSide,
|
|
131
|
+
children: [/* @__PURE__ */ jsxs(Stack, { children: [/* @__PURE__ */ jsxs(Stack, {
|
|
132
|
+
direction: "row",
|
|
133
|
+
children: [
|
|
134
|
+
/* @__PURE__ */ jsx(Text, {
|
|
135
|
+
as: "p",
|
|
136
|
+
prominence: labelTextProminence !== null && labelTextProminence !== void 0 ? labelTextProminence : "default",
|
|
137
|
+
variant: labelTextVariant !== null && labelTextVariant !== void 0 ? labelTextVariant : "body",
|
|
138
|
+
children: label
|
|
139
|
+
}),
|
|
140
|
+
tooltipInfo ? /* @__PURE__ */ jsx("div", {
|
|
141
|
+
className: styledDiv,
|
|
142
|
+
children: /* @__PURE__ */ jsx(Tooltip, {
|
|
143
|
+
className: estimateCostTooltip,
|
|
144
|
+
text: tooltipInfo,
|
|
145
|
+
children: /* @__PURE__ */ jsx(HelpCircleOutlineIcon, { size: "medium" })
|
|
146
|
+
})
|
|
147
|
+
}) : null,
|
|
148
|
+
subLabel && !isOverlay ? /* @__PURE__ */ jsx(Text, {
|
|
149
|
+
as: "p",
|
|
150
|
+
className: estimateCostTextItem,
|
|
151
|
+
italic: true,
|
|
152
|
+
sentiment: "primary",
|
|
153
|
+
variant: "body",
|
|
154
|
+
children: subLabel
|
|
155
|
+
}) : null,
|
|
156
|
+
discount > 0 && discountText ? /* @__PURE__ */ jsx(Badge, {
|
|
157
|
+
className: estimateCostBadgeItem,
|
|
158
|
+
prominence: "strong",
|
|
159
|
+
sentiment: "warning",
|
|
160
|
+
size: "small",
|
|
161
|
+
children: discountText
|
|
162
|
+
}) : null
|
|
163
|
+
]
|
|
164
|
+
}), notice ? /* @__PURE__ */ jsx(Text, {
|
|
165
|
+
as: "p",
|
|
166
|
+
className: estimateCostMaxWidthText,
|
|
167
|
+
prominence: "weak",
|
|
168
|
+
variant: "caption",
|
|
169
|
+
children: notice
|
|
170
|
+
}) : null] }), /* @__PURE__ */ jsx("div", {
|
|
171
|
+
className: estimateCostResourceName({
|
|
172
|
+
isAnimated: isOverlay && animated,
|
|
173
|
+
isOverlay
|
|
174
|
+
}),
|
|
175
|
+
children: isDefined ? Children.map(children, (child) => isValidElement(child) ? cloneElement(child, {
|
|
176
|
+
amount,
|
|
177
|
+
itemCallback,
|
|
178
|
+
maxAmount,
|
|
179
|
+
unit
|
|
180
|
+
}) : null) : textNotDefined || locales["estimate.cost.notDefined"]
|
|
181
|
+
})]
|
|
182
|
+
})
|
|
183
|
+
}), isOverlay ? null : /* @__PURE__ */ jsx("td", {
|
|
184
|
+
className: cn(estimateCostCell({
|
|
185
|
+
hasBorder: !(isLastElement || noBorder),
|
|
186
|
+
primary: isPrimaryBackground
|
|
187
|
+
}), estimateCostPriceCell),
|
|
188
|
+
style: assignInlineVars({ [paddingLeftCell]: "16px" }),
|
|
189
|
+
children: noPrice ? null : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs(Text, {
|
|
190
|
+
as: "p",
|
|
191
|
+
placement: "right",
|
|
192
|
+
prominence: computedItemPrice === 0 && computedMaxItemPrice === 0 ? "weak" : "default",
|
|
193
|
+
sentiment: computedItemPrice === 0 && computedMaxItemPrice === 0 ? "neutral" : "primary",
|
|
194
|
+
strikeThrough,
|
|
195
|
+
variant: noIterationText ? "headingSmall" : "bodyStrong",
|
|
196
|
+
children: [
|
|
197
|
+
priceText,
|
|
198
|
+
priceText ? null : formatNumber(computedItemPrice, { maximumFractionDigits: formatMaximumFractionDigits }),
|
|
199
|
+
noIterationText ? /* @__PURE__ */ jsxs(Text, {
|
|
200
|
+
as: "span",
|
|
201
|
+
sentiment: "primary",
|
|
202
|
+
variant: "bodySmall",
|
|
203
|
+
children: ["/", noIterationText]
|
|
204
|
+
}) : null,
|
|
205
|
+
!priceText && computedMaxItemPrice > 0 ? ` - ${formatNumber(computedMaxItemPrice, { maximumFractionDigits: formatMaximumFractionDigits })}` : null
|
|
206
|
+
]
|
|
207
|
+
}), amount - amountFree !== 1 && computedItemPrice > 0 || maxAmount > 0 && computedMaxItemPrice > 0 ? /* @__PURE__ */ jsxs(Text, {
|
|
208
|
+
as: "p",
|
|
209
|
+
placement: "right",
|
|
210
|
+
variant: "body",
|
|
211
|
+
children: [
|
|
212
|
+
formatNumber(calculatePrice({
|
|
213
|
+
amount: 1,
|
|
214
|
+
discount,
|
|
215
|
+
price,
|
|
216
|
+
timeAmount: 1,
|
|
217
|
+
timeUnit: "hours"
|
|
218
|
+
}), { maximumFractionDigits: longFractionDigits ? maximumFractionDigitsLong.hours : maximumFractionDigits.hours }),
|
|
219
|
+
TIME_RELATED_UNIT.includes(unit) ? locales[`estimate.cost.units.${unit}.label`].toLowerCase() : `/${unit}`,
|
|
220
|
+
noIteration ? null : `/${locales["estimate.cost.units.hours.label"].toLowerCase()}`
|
|
221
|
+
]
|
|
222
|
+
}) : null] })
|
|
223
|
+
})]
|
|
224
|
+
});
|
|
225
|
+
});
|
|
226
|
+
|
|
227
|
+
//#endregion
|
|
228
|
+
export { Item };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LineThrough.d.ts","sourceRoot":"","sources":["../../../../src/components/EstimateCost/Components/LineThrough.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAG3C,KAAK,gBAAgB,GAAG,cAAc,CAAC,MAAM,CAAC,GAAG;IAC/C,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"LineThrough.d.ts","sourceRoot":"","sources":["../../../../src/components/EstimateCost/Components/LineThrough.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAG3C,KAAK,gBAAgB,GAAG,cAAc,CAAC,MAAM,CAAC,GAAG;IAC/C,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,eAAO,MAAM,WAAW,kGAUvB,CAAA"}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import { cn } from "@ultraviolet/utils";
|
|
1
|
+
'use client';
|
|
2
|
+
import { __name } from "../../../_virtual/_rolldown/runtime.js";
|
|
4
3
|
import { estimateCostLineThrough } from "./components.css.js";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
);
|
|
16
|
-
export {
|
|
17
|
-
LineThrough
|
|
4
|
+
import { _objectSpread2 } from "../../../_virtual/_@oxc-project_runtime@0.113.0/helpers/objectSpread2.js";
|
|
5
|
+
import { _objectWithoutProperties } from "../../../_virtual/_@oxc-project_runtime@0.113.0/helpers/objectWithoutProperties.js";
|
|
6
|
+
import { cn } from "@ultraviolet/utils";
|
|
7
|
+
import { jsx } from "react/jsx-runtime";
|
|
8
|
+
|
|
9
|
+
//#region src/components/EstimateCost/Components/LineThrough.tsx
|
|
10
|
+
const _excluded = ["isActive", "className"];
|
|
11
|
+
const LineThrough = (_ref) => {
|
|
12
|
+
let { isActive, className } = _ref;
|
|
13
|
+
let props = _objectWithoutProperties(_ref, _excluded);
|
|
14
|
+
return /* @__PURE__ */ jsx("span", _objectSpread2({ className: cn(className, isActive ? estimateCostLineThrough : "") }, props));
|
|
18
15
|
};
|
|
16
|
+
|
|
17
|
+
//#endregion
|
|
18
|
+
export { LineThrough };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NumberInput.d.ts","sourceRoot":"","sources":["../../../../src/components/EstimateCost/Components/NumberInput.tsx"],"names":[],"mappings":"AAQA,KAAK,gBAAgB,GAAG;IACtB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,YAAY,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,EAAE,SAAS,CAAC,EAAE,OAAO,KAAK,IAAI,CAAA;IACpE,cAAc,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAA;IACjD,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"NumberInput.d.ts","sourceRoot":"","sources":["../../../../src/components/EstimateCost/Components/NumberInput.tsx"],"names":[],"mappings":"AAQA,KAAK,gBAAgB,GAAG;IACtB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,YAAY,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,EAAE,SAAS,CAAC,EAAE,OAAO,KAAK,IAAI,CAAA;IACpE,cAAc,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAA;IACjD,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,eAAO,MAAM,WAAW,wIAiCvB,CAAA"}
|