@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.
Files changed (26) hide show
  1. package/README.md +0 -1
  2. package/dist/@ultraviolet/icons/dist/components/Icon/index.js +21 -24
  3. package/dist/src/components/CodeEditor/CodeEditor.js +35 -47
  4. package/dist/src/components/ContentCard/Skeleton.js +34 -49
  5. package/dist/src/components/ContentCard/index.js +52 -92
  6. package/dist/src/components/ContentCardGroup/Card.js +70 -106
  7. package/dist/src/components/ContentCardGroup/SkeletonCard.js +8 -17
  8. package/dist/src/components/ContentCardGroup/index.js +19 -31
  9. package/dist/src/components/EstimateCost/Components/CustomUnitInput.js +9 -13
  10. package/dist/src/components/EstimateCost/Components/Item.js +70 -86
  11. package/dist/src/components/EstimateCost/Components/LineThrough.js +4 -7
  12. package/dist/src/components/EstimateCost/Components/NumberInput.js +7 -8
  13. package/dist/src/components/EstimateCost/Components/Region.js +17 -21
  14. package/dist/src/components/EstimateCost/Components/Regular.js +14 -24
  15. package/dist/src/components/EstimateCost/Components/Strong.js +16 -28
  16. package/dist/src/components/EstimateCost/Components/Unit.js +6 -7
  17. package/dist/src/components/EstimateCost/Components/UnitInput.js +74 -95
  18. package/dist/src/components/EstimateCost/Components/Zone.js +17 -21
  19. package/dist/src/components/EstimateCost/EstimateCost.js +64 -74
  20. package/dist/src/components/EstimateCost/EstimateCostContent.js +41 -55
  21. package/dist/src/components/EstimateCost/EstimateCostProvider.js +6 -7
  22. package/dist/src/components/EstimateCost/OverlayComponent.js +23 -36
  23. package/dist/src/components/EstimateCost/OverlayContext.js +7 -10
  24. package/dist/src/components/EstimateCost/componentStyle.js +45 -96
  25. package/dist/src/components/EstimateCost/helper.js +8 -9
  26. package/package.json +4 -4
@@ -25,68 +25,41 @@ const StyledDiv = /*#__PURE__*/_styled("div", {
25
25
  const StyledTable = /*#__PURE__*/_styled('table', {
26
26
  shouldForwardProp: prop => !['noTotal'].includes(prop),
27
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
- }, ";");
28
+ })("width:100%;", spacedChildren, ";border:1px solid ", ({
29
+ theme
30
+ }) => theme.colors.neutral.border, ";", ({
31
+ noTotal
32
+ }) => noTotal ? 'border-radius: 4px;' : 'border-radius: 4px 4px 0 4px;', ";");
39
33
  const StyledFeesTable = /*#__PURE__*/_styled('table', {
40
34
  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;");
35
+ })("width:100%;", spacedChildren, ";border:1px solid ", ({
36
+ theme
37
+ }) => theme.colors.neutral.border, ";border-radius:4px;margin-top:16px;");
47
38
  const PriceCol = /*#__PURE__*/_styled("td", {
48
39
  target: "e1xb5k8j11"
49
- })("background-color:", _ref4 => {
50
- let {
51
- theme
52
- } = _ref4;
53
- return theme.colors.neutral.background;
54
- }, ";");
40
+ })("background-color:", ({
41
+ theme
42
+ }) => theme.colors.neutral.background, ";");
55
43
  const PriceCell = theme => /*#__PURE__*/css("border-left:1px solid ", theme.colors.neutral.border, ";background-color:", theme.colors.neutral.backgroundWeak, ";");
