@ultraviolet/plus 0.5.5 → 0.5.6
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/README.md +0 -1
- package/dist/@ultraviolet/icons/dist/components/Icon/index.js +21 -24
- package/dist/src/components/CodeEditor/CodeEditor.js +35 -47
- package/dist/src/components/ContentCard/Skeleton.js +34 -49
- package/dist/src/components/ContentCard/index.js +52 -92
- package/dist/src/components/ContentCardGroup/Card.js +70 -106
- package/dist/src/components/ContentCardGroup/SkeletonCard.js +8 -17
- package/dist/src/components/ContentCardGroup/index.js +19 -31
- package/dist/src/components/EstimateCost/Components/CustomUnitInput.js +9 -13
- package/dist/src/components/EstimateCost/Components/Item.js +70 -86
- package/dist/src/components/EstimateCost/Components/LineThrough.js +4 -7
- package/dist/src/components/EstimateCost/Components/NumberInput.js +7 -8
- package/dist/src/components/EstimateCost/Components/Region.js +17 -21
- package/dist/src/components/EstimateCost/Components/Regular.js +14 -24
- package/dist/src/components/EstimateCost/Components/Strong.js +16 -28
- package/dist/src/components/EstimateCost/Components/Unit.js +6 -7
- package/dist/src/components/EstimateCost/Components/UnitInput.js +74 -95
- package/dist/src/components/EstimateCost/Components/Zone.js +17 -21
- package/dist/src/components/EstimateCost/EstimateCost.js +64 -74
- package/dist/src/components/EstimateCost/EstimateCostContent.js +41 -55
- package/dist/src/components/EstimateCost/EstimateCostProvider.js +6 -7
- package/dist/src/components/EstimateCost/OverlayComponent.js +23 -36
- package/dist/src/components/EstimateCost/OverlayContext.js +7 -10
- package/dist/src/components/EstimateCost/componentStyle.js +45 -96
- package/dist/src/components/EstimateCost/helper.js +8 -9
- package/package.json +4 -4
|
@@ -7,37 +7,25 @@ import { jsx, Fragment } from '@emotion/react/jsx-runtime';
|
|
|
7
7
|
|
|
8
8
|
const StyledWrapper = /*#__PURE__*/_styled(Stack, {
|
|
9
9
|
target: "e1393dgx0"
|
|
10
|
-
})("border-radius:",
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
},
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
loading
|
|
30
|
-
} = _ref4;
|
|
31
|
-
return jsx(StyledWrapper, {
|
|
32
|
-
direction: "column",
|
|
33
|
-
ref: ref,
|
|
34
|
-
children: !loading ? children : jsx(Fragment, {
|
|
35
|
-
children: Children.map(children, (_child, index) =>
|
|
36
|
-
// eslint-disable-next-line react/no-array-index-key
|
|
37
|
-
jsx(SkeletonCard, {}, index))
|
|
38
|
-
})
|
|
39
|
-
});
|
|
40
|
-
});
|
|
10
|
+
})("border-radius:", ({
|
|
11
|
+
theme
|
|
12
|
+
}) => theme.radii.default, ";border:1px solid ", ({
|
|
13
|
+
theme
|
|
14
|
+
}) => theme.colors.neutral.border, ";background:", ({
|
|
15
|
+
theme
|
|
16
|
+
}) => theme.colors.neutral.background, ";min-width:0;");
|
|
17
|
+
const BaseContentCardGroup = /*#__PURE__*/forwardRef(({
|
|
18
|
+
children,
|
|
19
|
+
loading
|
|
20
|
+
}, ref) => jsx(StyledWrapper, {
|
|
21
|
+
direction: "column",
|
|
22
|
+
ref: ref,
|
|
23
|
+
children: !loading ? children : jsx(Fragment, {
|
|
24
|
+
children: Children.map(children, (_child, index) =>
|
|
25
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
26
|
+
jsx(SkeletonCard, {}, index))
|
|
27
|
+
})
|
|
28
|
+
}));
|
|
41
29
|
const ContentCardGroup = /*#__PURE__*/Object.assign(BaseContentCardGroup, {
|
|
42
30
|
Card
|
|
43
31
|
});
|
|
@@ -3,13 +3,12 @@ import { useEstimateCost } from '../EstimateCostProvider.js';
|
|
|
3
3
|
import { UnitInput } from './UnitInput.js';
|
|
4
4
|
import { jsx } from '@emotion/react/jsx-runtime';
|
|
5
5
|
|
|
6
|
-
const CustomUnitInput =
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
} = _ref;
|
|
6
|
+
const CustomUnitInput = ({
|
|
7
|
+
defaultTimeUnit = 'hours',
|
|
8
|
+
setIteration,
|
|
9
|
+
iteration,
|
|
10
|
+
timeUnits
|
|
11
|
+
}) => {
|
|
13
12
|
const {
|
|
14
13
|
locales
|
|
15
14
|
} = useEstimateCost();
|
|
@@ -17,12 +16,9 @@ const CustomUnitInput = _ref => {
|
|
|
17
16
|
value: unit,
|
|
18
17
|
label: locales[`estimate.cost.units.${unit}.label`]
|
|
19
18
|
})), [timeUnits, locales]);
|
|
20
|
-
const defaultOption = useMemo(() => options.find(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
} = _ref2;
|
|
24
|
-
return value === defaultTimeUnit;
|
|
25
|
-
}), [defaultTimeUnit, options]);
|
|
19
|
+
const defaultOption = useMemo(() => options.find(({
|
|
20
|
+
value
|
|
21
|
+
}) => value === defaultTimeUnit), [defaultTimeUnit, options]);
|
|
26
22
|
return jsx(UnitInput, {
|
|
27
23
|
name: "iteration",
|
|
28
24
|
onChange: inputValue => setIteration({
|
|
@@ -15,34 +15,22 @@ const TIME_RELATED_UNIT = ['seconds', 'minutes', 'hours', 'days', 'months'];
|
|
|
15
15
|
const StyledResourceName = /*#__PURE__*/_styled('div', {
|
|
16
16
|
shouldForwardProp: prop => !['isOverlay', 'animated'].includes(prop),
|
|
17
17
|
target: "e1kzy2rr7"
|
|
18
|
-
})("text-align:",
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}, ";",
|
|
24
|
-
let {
|
|
25
|
-
isOverlay,
|
|
26
|
-
animated
|
|
27
|
-
} = _ref2;
|
|
28
|
-
return isOverlay ? /*#__PURE__*/css("height:48px;display:flex;flex-direction:column;-webkit-box-pack:center;justify-content:center;animation:", animated ? /*#__PURE__*/css("800ms ", zoomIn, ";") : '', ";") : null;
|
|
29
|
-
}, ";");
|
|
18
|
+
})("text-align:", ({
|
|
19
|
+
isOverlay
|
|
20
|
+
}) => isOverlay ? 'initial' : 'right', ";", ({
|
|
21
|
+
isOverlay,
|
|
22
|
+
animated
|
|
23
|
+
}) => isOverlay ? /*#__PURE__*/css("height:48px;display:flex;flex-direction:column;-webkit-box-pack:center;justify-content:center;animation:", animated ? /*#__PURE__*/css("800ms ", zoomIn, ";") : '', ";") : null, ";");
|
|
30
24
|
const StyledBadge = /*#__PURE__*/_styled(Badge, {
|
|
31
25
|
target: "e1kzy2rr6"
|
|
32
|
-
})("margin-left:",
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
} = _ref3;
|
|
36
|
-
return theme.space['1'];
|
|
37
|
-
}, ";align-self:center;");
|
|
26
|
+
})("margin-left:", ({
|
|
27
|
+
theme
|
|
28
|
+
}) => theme.space['1'], ";align-self:center;");
|
|
38
29
|
const StyledText = /*#__PURE__*/_styled(Text, {
|
|
39
30
|
target: "e1kzy2rr5"
|
|
40
|
-
})("margin-left:",
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
} = _ref4;
|
|
44
|
-
return theme.space['1'];
|
|
45
|
-
}, ";");
|
|
31
|
+
})("margin-left:", ({
|
|
32
|
+
theme
|
|
33
|
+
}) => theme.space['1'], ";");
|
|
46
34
|
const MaxWidthText = /*#__PURE__*/_styled(Text, {
|
|
47
35
|
target: "e1kzy2rr4"
|
|
48
36
|
})(process.env.NODE_ENV === "production" ? {
|
|
@@ -75,12 +63,9 @@ const StyledTooltip = /*#__PURE__*/_styled(Tooltip, {
|
|
|
75
63
|
});
|
|
76
64
|
const StyledPriceCell = /*#__PURE__*/_styled(Cell, {
|
|
77
65
|
target: "e1kzy2rr1"
|
|
78
|
-
})(
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
} = _ref5;
|
|
82
|
-
return PriceCell(theme);
|
|
83
|
-
}, ";");
|
|
66
|
+
})(({
|
|
67
|
+
theme
|
|
68
|
+
}) => PriceCell(theme), ";");
|
|
84
69
|
const StyleNoPriceItem = /*#__PURE__*/_styled(Text, {
|
|
85
70
|
target: "e1kzy2rr0"
|
|
86
71
|
})(process.env.NODE_ENV === "production" ? {
|
|
@@ -91,62 +76,61 @@ const StyleNoPriceItem = /*#__PURE__*/_styled(Text, {
|
|
|
91
76
|
styles: "text-align:right",
|
|
92
77
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
93
78
|
});
|
|
94
|
-
const Item =
|
|
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
|
-
} = _ref6;
|
|
79
|
+
const Item = ({
|
|
80
|
+
discount = 0,
|
|
81
|
+
priceText,
|
|
82
|
+
discountText,
|
|
83
|
+
label,
|
|
84
|
+
tooltipInfo,
|
|
85
|
+
// Shows an icon with tooltip that contains this text
|
|
86
|
+
subLabel = '',
|
|
87
|
+
// Usually used for showing amount that is free
|
|
88
|
+
price: basePrice = 0,
|
|
89
|
+
// Hourly price for one unit
|
|
90
|
+
monthlyPrice = 0,
|
|
91
|
+
// Price per month
|
|
92
|
+
unit: baseUnit,
|
|
93
|
+
// Can be GB, MB, Node, Queries, etc.
|
|
94
|
+
amount: currentAmount = 1,
|
|
95
|
+
// Current number of items
|
|
96
|
+
onAmountChange,
|
|
97
|
+
amountFree = 0,
|
|
98
|
+
// Amount that is free - offered by company
|
|
99
|
+
maxAmount = 0,
|
|
100
|
+
// Max amount - used for kubernetes for example
|
|
101
|
+
longFractionDigits = false,
|
|
102
|
+
// In case price is really long 0.0000076 - up 7 fraction digits
|
|
103
|
+
noIteration = false,
|
|
104
|
+
// if item is not based on time (ex: download, upload, transfer)
|
|
105
|
+
noIterationText,
|
|
106
|
+
noBorder,
|
|
107
|
+
// remove the border bottom of the item
|
|
108
|
+
noPrice,
|
|
109
|
+
// remove the price on right side of the table
|
|
110
|
+
isDefined = true,
|
|
111
|
+
children = null,
|
|
112
|
+
isFirstElement = false,
|
|
113
|
+
isLastElement = false,
|
|
114
|
+
isPrimaryBackground = false,
|
|
115
|
+
productsCallback,
|
|
116
|
+
iteration: receivedIteration,
|
|
117
|
+
// Object from parent that contains time period (hours, days, months)
|
|
118
|
+
shouldBeHidden = false,
|
|
119
|
+
// Hide element from overlay if screen width is small
|
|
120
|
+
hideFromOverlay = false,
|
|
121
|
+
// Hide element from overlay in any case
|
|
122
|
+
textNotDefined,
|
|
123
|
+
// Text to display in case of not defined value
|
|
124
|
+
animated = false,
|
|
125
|
+
// if true, zoomIn animation is triggered
|
|
126
|
+
tabulation,
|
|
127
|
+
// Increase left padding of the item
|
|
128
|
+
labelTextVariant,
|
|
129
|
+
// To change left cell typography variant
|
|
130
|
+
labelTextProminence,
|
|
131
|
+
// To change left cell typography prominence
|
|
132
|
+
notice // To display a gray text below the label
|
|
133
|
+
}) => {
|
|
150
134
|
const {
|
|
151
135
|
locales,
|
|
152
136
|
formatNumber
|
|
@@ -4,12 +4,9 @@ import { css } from '@emotion/react';
|
|
|
4
4
|
const LineThrough = /*#__PURE__*/_styled('span', {
|
|
5
5
|
shouldForwardProp: prop => !['isActive'].includes(prop),
|
|
6
6
|
target: "e1d1k6i0"
|
|
7
|
-
})(
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
} = _ref;
|
|
12
|
-
return isActive ? /*#__PURE__*/css("text-decoration-line:line-through;text-decoration-color:", theme.colors.warning.border, ";") : null;
|
|
13
|
-
}, ";");
|
|
7
|
+
})(({
|
|
8
|
+
isActive,
|
|
9
|
+
theme
|
|
10
|
+
}) => isActive ? /*#__PURE__*/css("text-decoration-line:line-through;text-decoration-color:", theme.colors.warning.border, ";") : null, ";");
|
|
14
11
|
|
|
15
12
|
export { LineThrough };
|
|
@@ -5,14 +5,13 @@ import { ItemResourceName } from '../componentStyle.js';
|
|
|
5
5
|
import { Regular } from './Regular.js';
|
|
6
6
|
import { jsx } from '@emotion/react/jsx-runtime';
|
|
7
7
|
|
|
8
|
-
const NumberInput =
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
} = _ref;
|
|
8
|
+
const NumberInput = ({
|
|
9
|
+
amount,
|
|
10
|
+
minValue = 0,
|
|
11
|
+
maxValue = 100,
|
|
12
|
+
getAmountValue,
|
|
13
|
+
itemCallback
|
|
14
|
+
}) => {
|
|
16
15
|
const {
|
|
17
16
|
isOverlay
|
|
18
17
|
} = useOverlay();
|
|
@@ -6,27 +6,23 @@ import { jsx, jsxs } from '@emotion/react/jsx-runtime';
|
|
|
6
6
|
|
|
7
7
|
const StyledImage = /*#__PURE__*/_styled("img", {
|
|
8
8
|
target: "exu7lwu0"
|
|
9
|
-
})("width:15px;margin-right:",
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
discount,
|
|
27
|
-
noBorder,
|
|
28
|
-
noPrice
|
|
29
|
-
} = _ref2;
|
|
9
|
+
})("width:15px;margin-right:", ({
|
|
10
|
+
theme
|
|
11
|
+
}) => theme.space['1'], ";");
|
|
12
|
+
const Region = ({
|
|
13
|
+
label,
|
|
14
|
+
image,
|
|
15
|
+
shouldBeHidden = false,
|
|
16
|
+
priceText,
|
|
17
|
+
animated = false,
|
|
18
|
+
isFirstElement,
|
|
19
|
+
isLastElement,
|
|
20
|
+
productsCallback,
|
|
21
|
+
iteration,
|
|
22
|
+
discount,
|
|
23
|
+
noBorder,
|
|
24
|
+
noPrice
|
|
25
|
+
}) => {
|
|
30
26
|
const {
|
|
31
27
|
locales
|
|
32
28
|
} = useEstimateCost();
|
|
@@ -6,30 +6,20 @@ import { jsx } from '@emotion/react/jsx-runtime';
|
|
|
6
6
|
const StyledRegular = /*#__PURE__*/_styled('div', {
|
|
7
7
|
shouldForwardProp: prop => !['variant', 'isOverlay'].includes(prop),
|
|
8
8
|
target: "e1l9k4qo0"
|
|
9
|
-
})("display:",
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
} = _ref3;
|
|
24
|
-
return variant === 'small' && /*#__PURE__*/css("display:block;font-size:14px;line-height:8px;color:", theme.colors.neutral.text, ";");
|
|
25
|
-
}, ";");
|
|
26
|
-
const Regular = _ref4 => {
|
|
27
|
-
let {
|
|
28
|
-
variant = 'normal',
|
|
29
|
-
isDisabledOnOverlay = false,
|
|
30
|
-
children = null,
|
|
31
|
-
className
|
|
32
|
-
} = _ref4;
|
|
9
|
+
})("display:", ({
|
|
10
|
+
isOverlay
|
|
11
|
+
}) => isOverlay ? 'flex' : 'inline-flex', ";max-width:500px;align-items:center;font-size:16px;color:", ({
|
|
12
|
+
theme
|
|
13
|
+
}) => theme.colors.neutral.textStrong, ";margin-right:4px;", ({
|
|
14
|
+
theme,
|
|
15
|
+
variant
|
|
16
|
+
}) => variant === 'small' && /*#__PURE__*/css("display:block;font-size:14px;line-height:8px;color:", theme.colors.neutral.text, ";"), ";");
|
|
17
|
+
const Regular = ({
|
|
18
|
+
variant = 'normal',
|
|
19
|
+
isDisabledOnOverlay = false,
|
|
20
|
+
children = null,
|
|
21
|
+
className
|
|
22
|
+
}) => {
|
|
33
23
|
const {
|
|
34
24
|
isOverlay
|
|
35
25
|
} = useOverlay();
|
|
@@ -5,33 +5,21 @@ import { jsx } from '@emotion/react/jsx-runtime';
|
|
|
5
5
|
const StyledStrong = /*#__PURE__*/_styled(Regular, {
|
|
6
6
|
shouldForwardProp: prop => !['variant'].includes(prop),
|
|
7
7
|
target: "e1bhvxf60"
|
|
8
|
-
})("display:inline-flex;align-items:center;font-size:",
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
const Strong = _ref4 => {
|
|
25
|
-
let {
|
|
26
|
-
variant = 'normal',
|
|
27
|
-
children = null,
|
|
28
|
-
isDisabledOnOverlay = false
|
|
29
|
-
} = _ref4;
|
|
30
|
-
return jsx(StyledStrong, {
|
|
31
|
-
variant: variant,
|
|
32
|
-
isDisabledOnOverlay: isDisabledOnOverlay,
|
|
33
|
-
children: children
|
|
34
|
-
});
|
|
35
|
-
};
|
|
8
|
+
})("display:inline-flex;align-items:center;font-size:", ({
|
|
9
|
+
variant
|
|
10
|
+
}) => variant === 'big' ? 24 : 16, "px;", ({
|
|
11
|
+
variant
|
|
12
|
+
}) => variant === 'capitalized' ? `text-transform: capitalize;` : '', " color:", ({
|
|
13
|
+
theme
|
|
14
|
+
}) => theme.colors.neutral.textStrong, ";font-weight:500;margin-right:4px;");
|
|
15
|
+
const Strong = ({
|
|
16
|
+
variant = 'normal',
|
|
17
|
+
children = null,
|
|
18
|
+
isDisabledOnOverlay = false
|
|
19
|
+
}) => jsx(StyledStrong, {
|
|
20
|
+
variant: variant,
|
|
21
|
+
isDisabledOnOverlay: isDisabledOnOverlay,
|
|
22
|
+
children: children
|
|
23
|
+
});
|
|
36
24
|
|
|
37
25
|
export { Strong, StyledStrong };
|
|
@@ -17,13 +17,12 @@ const StyledTextInput = /*#__PURE__*/_styled(TextInput, {
|
|
|
17
17
|
styles: "input[type='number']::-webkit-inner-spin-button,input[type='number']::-webkit-outer-spin-button{-webkit-appearance:none;margin:0;}input[type='number']{-moz-appearance:textfield;}",
|
|
18
18
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
19
19
|
});
|
|
20
|
-
const Unit =
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
} = _ref;
|
|
20
|
+
const Unit = ({
|
|
21
|
+
amount,
|
|
22
|
+
itemCallback,
|
|
23
|
+
getAmountValue,
|
|
24
|
+
unit
|
|
25
|
+
}) => {
|
|
27
26
|
const {
|
|
28
27
|
isOverlay
|
|
29
28
|
} = useOverlay();
|