@ultraviolet/plus 0.5.0 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,296 @@
1
+ import _styled from '@emotion/styled/base';
2
+ import { Text, Stack, Alert, Icon } from '@ultraviolet/ui';
3
+ import { useState, useMemo, useEffect, Children, isValidElement, cloneElement } from 'react';
4
+ import flattenChildren from 'react-flatten-children';
5
+ import { useInView } from 'react-intersection-observer';
6
+ import { CustomUnitInput } from './Components/CustomUnitInput.js';
7
+ import { Item } from './Components/Item.js';
8
+ import { LineThrough } from './Components/LineThrough.js';
9
+ import { useEstimateCost } from './EstimateCostProvider.js';
10
+ import { OverlayComponent } from './OverlayComponent.js';
11
+ import { OverlayContextProvider } from './OverlayContext.js';
12
+ import { StyledTable, PriceCol, Title, TimeCell, EmptyTable, EmptyCell, TotalPriceCell, BadgeBeta, StyledFeesTable, Cell, PriceCell } from './componentStyle.js';
13
+ import { maximumFractionDigitsLong, maximumFractionDigits } from './constants.js';
14
+ import { calculatePrice } from './helper.js';
15
+ import EstimateCostLocales from './locales/en.js';
16
+ import { jsxs, jsx, Fragment } from '@emotion/react/jsx-runtime';
17
+
18
+ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
19
+ const FeesText = /*#__PURE__*/_styled(Text, {
20
+ target: "excc3v74"
21
+ })("margin-top:", _ref => {
22
+ let {
23
+ theme
24
+ } = _ref;
25
+ return theme.space['3'];
26
+ }, ";");
27
+ const StyledText = /*#__PURE__*/_styled(Text, {
28
+ target: "excc3v73"
29
+ })("text-align:right;", _ref2 => {
30
+ let {
31
+ isBeta,
32
+ theme
33
+ } = _ref2;
34
+ return isBeta ? `margin-left: ${theme.space['2']};` : null;
35
+ }, ";");
36
+ const RightAlignedText = /*#__PURE__*/_styled(Text, {
37
+ target: "excc3v72"
38
+ })(process.env.NODE_ENV === "production" ? {
39
+ name: "2qga7i",
40
+ styles: "text-align:right"
41
+ } : {
42
+ name: "2qga7i",
43
+ styles: "text-align:right",
44
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
45
+ });
46
+ const StyledIcon = /*#__PURE__*/_styled(Icon, {
47
+ target: "excc3v71"
48
+ })("margin-right:", _ref3 => {
49
+ let {
50
+ theme
51
+ } = _ref3;
52
+ return theme.space['1'];
53
+ }, ";");
54
+ const StyledPriceCell = /*#__PURE__*/_styled(Cell.withComponent('th', {
55
+ target: "excc3v75"
56
+ }), {
57
+ target: "excc3v70"
58
+ })(_ref4 => {
59
+ let {
60
+ theme
61
+ } = _ref4;
62
+ return PriceCell(theme);
63
+ }, " padding:0;");
64
+ const DEFAULT_UNIT_LIST = ['hours', 'days', 'months'];
65
+ const EstimateCostContent = _ref5 => {
66
+ let {
67
+ description,
68
+ alert,
69
+ alertVariant = 'warning',
70
+ defaultTimeUnit = 'hours',
71
+ timeUnits = DEFAULT_UNIT_LIST,
72
+ hideOverlay = false,
73
+ disableOverlayLeft = false,
74
+ disableOverlayRight = false,
75
+ hideTimeUnit = false,
76
+ hideTotal = false,
77
+ discount = 0,
78
+ OverlayRight,
79
+ OverlayLeft,
80
+ isBeta = false,
81
+ commitmentFees,
82
+ commitmentFeesContent,
83
+ monthlyFees,
84
+ monthlyFeesLabel,
85
+ monthlyFeesContent,
86
+ overlayUnit = 'hours',
87
+ children = null,
88
+ locales = EstimateCostLocales
89
+ } = _ref5;
90
+ const {
91
+ formatNumber
92
+ } = useEstimateCost();
93
+ const [ref, inView] = useInView();
94
+ const [products, setProducts] = useState([]); // product is used to store each items with their price and amount
95
+ const [totalPrice, setTotalPrice] = useState({
96
+ overlayHourly: 0,
97
+ maxOverlayHourly: 0,
98
+ hourly: 0,
99
+ maxHourly: 0,
100
+ total: 0,
101
+ maxTotal: 0
102
+ });
103
+ const [iteration, setIteration] = useState({
104
+ value: 1,
105
+ unit: defaultTimeUnit ?? 'hours'
106
+ });
107
+ const [isLongFractionDigits, setIsLongFractionDigits] = useState(false);
108
+ const providerValue = useMemo(() => ({
109
+ isOverlay: false
110
+ }), []);
111
+ const list = flattenChildren(children);
112
+ const productsCallback = useMemo(() => ({
113
+ add: newProduct => {
114
+ setProducts(total => {
115
+ if (total.find(product => product.id === newProduct.id)) {
116
+ return total.map(product => product.id === newProduct.id ? newProduct : product);
117
+ }
118
+ return [...total, newProduct];
119
+ });
120
+ },
121
+ remove: _ref6 => {
122
+ let {
123
+ id
124
+ } = _ref6;
125
+ setProducts(total => total.filter(product => product.id !== id));
126
+ }
127
+ }), [setProducts]);
128
+ useEffect(() => {
129
+ // this variable check if there is a maxAmount in each product
130
+ // if not we do not need to calculate maxTotal, maxHourly, maxOverlayHourly
131
+ const isMaxAmountInProducts = products.find(product => product.maxAmount);
132
+ setIsLongFractionDigits(!!products.find(product => product.longFractionDigits));
133
+ setTotalPrice({
134
+ total: !hideTotal ? products.reduce((acc, product) => acc + calculatePrice({
135
+ price: product.price,
136
+ amount: product.amount,
137
+ amountFree: product.amountFree,
138
+ timeUnit: product.noIteration ? 'hours' : iteration.unit,
139
+ timeAmount: product.noIteration ? 1 : iteration.value,
140
+ discount: product.discount
141
+ }), 0) : 0,
142
+ maxTotal: isMaxAmountInProducts ? products.reduce((acc, product) => acc + calculatePrice({
143
+ price: product.price,
144
+ amount: product.maxAmount || product.amount,
145
+ // Not all products have maxAmount, so we need to check both
146
+ amountFree: product.amountFree,
147
+ timeUnit: product.noIteration ? 'hours' : iteration.unit,
148
+ timeAmount: product.noIteration ? 1 : iteration.value,
149
+ discount: product.discount
150
+ }), 0) : 0,
151
+ hourly: products.reduce((acc, product) => acc + (product.noIteration ? 0 : (product.price - product.price * product.discount) * Math.max(product.amount - product.amountFree, 0)), 0),
152
+ 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,
153
+ overlayHourly: products.reduce((acc, product) => acc + (product.noIteration ? 0 : (product.price - product.price * product.discount) * Math.max(product.amount - product.amountFree, 0)), 0),
154
+ 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
155
+ });
156
+ }, [hideTotal, products, iteration, setTotalPrice]);
157
+ useEffect(() => {
158
+ if (hideTimeUnit && (iteration.value > 1 || iteration.unit !== (defaultTimeUnit ?? 'hours'))) {
159
+ setIteration({
160
+ unit: defaultTimeUnit ?? 'hours',
161
+ value: 1
162
+ });
163
+ }
164
+ }, [hideTimeUnit, iteration, defaultTimeUnit]);
165
+ return jsxs(Stack, {
166
+ gap: 2,
167
+ children: [!hideOverlay ? jsx(OverlayComponent, {
168
+ inView: inView,
169
+ totalPrice: totalPrice,
170
+ disableOverlayLeft: disableOverlayLeft,
171
+ disableOverlayRight: disableOverlayRight,
172
+ OverlayLeft: OverlayLeft,
173
+ OverlayRight: OverlayRight,
174
+ isBeta: isBeta,
175
+ discount: discount,
176
+ unit: overlayUnit ?? 'hours',
177
+ children: children
178
+ }) : null, typeof description === 'string' || !description ? jsx(Text, {
179
+ as: "span",
180
+ variant: "body",
181
+ children: description || locales['estimate.cost.description']
182
+ }) : description, alert ? jsx(Alert, {
183
+ sentiment: alertVariant,
184
+ children: alert
185
+ }) : null, jsx(OverlayContextProvider, {
186
+ value: providerValue,
187
+ children: jsxs("div", {
188
+ children: [children ? jsxs(StyledTable, {
189
+ cellPadding: "0",
190
+ cellSpacing: "0",
191
+ ref: ref,
192
+ "data-testid": "summary",
193
+ noTotal: hideTotal,
194
+ children: [jsxs("colgroup", {
195
+ children: [jsx("col", {}), jsx(PriceCol, {})]
196
+ }), !hideTimeUnit ? jsx("thead", {
197
+ children: jsxs("tr", {
198
+ children: [jsx("th", {
199
+ children: jsxs(Title, {
200
+ children: [jsx(StyledIcon, {
201
+ name: "calculator",
202
+ color: "primary",
203
+ size: 20
204
+ }), locales['estimate.cost.label']]
205
+ })
206
+ }), jsx(StyledPriceCell, {
207
+ children: jsx(TimeCell, {
208
+ children: jsx(CustomUnitInput, {
209
+ defaultTimeUnit: defaultTimeUnit,
210
+ setIteration: setIteration,
211
+ iteration: iteration,
212
+ timeUnits: timeUnits
213
+ })
214
+ })
215
+ })]
216
+ })
217
+ }) : null, jsx("tbody", {
218
+ children: Children.map(list, (child, index) => /*#__PURE__*/isValidElement(child) ? /*#__PURE__*/cloneElement(child, {
219
+ isLastElement: index === list.length - 1,
220
+ productsCallback,
221
+ iteration,
222
+ discount: discount && !child.props.discount ? discount : child.props.discount
223
+ }) : child)
224
+ })]
225
+ }) : null, !hideTotal ? jsxs(EmptyTable, {
226
+ cellPadding: "0",
227
+ cellSpacing: "0",
228
+ children: [jsxs("colgroup", {
229
+ children: [jsx("col", {}), jsx(PriceCol, {})]
230
+ }), jsx("tbody", {
231
+ children: jsxs("tr", {
232
+ children: [jsx(EmptyCell, {
233
+ "aria-label": "control"
234
+ }), jsxs(TotalPriceCell, {
235
+ hasBorder: false,
236
+ children: [isBeta ? jsx(BadgeBeta, {
237
+ prominence: "strong",
238
+ long: locales[`estimate.cost.beta.${discount > 0 ? 'discount' : 'free'}`].length > 25,
239
+ sentiment: "warning",
240
+ children: `${discount * 100}
241
+ ${locales[`estimate.cost.beta.${discount > 0 ? 'discount' : 'free'}`]}`
242
+ }) : null, jsx(StyledText, {
243
+ as: "h3",
244
+ variant: "heading",
245
+ color: "primary",
246
+ isBeta: isBeta,
247
+ children: jsxs(LineThrough, {
248
+ isActive: isBeta && (discount === 0 || discount >= 1),
249
+ children: [formatNumber(totalPrice.total, {
250
+ maximumFractionDigits: isLongFractionDigits ? maximumFractionDigitsLong[iteration.unit] : maximumFractionDigits[iteration.unit]
251
+ }), totalPrice.maxTotal > 0 ? ` - ${formatNumber(totalPrice.maxTotal, {
252
+ maximumFractionDigits: isLongFractionDigits ? maximumFractionDigitsLong[iteration.unit] : maximumFractionDigits[iteration.unit]
253
+ })}` : null]
254
+ })
255
+ }), totalPrice.hourly > 0 && totalPrice.hourly !== totalPrice.total && totalPrice.total > 0 ? jsx(RightAlignedText, {
256
+ as: "p",
257
+ variant: "body",
258
+ children: jsxs(LineThrough, {
259
+ isActive: isBeta && (discount === 0 || discount >= 1),
260
+ children: [formatNumber(totalPrice.hourly, {
261
+ maximumFractionDigits: isLongFractionDigits ? maximumFractionDigitsLong.hours : maximumFractionDigits.hours
262
+ }), totalPrice.maxHourly > 0 ? ` - ${formatNumber(totalPrice.maxHourly, {
263
+ maximumFractionDigits: isLongFractionDigits ? maximumFractionDigitsLong.hours : maximumFractionDigits.hours
264
+ })}` : null, "/", locales[`estimate.cost.units.hours.label`].toLowerCase()]
265
+ })
266
+ }) : null]
267
+ })]
268
+ })
269
+ })]
270
+ }) : null, commitmentFees !== undefined || monthlyFees !== undefined ? jsxs(Fragment, {
271
+ children: [jsx(FeesText, {
272
+ as: "h3",
273
+ variant: "headingSmall",
274
+ children: locales[`estimate.cost.fees.${commitmentFees ? 'oneTime' : 'monthly'}.title`]
275
+ }), jsx(StyledFeesTable, {
276
+ children: jsx("tbody", {
277
+ children: jsx(Item, {
278
+ label: commitmentFees ? locales['estimate.cost.fees.commitment'] : monthlyFeesLabel,
279
+ noIteration: true,
280
+ isLastElement: true,
281
+ price: commitmentFees || monthlyFees,
282
+ productsCallback: {
283
+ add: () => {},
284
+ remove: () => {}
285
+ },
286
+ children: commitmentFees ? commitmentFeesContent : monthlyFeesContent
287
+ })
288
+ })
289
+ })]
290
+ }) : null]
291
+ })
292
+ })]
293
+ });
294
+ };
295
+
296
+ export { EstimateCostContent };
@@ -0,0 +1,39 @@
1
+ import { useMemo, useCallback, createContext, useContext } from 'react';
2
+ import EstimateCostLocales from './locales/en.js';
3
+ import { jsx } from '@emotion/react/jsx-runtime';
4
+
5
+ const EstimateCostContext = /*#__PURE__*/createContext({
6
+ locales: EstimateCostLocales,
7
+ formatNumber: () => ''
8
+ });
9
+ const useEstimateCost = () => useContext(EstimateCostContext);
10
+ const EstimateCostProvider = _ref => {
11
+ let {
12
+ children,
13
+ locales,
14
+ currency,
15
+ numberLocales
16
+ } = _ref;
17
+ const newLocales = useMemo(() => locales ? {
18
+ ...EstimateCostLocales,
19
+ ...locales
20
+ } : EstimateCostLocales, [locales]);
21
+ const formatNumber = useCallback((number, options) => {
22
+ const numberFormat = new Intl.NumberFormat(numberLocales, {
23
+ style: 'currency',
24
+ currency,
25
+ ...options
26
+ });
27
+ return numberFormat.format(number);
28
+ }, [currency, numberLocales]);
29
+ const value = useMemo(() => ({
30
+ locales: newLocales,
31
+ formatNumber
32
+ }), [formatNumber, newLocales]);
33
+ return jsx(EstimateCostContext.Provider, {
34
+ value: value,
35
+ children: children
36
+ });
37
+ };
38
+
39
+ export { EstimateCostProvider, useEstimateCost };
@@ -0,0 +1,139 @@
1
+ import _styled from '@emotion/styled/base';
2
+ import { Stack, Icon } from '@ultraviolet/ui';
3
+ import { useMemo, Children, isValidElement, cloneElement } from 'react';
4
+ import flattenChildren from 'react-flatten-children';
5
+ import { LineThrough } from './Components/LineThrough.js';
6
+ import { Strong } from './Components/Strong.js';
7
+ import { useEstimateCost } from './EstimateCostProvider.js';
8
+ import { OverlayContextProvider } from './OverlayContext.js';
9
+ import { OverlayRow, ItemResourceName, StyledBadge } from './componentStyle.js';
10
+ import { multiplier, maximumFractionDigits } from './constants.js';
11
+ import { jsx, jsxs } from '@emotion/react/jsx-runtime';
12
+
13
+ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
14
+ const OverlayContainer = /*#__PURE__*/_styled("div", {
15
+ target: "e1p62vjs2"
16
+ })("position:fixed;z-index:999;left:0;right:0;bottom:", _ref => {
17
+ let {
18
+ inView
19
+ } = _ref;
20
+ return inView ? -120 : 0;
21
+ }, "px;height:120px;background-color:", _ref2 => {
22
+ let {
23
+ theme
24
+ } = _ref2;
25
+ return theme.colors.neutral.background;
26
+ }, ";margin:0 0 0 260px;display:flex;justify-content:center;box-shadow:", _ref3 => {
27
+ let {
28
+ inView,
29
+ theme
30
+ } = _ref3;
31
+ return inView ? '0' : theme.shadows.defaultShadow;
32
+ }, ";transition:bottom 0.3s,box-shadow 0.3s;");
33
+ const List = /*#__PURE__*/_styled("ul", {
34
+ target: "e1p62vjs1"
35
+ })("display:flex;flex-direction:row;justify-content:center;list-style:none;margin:0;padding:", _ref4 => {
36
+ let {
37
+ theme
38
+ } = _ref4;
39
+ return theme.space['3'];
40
+ }, " 0;");
41
+ const SideItem = /*#__PURE__*/_styled("li", {
42
+ target: "e1p62vjs0"
43
+ })(process.env.NODE_ENV === "production" ? {
44
+ name: "wpiop9",
45
+ styles: "display:flex;padding:12px 0;min-width:158px"
46
+ } : {
47
+ name: "wpiop9",
48
+ styles: "display:flex;padding:12px 0;min-width:158px",
49
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
50
+ });
51
+ const OverlayComponent = _ref5 => {
52
+ let {
53
+ children,
54
+ inView = false,
55
+ discount = 1,
56
+ OverlayRight,
57
+ disableOverlayRight = false,
58
+ OverlayLeft,
59
+ disableOverlayLeft = false,
60
+ totalPrice,
61
+ unit = 'hours',
62
+ isBeta = false
63
+ } = _ref5;
64
+ const {
65
+ locales,
66
+ formatNumber
67
+ } = useEstimateCost();
68
+ const value = useMemo(() => ({
69
+ isOverlay: true
70
+ }), []);
71
+ const list = flattenChildren(children);
72
+ const totalOverlayPrice = {
73
+ days: totalPrice.maxOverlayHourly * multiplier.days,
74
+ hours: totalPrice.maxOverlayHourly,
75
+ minutes: totalPrice.maxOverlayHourly * multiplier.minutes,
76
+ seconds: totalPrice.maxOverlayHourly * multiplier.seconds,
77
+ months: totalPrice.maxOverlayHourly * multiplier.months
78
+ }[unit];
79
+ const overlayPrice = {
80
+ days: totalPrice.overlayHourly * multiplier.days,
81
+ hours: totalPrice.overlayHourly,
82
+ minutes: totalPrice.overlayHourly * multiplier.minutes,
83
+ seconds: totalPrice.overlayHourly * multiplier.seconds,
84
+ months: totalPrice.overlayHourly * multiplier.months
85
+ }[unit];
86
+ return jsx(OverlayContextProvider, {
87
+ value: value,
88
+ children: jsx(OverlayContainer, {
89
+ inView: inView,
90
+ "data-testid": "summary-overlay",
91
+ children: jsxs(List, {
92
+ children: [OverlayLeft ? jsx(SideItem, {
93
+ children: jsx(OverlayLeft, {
94
+ disabled: disableOverlayLeft,
95
+ children: locales['estimate.cost.submit.label']
96
+ })
97
+ }) : null, Children.map(list, (child, index) => /*#__PURE__*/isValidElement(child) ? /*#__PURE__*/cloneElement(child, {
98
+ isFirstElement: index === 0,
99
+ isLastElement: index === list.length - 1
100
+ }) : null), jsxs(OverlayRow, {
101
+ children: [jsxs(Stack, {
102
+ direction: "row",
103
+ alignItems: "center",
104
+ gap: 1,
105
+ children: [jsx(Icon, {
106
+ name: "calculator",
107
+ color: "primary",
108
+ size: 20
109
+ }), locales['estimate.cost.label']]
110
+ }), jsxs(ItemResourceName, {
111
+ animated: false,
112
+ children: [jsx(Strong, {
113
+ variant: "big",
114
+ children: jsxs(LineThrough, {
115
+ isActive: isBeta && discount === 0,
116
+ children: [formatNumber(overlayPrice, {
117
+ maximumFractionDigits: maximumFractionDigits[unit]
118
+ }), totalOverlayPrice > 0 ? ` - ${formatNumber(totalOverlayPrice, {
119
+ maximumFractionDigits: maximumFractionDigits[unit]
120
+ })}` : null, "/", locales[`estimate.cost.units.${unit}.label`]]
121
+ })
122
+ }), isBeta ? jsx(StyledBadge, {
123
+ prominence: "strong",
124
+ sentiment: "warning",
125
+ children: locales[`estimate.cost.beta.${discount > 0 ? 'discount' : 'free'}`]
126
+ }) : null]
127
+ })]
128
+ }), OverlayRight ? jsx(SideItem, {
129
+ children: jsx(OverlayRight, {
130
+ disabled: disableOverlayRight,
131
+ children: locales['estimate.cost.submit.label']
132
+ })
133
+ }) : null]
134
+ })
135
+ })
136
+ });
137
+ };
138
+
139
+ export { OverlayComponent };
@@ -0,0 +1,19 @@
1
+ import { useContext, createContext } from 'react';
2
+ import { jsx } from '@emotion/react/jsx-runtime';
3
+
4
+ const OverlayContext = /*#__PURE__*/createContext({
5
+ isOverlay: false
6
+ });
7
+ const useOverlay = () => useContext(OverlayContext);
8
+ const OverlayContextProvider = _ref => {
9
+ let {
10
+ children,
11
+ value
12
+ } = _ref;
13
+ return jsx(OverlayContext.Provider, {
14
+ value: value,
15
+ children: children
16
+ });
17
+ };
18
+
19
+ export { OverlayContextProvider, useOverlay };
@@ -0,0 +1,196 @@
1
+ import _styled from '@emotion/styled/base';
2
+ import { css } from '@emotion/react';
3
+ import { Badge, zoomIn } from '@ultraviolet/ui';
4
+ import { MAX_CELL_WIDTH } from './constants.js';
5
+
6
+ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
7
+ const spacedChildren = process.env.NODE_ENV === "production" ? {
8
+ name: "14bpf6g",
9
+ styles: ">*{margin-top:0;}>*+*{margin-top:16px;}"
10
+ } : {
11
+ name: "14bpf6g",
12
+ styles: ">*{margin-top:0;}>*+*{margin-top:16px;}",
13
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
14
+ };
15
+ const StyledDiv = /*#__PURE__*/_styled("div", {
16
+ target: "e1xb5k8j14"
17
+ })(process.env.NODE_ENV === "production" ? {
18
+ name: "158icaa",
19
+ styles: "margin-left:4px"
20
+ } : {
21
+ name: "158icaa",
22
+ styles: "margin-left:4px",
23
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
24
+ });
25
+ const StyledTable = /*#__PURE__*/_styled('table', {
26
+ shouldForwardProp: prop => !['noTotal'].includes(prop),
27
+ target: "e1xb5k8j13"
28
+ })("width:100%;", spacedChildren, ";border:1px solid ", _ref => {
29
+ let {
30
+ theme
31
+ } = _ref;
32
+ return theme.colors.neutral.border;
33
+ }, ";", _ref2 => {
34
+ let {
35
+ noTotal
36
+ } = _ref2;
37
+ return noTotal ? 'border-radius: 4px;' : 'border-radius: 4px 4px 0 4px;';
38
+ }, ";");
39
+ const StyledFeesTable = /*#__PURE__*/_styled('table', {
40
+ target: "e1xb5k8j12"
41
+ })("width:100%;", spacedChildren, ";border:1px solid ", _ref3 => {
42
+ let {
43
+ theme
44
+ } = _ref3;
45
+ return theme.colors.neutral.border;
46
+ }, ";border-radius:4px;margin-top:16px;");
47
+ const PriceCol = /*#__PURE__*/_styled("td", {
48
+ target: "e1xb5k8j11"
49
+ })("background-color:", _ref4 => {
50
+ let {
51
+ theme
52
+ } = _ref4;
53
+ return theme.colors.neutral.background;
54
+ }, ";");
55
+ const PriceCell = theme => /*#__PURE__*/css("border-left:1px solid ", theme.colors.neutral.border, ";background-color:", theme.colors.neutral.backgroundWeak, ";");
56
+ const Cell = /*#__PURE__*/_styled('td', {
57
+ shouldForwardProp: prop => !['tabulation', 'hasBorder', 'primary'].includes(prop),
58
+ target: "e1xb5k8j10"
59
+ })("padding-left:", _ref5 => {
60
+ let {
61
+ tabulation
62
+ } = _ref5;
63
+ return (tabulation ?? 0) * 8 + 16;
64
+ }, "px;padding-right:16px;position:relative;max-width:", MAX_CELL_WIDTH, ";", _ref6 => {
65
+ let {
66
+ theme,
67
+ hasBorder
68
+ } = _ref6;
69
+ return hasBorder && /*#__PURE__*/css("&:before{content:'';position:absolute;left:0;bottom:0;height:1px;width:calc(100% - 32px);margin-left:16px;border-bottom:1px solid ", theme.colors.neutral.border, ";}");
70
+ }, " ", _ref7 => {
71
+ let {
72
+ theme,
73
+ primary
74
+ } = _ref7;
75
+ return primary ? /*#__PURE__*/css("background:", theme.colors.primary.background, ";") : null;
76
+ }, ";");
77
+ const TotalPriceCell = /*#__PURE__*/_styled(Cell, {
78
+ target: "e1xb5k8j9"
79
+ })("border-color:", _ref8 => {
80
+ let {
81
+ theme
82
+ } = _ref8;
83
+ return theme.colors.neutral.border;
84
+ }, ";border-style:solid;border-width:0 1px 1px 1px;border-radius:0 0 4px 4px;min-width:202px;height:56px;background-color:", _ref9 => {
85
+ let {
86
+ theme
87
+ } = _ref9;
88
+ return theme.colors.primary.background;
89
+ }, ";");
90
+ const EmptyTable = /*#__PURE__*/_styled("table", {
91
+ target: "e1xb5k8j8"
92
+ })(process.env.NODE_ENV === "production" ? {
93
+ name: "1bmvmcg",
94
+ styles: "margin:0;width:100%"
95
+ } : {
96
+ name: "1bmvmcg",
97
+ styles: "margin:0;width:100%",
98
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
99
+ });
100
+ const Title = /*#__PURE__*/_styled("h3", {
101
+ target: "e1xb5k8j7"
102
+ })("display:flex;align-items:center;padding:0;margin:0;font-size:18px;color:", _ref10 => {
103
+ let {
104
+ theme
105
+ } = _ref10;
106
+ return theme.colors.neutral.text;
107
+ }, ";font-weight:500;padding:", _ref11 => {
108
+ let {
109
+ theme
110
+ } = _ref11;
111
+ return theme.space['2'];
112
+ }, ";");
113
+ const EmptyCell = /*#__PURE__*/_styled("td", {
114
+ target: "e1xb5k8j6"
115
+ })(process.env.NODE_ENV === "production" ? {
116
+ name: "22sgtr",
117
+ styles: "width:538px"
118
+ } : {
119
+ name: "22sgtr",
120
+ styles: "width:538px",
121
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
122
+ });
123
+ const TimeCell = /*#__PURE__*/_styled("div", {
124
+ target: "e1xb5k8j5"
125
+ })(process.env.NODE_ENV === "production" ? {
126
+ name: "1dh7njz",
127
+ styles: "max-width:200px;padding:16px;align-items:start;text-align:left;float:right"
128
+ } : {
129
+ name: "1dh7njz",
130
+ styles: "max-width:200px;padding:16px;align-items:start;text-align:left;float:right",
131
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
132
+ });
133
+ const BadgeBeta = /*#__PURE__*/_styled(Badge, {
134
+ shouldForwardProp: prop => !['long'].includes(prop),
135
+ target: "e1xb5k8j4"
136
+ })("margin-left:", _ref12 => {
137
+ let {
138
+ long
139
+ } = _ref12;
140
+ return long ? '-185px' : '-115px';
141
+ }, ";position:absolute;top:calc(50% - 16px);");
142
+ const OverlayRow = /*#__PURE__*/_styled('li', {
143
+ shouldForwardProp: prop => !['isFirstElement', 'shouldBeHidden', 'hideFromOverlay'].includes(prop),
144
+ target: "e1xb5k8j3"
145
+ })("min-width:200px;padding:0 24px;border-left:1px solid ", _ref13 => {
146
+ let {
147
+ theme
148
+ } = _ref13;
149
+ return theme.colors.neutral.border;
150
+ }, ";", _ref14 => {
151
+ let {
152
+ isFirstElement
153
+ } = _ref14;
154
+ return isFirstElement && `border: 0;`;
155
+ }, " &:first-of-type,&:last-child{border:0;}@media (max-width: 1420px){", _ref15 => {
156
+ let {
157
+ shouldBeHidden
158
+ } = _ref15;
159
+ return shouldBeHidden && 'display: none;';
160
+ }, ";}", _ref16 => {
161
+ let {
162
+ hideFromOverlay
163
+ } = _ref16;
164
+ return hideFromOverlay && 'display: none;';
165
+ }, ";");
166
+ const StyledLeftSide = /*#__PURE__*/_styled("div", {
167
+ target: "e1xb5k8j2"
168
+ })(process.env.NODE_ENV === "production" ? {
169
+ name: "1x1yonv",
170
+ styles: "display:flex;flex-direction:row;-webkit-box-pack:justify;justify-content:space-between;align-items:center;min-height:56px;padding-top:8px;padding-bottom:8px"
171
+ } : {
172
+ name: "1x1yonv",
173
+ styles: "display:flex;flex-direction:row;-webkit-box-pack:justify;justify-content:space-between;align-items:center;min-height:56px;padding-top:8px;padding-bottom:8px",
174
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
175
+ });
176
+ const ItemResourceName = /*#__PURE__*/_styled('div', {
177
+ shouldForwardProp: prop => !['animated'].includes(prop),
178
+ target: "e1xb5k8j1"
179
+ })("height:48px;display:flex;flex-direction:column;-webkit-box-pack:center;justify-content:center;animation:", _ref17 => {
180
+ let {
181
+ animated
182
+ } = _ref17;
183
+ return animated ? /*#__PURE__*/css("800ms ", zoomIn, ";") : '';
184
+ }, ";");
185
+ const StyledBadge = /*#__PURE__*/_styled(Badge, {
186
+ target: "e1xb5k8j0"
187
+ })(process.env.NODE_ENV === "production" ? {
188
+ name: "72s22w",
189
+ styles: "display:inline-block;height:24px;line-height:18px;font-size:12px;margin-right:8px"
190
+ } : {
191
+ name: "72s22w",
192
+ styles: "display:inline-block;height:24px;line-height:18px;font-size:12px;margin-right:8px",
193
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
194
+ });
195
+
196
+ export { BadgeBeta, Cell, EmptyCell, EmptyTable, ItemResourceName, OverlayRow, PriceCell, PriceCol, StyledBadge, StyledDiv, StyledFeesTable, StyledLeftSide, StyledTable, TimeCell, Title, TotalPriceCell };