carbon-react 104.19.2 → 104.22.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.
@@ -9,10 +9,6 @@ var _styledComponents = _interopRequireWildcard(require("styled-components"));
9
9
 
10
10
  var _heading = require("../../components/heading/heading.style");
11
11
 
12
- var _base = _interopRequireDefault(require("../../style/themes/base"));
13
-
14
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
-
16
12
  function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
17
13
 
18
14
  function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -26,9 +22,7 @@ const StyledFullScreenHeading = _styledComponents.default.div`
26
22
  ${({
27
23
  hasContent
28
24
  }) => hasContent && (0, _styledComponents.css)`
29
- border-bottom: 1px solid ${({
30
- theme
31
- }) => theme.disabled.border};
25
+ border-bottom: 1px solid var(--colorsUtilityMajor050);
32
26
  `}
33
27
  display: flex;
34
28
  justify-content: space-between;
@@ -56,8 +50,5 @@ const StyledFullScreenHeading = _styledComponents.default.div`
56
50
  }
57
51
  }
58
52
  `;
59
- StyledFullScreenHeading.defaultProps = {
60
- theme: _base.default
61
- };
62
53
  var _default = StyledFullScreenHeading;
63
54
  exports.default = _default;
@@ -54,9 +54,8 @@ const InputPresentationStyle = _styledComponents.default.div`
54
54
  `}
55
55
 
56
56
  ${({
57
- hasFocus,
58
- disabled
59
- }) => hasFocus && !disabled && (0, _styledComponents.css)`
57
+ hasFocus
58
+ }) => hasFocus && (0, _styledComponents.css)`
60
59
  & {
61
60
  outline: 3px solid var(--colorsSemanticFocus500);
62
61
  z-index: 2;
@@ -53,6 +53,9 @@ const Input = /*#__PURE__*/_react.default.forwardRef(({
53
53
  (0, _react.useEffect)(() => {
54
54
  if (context.inputRef) context.inputRef(input);
55
55
  }, [context, input]);
56
+ (0, _react.useEffect)(() => {
57
+ if (disabled && context.onBlur) context.onBlur();
58
+ }, [disabled, context]);
56
59
 
57
60
  const handleClick = ev => {
58
61
  if (onClick) onClick(ev);
@@ -200,20 +200,11 @@ const StyledDayPicker = _styledComponents.default.div`
200
200
  z-index: 1000;
201
201
  top: calc(100% + 1px);
202
202
  left: 0;
203
- background-color: ${({
204
- theme
205
- }) => theme.colors.white};
206
- box-shadow: ${({
207
- theme
208
- }) => theme.shadows.depth1};
209
- color: ${({
210
- theme
211
- }) => theme.text.color};
203
+ background-color: var(--colorsUtilityYang100);
204
+ box-shadow: var(--boxShadow100);
212
205
  display: block;
213
- font-size: 14px;
214
- font-weight: 800;
215
206
  overflow: hidden;
216
- padding: 24px;
207
+ padding: var(--spacing300);
217
208
  text-align: center;
218
209
  user-select: none;
219
210
  }
@@ -234,9 +225,7 @@ const StyledDayPicker = _styledComponents.default.div`
234
225
  .DayPicker-wrapper {
235
226
  padding: 0;
236
227
  &:focus {
237
- outline: ${({
238
- theme
239
- }) => `3px solid ${theme.colors.focus}`};
228
+ outline: var(--borderWidth300) solid var(--colorsSemanticFocus500);
240
229
  }
241
230
  }
242
231
 
@@ -250,8 +239,10 @@ const StyledDayPicker = _styledComponents.default.div`
250
239
  }
251
240
 