56
44
  const Cell = /*#__PURE__*/_styled('td', {
57
45
  shouldForwardProp: prop => !['tabulation', 'hasBorder', 'primary'].includes(prop),
58
46
  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
- }, ";");
47
+ })("padding-left:", ({
48
+ tabulation
49
+ }) => (tabulation ?? 0) * 8 + 16, "px;padding-right:16px;position:relative;max-width:", MAX_CELL_WIDTH, ";", ({
50
+ theme,
51
+ hasBorder
52
+ }) => 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, ";}"), " ", ({
53
+ theme,
54
+ primary
55
+ }) => primary ? /*#__PURE__*/css("background:", theme.colors.primary.background, ";") : null, ";");
77
56
  const TotalPriceCell = /*#__PURE__*/_styled(Cell, {
78
57
  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
- }, ";");
58
+ })("border-color:", ({
59
+ theme
60
+ }) => theme.colors.neutral.border, ";border-style:solid;border-width:0 1px 1px 1px;border-radius:0 0 4px 4px;min-width:202px;height:56px;background-color:", ({
61
+ theme
62
+ }) => theme.colors.primary.background, ";");
90
63
  const EmptyTable = /*#__PURE__*/_styled("table", {
91
64
  target: "e1xb5k8j8"
92
65
  })(process.env.NODE_ENV === "production" ? {
@@ -99,17 +72,11 @@ const EmptyTable = /*#__PURE__*/_styled("table", {
99
72
  });
100
73
  const Title = /*#__PURE__*/_styled("h3", {
101
74
  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
- }, ";");
75
+ })("display:flex;align-items:center;padding:0;margin:0;font-size:18px;color:", ({
76
+ theme
77
+ }) => theme.colors.neutral.text, ";font-weight:500;padding:", ({
78
+ theme
79
+ }) => theme.space['2'], ";");
113
80
  const EmptyCell = /*#__PURE__*/_styled("td", {
114
81
  target: "e1xb5k8j6"
115
82
  })(process.env.NODE_ENV === "production" ? {
@@ -133,36 +100,21 @@ const TimeCell = /*#__PURE__*/_styled("div", {
133
100
  const BadgeBeta = /*#__PURE__*/_styled(Badge, {
134
101
  shouldForwardProp: prop => !['long'].includes(prop),
135
102
  target: "e1xb5k8j4"
136
- })("margin-left:", _ref12 => {
137
- let {
138
- long
139
- } = _ref12;
140
- return long ? '-185px' : '-115px';
141
- }, ";position:absolute;top:calc(50% - 16px);");
103
+ })("margin-left:", ({
104
+ long
105
+ }) => long ? '-185px' : '-115px', ";position:absolute;top:calc(50% - 16px);");
142
106
  const OverlayRow = /*#__PURE__*/_styled('li', {
143
107
  shouldForwardProp: prop => !['isFirstElement', 'shouldBeHidden', 'hideFromOverlay'].includes(prop),
144
108
  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
- }, ";");
109
+ })("min-width:200px;padding:0 24px;border-left:1px solid ", ({
110
+ theme
111
+ }) => theme.colors.neutral.border, ";", ({
112
+ isFirstElement
113
+ }) => isFirstElement && `border: 0;`, " &:first-of-type,&:last-child{border:0;}@media (max-width: 1420px){", ({
114
+ shouldBeHidden
115
+ }) => shouldBeHidden && 'display: none;', ";}", ({
116
+ hideFromOverlay
117
+ }) => hideFromOverlay && 'display: none;', ";");
166
118
  const StyledLeftSide = /*#__PURE__*/_styled("div", {
167
119
  target: "e1xb5k8j2"
168
120
  })(process.env.NODE_ENV === "production" ? {
@@ -176,12 +128,9 @@ const StyledLeftSide = /*#__PURE__*/_styled("div", {
176
128
  const ItemResourceName = /*#__PURE__*/_styled('div', {
177
129
  shouldForwardProp: prop => !['animated'].includes(prop),
178
130
  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
- }, ";");
131
+ })("height:48px;display:flex;flex-direction:column;-webkit-box-pack:center;justify-content:center;animation:", ({
132
+ animated
133
+ }) => animated ? /*#__PURE__*/css("800ms ", zoomIn, ";") : '', ";");
185
134
  const StyledBadge = /*#__PURE__*/_styled(Badge, {
186
135
  target: "e1xb5k8j0"
187
136
  })(process.env.NODE_ENV === "production" ? {
@@ -2,15 +2,14 @@ import { multiplier } from './constants.js';
2
2
 
3
3
  // time unit = hours, days, months
4
4
  // timeAmount = number of hours / days / months
5
- const calculatePrice = _ref => {
6
- let {
7
- price,
8
- amount,
9
- amountFree = 0,
10
- timeUnit,
11
- timeAmount,
12
- discount = 0
13
- } = _ref;
5
+ const calculatePrice = ({
6
+ price,
7
+ amount,
8
+ amountFree = 0,
9
+ timeUnit,
10
+ timeAmount,
11
+ discount = 0
12
+ }) => {
14
13
  const value = (price - price * discount) * (timeAmount * multiplier[`${timeUnit}`]) * Math.max(amount - amountFree, 0);
15
14
 
16
15
  // Avoid having negative price in any cases
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ultraviolet/plus",
3
- "version": "0.5.5",
3
+ "version": "0.5.6",
4
4
  "description": "Ultraviolet Plus",
5
5
  "homepage": "https://github.com/scaleway/ultraviolet#readme",
6
6
  "repository": {
@@ -39,7 +39,7 @@
39
39
  "react-dom": "18.2.0"
40
40
  },
41
41
  "devDependencies": {
42
- "@babel/core": "7.23.5",
42
+ "@babel/core": "7.23.6",
43
43
  "@emotion/babel-plugin": "11.11.0",
44
44
  "@emotion/react": "11.11.1",
45
45
  "@emotion/styled": "11.11.0",
@@ -47,7 +47,7 @@
47
47
  "@types/react-dom": "18.2.17",
48
48
  "react": "18.2.0",
49
49
  "react-dom": "18.2.0",
50
- "@ultraviolet/icons": "2.7.0"
50
+ "@ultraviolet/icons": "2.7.1"
51
51
  },
52
52
  "dependencies": {
53
53
  "@uiw/codemirror-extensions-langs": "4.21.21",
@@ -56,7 +56,7 @@
56
56
  "react-flatten-children": "1.1.2",
57
57
  "react-intersection-observer": "9.5.3",
58
58
  "@ultraviolet/themes": "1.5.0",
59
- "@ultraviolet/ui": "1.28.0"
59
+ "@ultraviolet/ui": "1.29.0"
60
60
  },
61
61
  "scripts": {
62
62
  "build": "rollup -c ../../rollup.config.mjs"