@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
@@ -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:", _ref => {
11
- let {
12
- theme
13
- } = _ref;
14
- return theme.radii.default;
15
- }, ";border:1px solid ", _ref2 => {
16
- let {
17
- theme
18
- } = _ref2;
19
- return theme.colors.neutral.border;
20
- }, ";background:", _ref3 => {
21
- let {
22
- theme
23
- } = _ref3;
24
- return theme.colors.neutral.background;
25
- }, ";min-width:0;");
26
- const BaseContentCardGroup = /*#__PURE__*/forwardRef((_ref4, ref) => {
27
- let {
28
- children,
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 = _ref => {
7
- let {
8
- defaultTimeUnit = 'hours',
9
- setIteration,
10
- iteration,
11
- timeUnits
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(_ref2 => {
21
- let {
22
- value
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:", _ref => {
19
- let {
20
- isOverlay
21
- } = _ref;
22
- return isOverlay ? 'initial' : 'right';
23
- }, ";", _ref2 => {
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:", _ref3 => {
33
- let {
34
- theme
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:", _ref4 => {
41
- let {
42
- theme
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
- })(_ref5 => {
79
- let {
80
- theme
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 = _ref6 => {
95
- let {
96
- discount = 0,
97
- priceText,
98
- discountText,
99
- label,
100
- tooltipInfo,
101
- // Shows an icon with tooltip that contains this text
102
- subLabel = '',
103
- // Usually used for showing amount that is free
104
- price: basePrice = 0,
105
- // Hourly price for one unit
106
- monthlyPrice = 0,
107
- // Price per month
108
- unit: baseUnit,
109
- // Can be GB, MB, Node, Queries, etc.
110
- amount: currentAmount = 1,
111
- // Current number of items
112
- onAmountChange,
113
- amountFree = 0,
114
- // Amount that is free - offered by company
115
- maxAmount = 0,
116
- // Max amount - used for kubernetes for example
117
- longFractionDigits = false,
118
- // In case price is really long 0.0000076 - up 7 fraction digits
119
- noIteration = false,
120
- // if item is not based on time (ex: download, upload, transfer)
121
- noIterationText,
122
- noBorder,
123
- // remove the border bottom of the item
124
- noPrice,
125
- // remove the price on right side of the table
126
- isDefined = true,
127
- children = null,
128
- isFirstElement = false,
129
- isLastElement = false,
130
- isPrimaryBackground = false,
131
- productsCallback,
132
- iteration: receivedIteration,
133
- // Object from parent that contains time period (hours, days, months)
134
- shouldBeHidden = false,
135
- // Hide element from overlay if screen width is small
136
- hideFromOverlay = false,
137
- // Hide element from overlay in any case
138
- textNotDefined,
139
- // Text to display in case of not defined value
140
- animated = false,
141
- // if true, zoomIn animation is triggered
142
- tabulation,
143
- // Increase left padding of the item
144
- labelTextVariant,
145
- // To change left cell typography variant
146
- labelTextProminence,
147
- // To change left cell typography prominence
148
- notice // To display a gray text below the label
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
- })(_ref => {
8
- let {
9
- isActive,
10
- theme
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 = _ref => {
9
- let {
10
- amount,
11
- minValue = 0,
12
- maxValue = 100,
13
- getAmountValue,
14
- itemCallback
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:", _ref => {
10
- let {
11
- theme
12
- } = _ref;
13
- return theme.space['1'];
14
- }, ";");
15
- const Region = _ref2 => {
16
- let {
17
- label,
18
- image,
19
- shouldBeHidden = false,
20
- priceText,
21
- animated = false,
22
- isFirstElement,
23
- isLastElement,
24
- productsCallback,
25
- iteration,
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:", _ref => {
10
- let {
11
- isOverlay
12
- } = _ref;
13
- return isOverlay ? 'flex' : 'inline-flex';
14
- }, ";max-width:500px;align-items:center;font-size:16px;color:", _ref2 => {
15
- let {
16
- theme
17
- } = _ref2;
18
- return theme.colors.neutral.textStrong;
19
- }, ";margin-right:4px;", _ref3 => {
20
- let {
21
- theme,
22
- variant
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:", _ref => {
9
- let {
10
- variant
11
- } = _ref;
12
- return variant === 'big' ? 24 : 16;
13
- }, "px;", _ref2 => {
14
- let {
15
- variant
16
- } = _ref2;
17
- return variant === 'capitalized' ? `text-transform: capitalize;` : '';
18
- }, " color:", _ref3 => {
19
- let {
20
- theme
21
- } = _ref3;
22
- return theme.colors.neutral.textStrong;
23
- }, ";font-weight:500;margin-right:4px;");
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 = _ref => {
21
- let {
22
- amount,
23
- itemCallback,
24
- getAmountValue,
25
- unit
26
- } = _ref;
20
+ const Unit = ({
21
+ amount,
22
+ itemCallback,
23
+ getAmountValue,
24
+ unit
25
+ }) => {
27
26
  const {
28
27
  isOverlay
29
28
  } = useOverlay();