252
241
  .DayPicker-Caption {
253
- line-height: 40px;
254
- height: 40px;
242
+ color: var(--colorsActionMajorYin090);
243
+ line-height: var(--sizing500);
244
+ height: var(--sizing500);
245
+ //font: var(--typographyDatePickerCalendarMonthM); to be implemented
255
246
  font-size: 16px;
256
247
  font-weight: 800;
257
248
 
@@ -262,28 +253,25 @@ const StyledDayPicker = _styledComponents.default.div`
262
253
  }
263
254
 
264
255
  .DayPicker-Day {
265
- min-width: 40px;
266
- background-color: ${({
267
- theme
268
- }) => theme.colors.white};
256
+ min-width: var(--sizing500);
257
+ height: 36px; //var(--sizing450); to be implemented
258
+ padding: 0;
259
+ background-color: var(--colorsUtilityYang100);
269
260
  cursor: pointer;
270
261
  border: none;
271
- font-weight: 800;
272
- padding: 10px 0;
262
+ //font-family: var(--fontFamiliesDefault); token value to be updated
263
+ //font: var(--typographyDatePickerCalendarDateM); to be implemented
264
+ font-weight: var(--fontWeights700);
265
+ font-size: var(--fontSizes100);
266
+ line-height: var(--lineHeights500);
273
267
 
274
268
  &:hover {
275
- background-color: ${({
276
- theme
277
- }) => theme.disabled.input};
278
- color: ${({
279
- theme
280
- }) => theme.text.color};
269
+ background-color: var(--colorsActionMinor050);
270
+ color: var(--colorsActionMajorYin090);
281
271
  }
282
272
 
283
273
  &:focus {
284
- outline: ${({
285
- theme
286
- }) => `3px solid ${theme.colors.focus}`};
274
+ outline: var(--borderWidth300) solid var(--colorsSemanticFocus500);
287
275
  }
288
276
 
289
277
  + * {
@@ -297,52 +285,30 @@ const StyledDayPicker = _styledComponents.default.div`
297
285
 
298
286
  .DayPicker-Day--today,
299
287
  .DayPicker-Day--today.DayPicker-Day--outside {
300
- font-weight: 800;
301
- color: ${({
302
- theme
303
- }) => theme.text.color};
304
- background-color: ${({
305
- theme
306
- }) => theme.disabled.border};
288
+ color: var(--colorsActionMajorYin090);
289
+ background-color: var(--colorsActionMinor200);
307
290
  }
308
291
 
309
292
  .DayPicker-Day--outside {
310
- color: ${({
311
- theme
312
- }) => theme.disabled.disabled};
313
- background-color: ${({
314
- theme
315
- }) => theme.colors.white};
293
+ color: var(--colorsActionMajorYin055);
294
+ background-color: var(--colorsUtilityYang100);
316
295
  }
317
296
 
318
297
  .DayPicker-Day--disabled,
319
298
  .DayPicker-Day--disabled:hover {
320
- color: ${({
321
- theme
322
- }) => theme.disabled.disabled};
323
- background-color: ${({
324
- theme
325
- }) => theme.colors.white};
299
+ color: var(colorsActionMajorYin030);
300
+ background-color: var(--colorsUtilityYang100);
326
301
  cursor: default;
327
302
  }
328
303
 
329
304
  .DayPicker-Day--selected:not(.DayPicker-Day--disabled):not(.DayPicker-Day--outside) {
330
- background-color: ${({
331
- theme
332
- }) => theme.colors.primary};
333
- color: ${({
334
- theme
335
- }) => theme.colors.white};
336
- font-weight: 800;
305
+ background-color: var(--colorsActionMajor500);
306
+ color: var(--colorsUtilityYang100);
337
307
  }
338
308
 
339
309
  .DayPicker-Day--selected.DayPicker-Day--disabled:not(.DayPicker-Day--outside) {
340
- background-color: ${({
341
- theme
342
- }) => theme.colors.primary};
343
- color: ${({
344
- theme
345
- }) => theme.colors.white};
310
+ background-color: var(--colorsActionMajor500);
311
+ color: var(--colorsUtilityYang100);
346
312
  }
347
313
  `;
348
314
  StyledDayPicker.defaultProps = {
@@ -7,30 +7,25 @@ exports.default = void 0;
7
7
 
8
8
  var _styledComponents = _interopRequireDefault(require("styled-components"));
9
9
 
10
- var _base = _interopRequireDefault(require("../../../../style/themes/base"));
11
-
12
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
11
 
14
12
  const StyledButton = _styledComponents.default.button.attrs({
15
13
  type: "button"
16
14
  })`
15
+ justify-content: center;
17
16
  align-items: center;
18
- display: block;
19
- border: none;
17
+ display: flex;
18
+ border: var(--borderWidth200) solid var(--colorsActionMinorTransparent);
20
19
  background: none;
21
20
  box-shadow: none;
22
21
  cursor: pointer;
23
- height: 40px;
24
- width: 40px;
25
- padding: 0;
22
+ height: var(--sizing500);
23
+ width: var(--sizing500);
24
+ padding: var(--spacing150);
25
+ box-sizing: border-box;
26
26
  &:focus {
27
- outline: ${({
28
- theme
29
- }) => `3px solid ${theme.colors.focus}`};
27
+ outline: var(--borderWidth300) solid var(--colorsSemanticFocus500);
30
28
  }
31
29
  `;
32
- StyledButton.defaultProps = {
33
- theme: _base.default
34
- };
35
30
  var _default = StyledButton;
36
31
  exports.default = _default;
@@ -7,8 +7,6 @@ exports.default = void 0;
7
7
 
8
8
  var _styledComponents = _interopRequireDefault(require("styled-components"));
9
9
 
10
- var _base = _interopRequireDefault(require("../../../../style/themes/base"));
11
-
12
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
11
 
14
12
  const StyledNavbar = _styledComponents.default.div`
@@ -17,11 +15,8 @@ const StyledNavbar = _styledComponents.default.div`
17
15
  justify-content: space-between;
18
16
  padding: 0;
19
17
  top: 0;
20
- height: 40px;
18
+ height: var(--sizing500);
21
19
  }
22
20
  `;
23
- StyledNavbar.defaultProps = {
24
- theme: _base.default
25
- };
26
21
  var _default = StyledNavbar;
27
22
  exports.default = _default;
@@ -7,27 +7,23 @@ exports.default = void 0;
7
7
 
8
8
  var _styledComponents = _interopRequireDefault(require("styled-components"));
9
9
 
10
- var _base = _interopRequireDefault(require("../../../../style/themes/base"));
11
-
12
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
11
 
14
12
  const StyledWeekday = _styledComponents.default.div`
15
13
  &,
16
14
  &.DayPicker-Weekday {
17
15
  border: none;
18
- min-width: 40px;
16
+ height: var(--sizing500);
17
+ min-width: var(--sizing500);
19
18
  font-weight: 800;
20
- color: ${({
21
- theme
22
- }) => theme.colors.border};
19
+ color: var(--colorsActionMinor400);
23
20
  text-transform: uppercase;
24
21
  font-size: 12px;
22
+ //font: var(--typographyDatePickerCalendarDayM) to be implemented
25
23
  text-align: center;
26
24
  padding: 20px 0 5px;
25
+ box-sizing: border-box;
27
26
  }
28
27
  `;
29
- StyledWeekday.defaultProps = {
30
- theme: _base.default
31
- };
32
28
  var _default = StyledWeekday;
33
29
  exports.default = _default;
@@ -78,9 +78,7 @@ const StyledHeadingBackButton = (0, _styledComponents.default)(_link.default)`
78
78
 
79
79
  &:focus {
80
80
  background-color: transparent;
81
- outline: 3px solid ${({
82
- theme
83
- }) => theme.colors.focus};
81
+ outline: 3px solid var(--colorsSemanticFocus500);
84
82
  }
85
83
 
86
84
  ${_icon2.default} {
@@ -90,9 +88,6 @@ const StyledHeadingBackButton = (0, _styledComponents.default)(_link.default)`
90
88
  }
