carbon-react 102.22.1 → 103.0.0

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.
@@ -48,12 +48,6 @@ var _default = {
48
48
  type: "select"
49
49
  }
50
50
  },
51
- variant: {
52
- options: _progressTracker.PROGRESS_TRACKER_VARIANTS,
53
- control: {
54
- type: "select"
55
- }
56
- },
57
51
  orientation: {
58
52
  options: ["horizontal", "vertical"],
59
53
  control: {
@@ -1,12 +1,11 @@
1
1
  export default ProgressTracker;
2
- declare function ProgressTracker({ size, progress, showDefaultLabels, currentProgressLabel, maxProgressLabel, variant, orientation, direction, labelsPosition, ...rest }: {
2
+ declare function ProgressTracker({ size, progress, showDefaultLabels, currentProgressLabel, maxProgressLabel, orientation, direction, labelsPosition, ...rest }: {
3
3
  [x: string]: any;
4
4
  size?: string | undefined;
5
5
  progress?: number | undefined;
6
6
  showDefaultLabels?: boolean | undefined;
7
7
  currentProgressLabel: any;
8
8
  maxProgressLabel: any;
9
- variant?: string | undefined;
10
9
  orientation?: string | undefined;
11
10
  direction?: string | undefined;
12
11
  labelsPosition: any;
@@ -18,7 +17,6 @@ declare namespace ProgressTracker {
18
17
  const showDefaultLabels: PropTypes.Requireable<boolean>;
19
18
  const currentProgressLabel: PropTypes.Requireable<string>;
20
19
  const maxProgressLabel: PropTypes.Requireable<string>;
21
- const variant: PropTypes.Requireable<string>;
22
20
  const orientation: PropTypes.Requireable<string>;
23
21
  const direction: PropTypes.Requireable<string>;
24
22
  const labelsPosition: PropTypes.Requireable<string>;
@@ -29,7 +29,6 @@ const ProgressTracker = ({
29
29
  showDefaultLabels = false,
30
30
  currentProgressLabel,
31
31
  maxProgressLabel,
32
- variant = "default",
33
32
  orientation = "horizontal",
34
33
  direction = "up",
35
34
  labelsPosition,
@@ -71,8 +70,7 @@ const ProgressTracker = ({
71
70
  }, /*#__PURE__*/_react.default.createElement(_progressTracker.InnerBar, {
72
71
  isVertical: isVertical,
73
72
  size: size,
74
- progress: progress,
75
- variant: variant
73
+ progress: progress
76
74
  })), !prefixLabels && renderValueLabels());
77
75
  };
78
76
 
@@ -93,12 +91,6 @@ ProgressTracker.propTypes = { ...marginPropTypes,
93
91
  /** Value to display as the maximum progress limit. */
94
92
  maxProgressLabel: _propTypes.default.string,
95
93
 
96
- /**
97
- * Sets the colour of the bar that shows the current progress.
98
- * The "traffic" variant changes the colour of status bar depending on current progress.
99
- */
100
- variant: _propTypes.default.oneOf(["default", "traffic"]),
101
-
102
94
  /** The orientation of the component. */
103
95
  orientation: _propTypes.default.oneOf(["horizontal", "vertical"]),
104
96
 
@@ -1,3 +1,2 @@
1
1
  export const OUTER_TRACKER_LENGTH: "256px";
2
2
  export const PROGRESS_TRACKER_SIZES: string[];
3
- export const PROGRESS_TRACKER_VARIANTS: string[];
@@ -3,10 +3,8 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.PROGRESS_TRACKER_VARIANTS = exports.PROGRESS_TRACKER_SIZES = exports.OUTER_TRACKER_LENGTH = void 0;
6
+ exports.PROGRESS_TRACKER_SIZES = exports.OUTER_TRACKER_LENGTH = void 0;
7
7
  const OUTER_TRACKER_LENGTH = "256px";
8
8
  exports.OUTER_TRACKER_LENGTH = OUTER_TRACKER_LENGTH;
9
9
  const PROGRESS_TRACKER_SIZES = ["small", "medium", "large"];
10
- exports.PROGRESS_TRACKER_SIZES = PROGRESS_TRACKER_SIZES;
11
- const PROGRESS_TRACKER_VARIANTS = ["default", "traffic"];
12
- exports.PROGRESS_TRACKER_VARIANTS = PROGRESS_TRACKER_VARIANTS;
10
+ exports.PROGRESS_TRACKER_SIZES = PROGRESS_TRACKER_SIZES;
@@ -11,11 +11,6 @@ export interface ProgressBarProps extends MarginProps {
11
11
  currentProgressLabel?: string;
12
12
  /** Value to display as the maximum progress limit. */
13
13
  maxProgressLabel?: string;
14
- /**
15
- * Sets the colour of the bar that shows the current progress.
16
- * The "traffic" variant changes the colour of status bar depending on current progress.
17
- * */
18
- variant?: "default" | "traffic";
19
14
  /** The orientation of the component. */
20
15
  orientation?: "horizontal" | "vertical";
21
16
  /** The direction the bar should move as progress increases, only applies in vertical orientation. */
@@ -43,12 +43,11 @@ const StyledProgressBar = _styledComponents.default.span`
43
43
  ${({
44
44
  direction,
45
45
  isVertical,
46
- size,
47
- theme
46
+ size
48
47
  }) => (0, _styledComponents.css)`
49
48
  display: flex;
50
49
  position: relative;
51
- background-color: ${theme.progressTracker.background};
50
+ background-color: var(--colorsSemanticNeutral200);
52
51
 
53
52
  ${!isVertical && (0, _styledComponents.css)`
54
53
  overflow-x: hidden;
@@ -68,16 +67,12 @@ const StyledProgressBar = _styledComponents.default.span`
68
67
  `;
69
68
  exports.StyledProgressBar = StyledProgressBar;
70
69
  const StyledValue = _styledComponents.default.span`
70
+ color: var(--colorsUtilityYin090);
71
71
  ${({
72
- isMaxValue,
73
- theme
72
+ isMaxValue
74
73
  }) => (0, _styledComponents.css)`
75
- ${isMaxValue && `
76
- color: ${theme.text.placeholder};
77
- `}
78
- ${!isMaxValue && `
79
- font-weight: bold;
80
- `}
74
+ ${isMaxValue && `color: var(--colorsUtilityYin055);`}
75
+ ${!isMaxValue && `font-weight: bold;`}
81
76
  `}
82
77
  `;
83
78
  exports.StyledValue = StyledValue;
@@ -121,13 +116,11 @@ const InnerBar = _styledComponents.default.span`
121
116
  ${({
122
117
  isVertical,
123
118
  progress,
124
- size,
125
- theme,
126
- variant
119
+ size
127
120
  }) => (0, _styledComponents.css)`
128
121
  position: absolute;
129
122
  left: 0;
130
- background-color: ${getInnerBarColour(variant, progress, theme)};
123
+ background-color: ${getInnerBarColour(progress)};
131
124
 
132
125
  ${!isVertical && (0, _styledComponents.css)`
133
126
  width: calc(${_progressTracker.OUTER_TRACKER_LENGTH} * ${progress / 100});
@@ -146,44 +139,49 @@ exports.InnerBar = InnerBar;
146
139
  function getHeight(size) {
147
140
  switch (size) {
148
141
  case "small":
149
- return "4px";
142
+ return "var(--sizing050)";
150
143
 
151
144
  case "large":
152
- return "16px";
145
+ return "var(--sizing200)";
153
146
 
154
147
  default:
155
- return "8px";
148
+ return "var(--sizing100)";
156
149
  }
157
150
  }
158
151
 
159
- function getInnerBarColour(variant, progress, theme) {
160
- if (progress >= 100) return theme.colors.success;
161
- if (variant === "default") return theme.progressTracker.innerBackground;
162
- if (progress < 20) return theme.colors.error;
163
- return theme.progressTracker.trafficNeutral;
152
+ function getInnerBarColour(progress) {
153
+ if (progress >= 100) return "var(--colorsSemanticPositive500)";
154
+ return "var(--colorsSemanticNeutral500)";
164
155
  }
165
156
 
166
157
  StyledProgressTracker.defaultProps = {
167
158
  theme: _base.default
168
159
  };
169
160
  StyledProgressBar.defaultProps = {
170
- theme: _base.default,
161
+ size: "medium"
162
+ };
163
+ InnerBar.defaultProps = {
164
+ progress: 0,
171
165
  size: "medium"
172
166
  };
173
167
  InnerBar.propTypes = {
174
168
  size: _propTypes.default.oneOf(_progressTracker.PROGRESS_TRACKER_SIZES),
175
169
  progress: _propTypes.default.number,
176
- variant: _propTypes.default.oneOf(_progressTracker.PROGRESS_TRACKER_VARIANTS)
170
+ isVertical: _propTypes.default.bool
177
171
  };
178
- InnerBar.defaultProps = {
179
- progress: 0,
180
- theme: _base.default,
181
- size: "medium",
182
- variant: "default"
172
+ StyledProgressTracker.propTypes = {
173
+ theme: _propTypes.default.object,
174
+ isVertical: _propTypes.default.bool
183
175
  };
184
- StyledValue.defaultProps = {
185
- theme: _base.default
176
+ StyledValuesLabel.propTypes = {
177
+ isVertical: _propTypes.default.bool,
178
+ position: _propTypes.default.oneOf(["top", "bottom", "left", "right"])
179
+ };
180
+ StyledValue.propTypes = {
181
+ isMaxValue: _propTypes.default.bool
186
182
  };
187
183
  StyledProgressBar.propTypes = {
184
+ direction: _propTypes.default.oneOf(["up", "down"]),
185
+ isVertical: _propTypes.default.bool,
188
186
  size: _propTypes.default.oneOf(_progressTracker.PROGRESS_TRACKER_SIZES)
189
187
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "carbon-react",
3
- "version": "102.22.1",
3
+ "version": "103.0.0",
4
4
  "description": "A library of reusable React components for easily building user interfaces.",
5
5
  "engineStrict": true,
6
6
  "engines": {