91
89
  `;
92
90
  exports.StyledHeadingBackButton = StyledHeadingBackButton;
93
- StyledHeadingBackButton.defaultProps = {
94
- theme: _base.default
95
- };
96
91
  const StyledHeadingTitle = (0, _styledComponents.default)(_typography.default)`
97
92
  line-height: 32px;
98
93
  ${({
@@ -127,9 +122,7 @@ const StyledSubHeader = _styledComponents.default.div`
127
122
  `;
128
123
  exports.StyledSubHeader = StyledSubHeader;
129
124
  const StyledHeadingIcon = (0, _styledComponents.default)(_icon.default)`
130
- color: ${({
131
- theme
132
- }) => theme.colors.border};
125
+ color: var(--colorsActionMinor500);
133
126
  height: 30px;
134
127
 
135
128
  &:before,
@@ -138,19 +131,12 @@ const StyledHeadingIcon = (0, _styledComponents.default)(_icon.default)`
138
131
  }
139
132
 
140
133
  &:hover {
141
- color: ${({
142
- theme
143
- }) => theme.icon.focus};
134
+ color: var(--colorsActionMinor600);
144
135
  }
145
136
  `;
146
137
  exports.StyledHeadingIcon = StyledHeadingIcon;
147
- StyledHeadingIcon.defaultProps = {
148
- theme: _base.default
149
- };
150
138
  const StyledSeparator = _styledComponents.default.hr`
151
- border-top: 2px solid ${({
152
- theme
153
- }) => theme.palette.slateTint(80)};
139
+ border-top: 2px solid var(--colorsUtilityMajor100);
154
140
  margin: 10px 0 8px;
155
141
  text-align: left;
156
142
  width: 50px;
@@ -160,9 +146,6 @@ const StyledDivider = (0, _styledComponents.default)(_hr.default)`
160
146
  margin: 15px 0 20px;
161
147
  `;
162
148
  exports.StyledDivider = StyledDivider;
163
- StyledSeparator.defaultProps = {
164
- theme: _base.default
165
- };
166
149
  const StyledHeaderHelp = (0, _styledComponents.default)(_help.default)`
167
150
  display: inline-block;
168
151
  margin-left: -6px;
@@ -3,9 +3,8 @@ export const StyledPagerSizeOptions: import("styled-components").StyledComponent
3
3
  export const StyledPagerSizeOptionsInner: import("styled-components").StyledComponent<"div", any, {}, never>;
4
4
  export const StyledPagerNavigation: import("styled-components").StyledComponent<"div", any, {}, never>;
5
5
  export const StyledPagerNavInner: import("styled-components").StyledComponent<"div", any, {}, never>;
6
- export const StyledPagerLinkStyles: import("styled-components").StyledComponent<"button", any, {
7
- type: "button";
8
- }, "type">;
6
+ export const StyledPagerLinkStyles: import("styled-components").StyledComponent<typeof Link, any, {}, never>;
9
7
  export const StyledPagerNoSelect: import("styled-components").StyledComponent<"span", any, {}, never>;
10
8
  export const StyledPagerSummary: import("styled-components").StyledComponent<"div", any, {}, never>;
11
9
  export const StyledSelectContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
10
+ import Link from "../link";
@@ -13,10 +13,10 @@ var _inputPresentation = _interopRequireDefault(require("../../__internal__/inpu
13
13
 
14
14
  var _inputIconToggle = _interopRequireDefault(require("../../__internal__/input-icon-toggle/input-icon-toggle.style"));
15
15
 
16
- var _base = _interopRequireDefault(require("../../style/themes/base"));
17
-
18
16
  var _selectText = _interopRequireDefault(require("../select/__internal__/select-text/select-text.style"));
19
17
 
18
+ var _link = _interopRequireDefault(require("../link"));
19
+
20
20
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
21
 
22
22
  function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
@@ -39,62 +39,15 @@ const StyledPagerContainer = _styledComponents.default.div`
39
39
  border-top-width: 0;
40
40
  font-size: 13px;
41
41
  border-top: none;
42
+ color: var(--colorsUtilityYin090);
42
43
 
43
44
  ${({
44
- theme,
45
45
  variant
46
- }) => theme.table && theme.colors && (0, _styledComponents.css)`
46
+ }) => (0, _styledComponents.css)`
47
47
  border-width: 1px 1px 1px 1px;
48
48
  border-style: none solid solid solid;
49
- border-color: ${theme.table.secondary};
50
- background-color: ${variant === "alternate" ? theme.pager.alternate : theme.table.zebra};
51
-
52
- .carbon-input-icon {
53
- border: none;
54
- background: none;
55
-
56
- &:hover {
57
- background: none;
58
- color: ${theme.colors.black};
59
- }
60
- }
61
-
62
- .common-input__field:focus-within {
63
- outline: 3px solid ${theme.colors.focus};
64
- }
65
-
66
- .common-input__input {
67
- border: 1px solid ${theme.colors.border};
68
-
69
- &:active,
70
- &:hover,
71
- &:focus {
72
- border: 1px solid ${theme.colors.border};
73
- }
74
-
75
- &:focus {
76
- border: 1px solid ${theme.colors.border};
77
- color: ${theme.colors.black};
78
- }
79
-
80
- &:focus ~ label .carbon-input-icon,
81
- &:focus ~ label .carbon-input-icon:hover {
82
- border: none;
83
- background: none;
84
- color: ${theme.colors.black};
85
- }
86
-
87
- &:hover ~ label .carbon-input-icon {
88
- border: none;
89
- background: none;
90
- color: ${theme.colors.black};
91
- }
92
-
93
- &:hover ~ label .carbon-input-icon:hover {
94
- border: none;
95
- background: none;
96
- }
97
- }
49
+ border-color: var(--colorsUtilityMajor100);
50
+ background-color: ${variant === "alternate" ? "var(--colorsUtilityMajor040)" : "var(--colorsUtilityMajor010)"};
98
51
  `}
99
52
  `;
100
53
  exports.StyledPagerContainer = StyledPagerContainer;
@@ -158,44 +111,10 @@ const StyledPagerNavInner = _styledComponents.default.div`
158
111
  padding: 0 12px;
159
112
  `;
160
113
  exports.StyledPagerNavInner = StyledPagerNavInner;
161
- const StyledPagerLinkStyles = _styledComponents.default.button.attrs({
162
- type: "button"
163
- })`
114
+ const StyledPagerLinkStyles = (0, _styledComponents.default)(_link.default)`
164
115
  padding: 0 10px;
165
- font-size: 13px;
166
- border-width: 0;
167
- background-color: transparent;
168
- cursor: pointer;
169
116
  margin-left: 7px;
170
117
  margin-right: 7px;
171
-
172
- ${({
173
- theme
174
- }) => theme.pager && (0, _styledComponents.css)`
175
- color: ${theme.pager.active};
176
-
177
- ${({
178
- disabled
179
- }) => !disabled && (0, _styledComponents.css)`
180
- &:hover {
181
- text-decoration: underline;
182
- padding: 5px 10px;
183
- }
184
- `}
185
-
186
- &:focus {
187
- outline: solid 3px ${theme.colors.focus};
188
- padding: 5px 10px;
189
- }
190
- `}
191
-
192
- ${({
193
- disabled,
194
- theme
195
- }) => disabled && theme && (0, _styledComponents.css)`
196
- color: ${theme.pager.disabled};
197
- cursor: not-allowed;
198
- `}
199
118
  `;
200
119
  exports.StyledPagerLinkStyles = StyledPagerLinkStyles;
201
120
  const StyledPagerNoSelect = _styledComponents.default.span`
@@ -208,25 +127,4 @@ const StyledPagerSummary = _styledComponents.default.div`
208
127
  flex: 1 1 30%;
209
128
  justify-content: flex-end;
210
129
  `;
211
- exports.StyledPagerSummary = StyledPagerSummary;
212
- StyledPagerContainer.defaultProps = {
213
- theme: _base.default
214
- };
215
- StyledPagerSizeOptions.defaultProps = {
216
- theme: _base.default
217
- };
218
- StyledPagerSizeOptionsInner.defaultProps = {
219
- theme: _base.default
220
- };
221
- StyledPagerNavigation.defaultProps = {
222
- theme: _base.default
223
- };
224
- StyledPagerNavInner.defaultProps = {
225
- theme: _base.default
226
- };
227
- StyledPagerLinkStyles.defaultProps = {
228
- theme: _base.default
229
- };
230
- StyledPagerSummary.defaultProps = {
231
- theme: _base.default
232
- };
130
+ exports.StyledPagerSummary = StyledPagerSummary;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "carbon-react",
3
- "version": "104.19.2",
3
+ "version": "104.22.0",
4
4
  "description": "A library of reusable React components for easily building user interfaces.",
5
5
  "engineStrict": true,
6
6
  "engines": {