carbon-react 104.23.0 → 104.25.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.
Files changed (21) hide show
  1. package/lib/components/accordion/accordion.component.js +2 -2
  2. package/lib/components/dialog-full-screen/dialog-full-screen.component.d.ts +2 -2
  3. package/lib/components/dialog-full-screen/dialog-full-screen.component.js +3 -3
  4. package/lib/components/dialog-full-screen/dialog-full-screen.d.ts +2 -2
  5. package/lib/components/drawer/drawer.component.js +1 -2
  6. package/lib/components/flat-table/flat-table-cell/flat-table-cell.style.js +6 -6
  7. package/lib/components/flat-table/flat-table-checkbox/flat-table-checkbox.component.js +14 -3
  8. package/lib/components/flat-table/flat-table-checkbox/flat-table-checkbox.style.js +5 -11
  9. package/lib/components/flat-table/flat-table-header/flat-table-header.style.js +7 -11
  10. package/lib/components/flat-table/flat-table-row/flat-table-row.style.js +34 -30
  11. package/lib/components/flat-table/flat-table-row-header/flat-table-row-header.style.js +3 -6
  12. package/lib/components/flat-table/flat-table.style.js +27 -36
  13. package/lib/components/flat-table/sort/sort.style.js +3 -12
  14. package/lib/components/popover-container/popover-container.component.d.ts +2 -1
  15. package/lib/components/popover-container/popover-container.component.js +7 -4
  16. package/lib/components/text-editor/__internal__/editor-counter/editor-counter.style.js +2 -8
  17. package/lib/components/text-editor/__internal__/toolbar/toolbar-button/toolbar-button.style.js +3 -9
  18. package/lib/components/text-editor/__internal__/toolbar/toolbar.style.js +3 -18
  19. package/lib/components/text-editor/text-editor.style.js +5 -13
  20. package/lib/components/textbox/textbox.component.js +1 -1
  21. package/package.json +1 -1
@@ -113,9 +113,9 @@ const Accordion = /*#__PURE__*/_react.default.forwardRef(({
113
113
  isExpanded: isExpanded,
114
114
  buttonHeading: buttonHeading,
115
115
  buttonWidth: buttonWidth,
116
- hasButtonProps: buttonHeading && headerSpacing
116
+ hasButtonProps: buttonHeading && headerSpacing,
117
+ role: "button"
117
118
  }, buttonHeading && {
118
- role: "button",
119
119
  p: 0
120
120
  }, headerSpacing), /*#__PURE__*/_react.default.createElement(_accordion.StyledAccordionHeadingsContainer, {
121
121
  "data-element": "accordion-headings-container",
@@ -34,7 +34,7 @@ declare namespace DialogFullScreen {
34
34
  */
35
35
  "aria-label": PropTypes.Requireable<string>;
36
36
  /**
37
- * Prop to specify the aria-labeledby property of the DialogFullscreen component
37
+ * Prop to specify the aria-labelledby property of the DialogFullscreen component
38
38
  * To be used when the title prop is a custom React Node,
39
39
  * or the component is labelled by an internal element other than the title.
40
40
  */
@@ -71,7 +71,7 @@ declare namespace DialogFullScreen {
71
71
  contentRef: PropTypes.Requireable<((...args: any[]) => any) | PropTypes.InferProps<{
72
72
  current: PropTypes.Requireable<Element>;
73
73
  }>>;
74
- /** The ARIA role to be applied to the DialogFulscreen container */
74
+ /** The ARIA role to be applied to the DialogFullscreen container */
75
75
  role: PropTypes.Requireable<string>;
76
76
  };
77
77
  }
@@ -111,7 +111,7 @@ const DialogFullScreen = ({
111
111
  focusFirstElement: focusFirstElement,
112
112
  wrapperRef: dialogRef
113
113
  }, /*#__PURE__*/_react.default.createElement(_dialogFullScreen.default, _extends({
114
- "aria-modal": true
114
+ "aria-modal": role === "dialog" ? true : undefined
115
115
  }, ariaProps, {
116
116
  ref: dialogRef,
117
117
  "data-element": "dialog-full-screen",
@@ -140,7 +140,7 @@ DialogFullScreen.propTypes = {
140
140
  "aria-label": _propTypes.default.string,
141
141
 
142
142
  /**
143
- * Prop to specify the aria-labeledby property of the DialogFullscreen component
143
+ * Prop to specify the aria-labelledby property of the DialogFullscreen component
144
144
  * To be used when the title prop is a custom React Node,
145
145
  * or the component is labelled by an internal element other than the title.
146
146
  */
@@ -192,7 +192,7 @@ DialogFullScreen.propTypes = {
192
192
  current: _propTypes.default.instanceOf(Element)
193
193
  })]),
194
194
 
195
- /** The ARIA role to be applied to the DialogFulscreen container */
195
+ /** The ARIA role to be applied to the DialogFullscreen container */
196
196
  role: _propTypes.default.string
197
197
  };
198
198
  var _default = DialogFullScreen;
@@ -10,7 +10,7 @@ export interface DialogFullScreenProps extends ModalProps {
10
10
  */
11
11
  "aria-label"?: string;
12
12
  /**
13
- * Prop to specify the aria-labeledby property of the DialogFullscreen component
13
+ * Prop to specify the aria-labelledby property of the DialogFullscreen component
14
14
  * To be used when the title prop is a custom React Node,
15
15
  * or the component is labelled by an internal element other than the title.
16
16
  */
@@ -39,7 +39,7 @@ export interface DialogFullScreenProps extends ModalProps {
39
39
  subtitle?: string;
40
40
  /** Title displayed at top of dialog */
41
41
  title?: React.ReactNode;
42
- /** The ARIA role to be applied to the DialogFulscreen container */
42
+ /** The ARIA role to be applied to the DialogFullscreen container */
43
43
  role?: string;
44
44
  }
45
45
 
@@ -147,7 +147,6 @@ const Drawer = ({
147
147
  expandedWidth: expandedWidth,
148
148
  animationDuration: animationDuration,
149
149
  className: getClassNames(),
150
- "aria-expanded": isExpanded ? "true" : "false",
151
150
  ref: drawerSidebarContentRef,
152
151
  backgroundColor: backgroundColor
153
152
  }, stickyHeader && /*#__PURE__*/_react.default.createElement(_drawer.StyledSidebarHeader, {
@@ -157,7 +156,7 @@ const Drawer = ({
157
156
  id: sidebarId,
158
157
  isExpanded: isExpanded,
159
158
  role: "navigation",
160
- overflowY: "auto",
159
+ overflowY: isExpanded ? "auto" : undefined,
161
160
  scrollVariant: "light",
162
161
  ref: scrollableContentRef
163
162
  }, /*#__PURE__*/_react.default.createElement(DrawerSidebarContext.Provider, {
@@ -37,9 +37,9 @@ const StyledFlatTableCell = _styledComponents.default.td`
37
37
  verticalBorder,
38
38
  verticalBorderColor
39
39
  }) => (0, _styledComponents.css)`
40
- background-color: #fff;
40
+ background-color: var(--colorsUtilityYang100);
41
41
  border-width: 0;
42
- border-bottom: 1px solid ${theme.table.secondary};
42
+ border-bottom: 1px solid var(--colorsUtilityMajor100);
43
43
  text-align: ${align};
44
44
  vertical-align: middle;
45
45
  padding: 0;
@@ -67,7 +67,7 @@ const StyledFlatTableCell = _styledComponents.default.td`
67
67
 
68
68
  ${verticalBorder && (0, _styledComponents.css)`
69
69
  border-right: ${verticalBorderSizes[verticalBorder]} solid
70
- ${theme.table.secondary};
70
+ var(--colorsUtilityMajor300);
71
71
  `}
72
72
 
73
73
  ${verticalBorderColor && (0, _styledComponents.css)`
@@ -76,16 +76,16 @@ const StyledFlatTableCell = _styledComponents.default.td`
76
76
  }
77
77
 
78
78
  &:first-of-type {
79
- border-left: 1px solid ${theme.table.secondary};
79
+ border-left: 1px solid var(--colorsUtilityMajor100);
80
80
  }
81
81
 
82
82
  &:last-of-type {
83
- border-right: 1px solid ${theme.table.secondary};
83
+ border-right: 1px solid var(--colorsUtilityMajor100);
84
84
  }
85
85
 
86
86
  ${rowSpan && (0, _styledComponents.css)`
87
87
  &:first-of-type + & {
88
- border-left: 1px solid ${theme.table.secondary};
88
+ border-left: 1px solid var(--colorsUtilityMajor100);
89
89
  }
90
90
  `}
91
91
 
@@ -37,19 +37,30 @@ const FlatTableCheckbox = ({
37
37
  }
38
38
  }, [reportCellWidth, cellIndex]);
39
39
  const dataElement = `flat-table-checkbox-${as === "td" ? "cell" : "header"}`;
40
+
41
+ const handleClick = event => {
42
+ event.stopPropagation();
43
+ if (onClick) onClick(event);
44
+ };
45
+
46
+ const handleKeyDown = event => {
47
+ event.stopPropagation();
48
+ };
49
+
40
50
  return /*#__PURE__*/_react.default.createElement(_flatTableCheckbox.default, {
41
51
  ref: ref,
42
52
  makeCellSticky: !!reportCellWidth,
43
53
  leftPosition: leftPosition || 0,
44
54
  "data-element": dataElement,
45
- as: as,
46
- onClick: onClick
55
+ as: as
47
56
  }, selectable && /*#__PURE__*/_react.default.createElement(_checkbox.Checkbox, {
48
57
  checked: checked,
49
58
  onChange: onChange,
50
59
  name: "flat-table-checkbox",
51
60
  mb: 0,
52
- ariaLabelledBy: ariaLabelledBy
61
+ ariaLabelledBy: ariaLabelledBy,
62
+ onClick: handleClick,
63
+ onKeyDown: handleKeyDown
53
64
  }));
54
65
  };
55
66
 
@@ -9,8 +9,6 @@ var _styledComponents = _interopRequireWildcard(require("styled-components"));
9
9
 
10
10
  var _checkbox = _interopRequireDefault(require("../../checkbox/checkbox.style"));
11
11
 
12
- var _base = _interopRequireDefault(require("../../../style/themes/base"));
13
-
14
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
13
 
16
14
  function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
@@ -20,14 +18,13 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj;
20
18
  const StyledFlatTableCheckbox = _styledComponents.default.td`
21
19
  ${({
22
20
  as,
23
- theme,
24
21
  leftPosition,
25
22
  makeCellSticky
26
23
  }) => (0, _styledComponents.css)`
27
24
  ${as === "td" && (0, _styledComponents.css)`
28
- background-color: ${theme.colors.white};
25
+ background-color: var(--colorsUtilityYang100);
29
26
  border-width: 0;
30
- border-bottom: 1px solid ${theme.table.secondary};
27
+ border-bottom: 1px solid var(--colorsUtilityMajor100);
31
28
  overflow: visible;
32
29
  padding: 0;
33
30
  text-align: left;
@@ -36,18 +33,18 @@ const StyledFlatTableCheckbox = _styledComponents.default.td`
36
33
  white-space: nowrap;
37
34
 
38
35
  &:first-of-type {
39
- border-left: 1px solid ${theme.table.secondary};
36
+ border-left: 1px solid var(--colorsUtilityMajor100);
40
37
  }
41
38
 
42
39
  &:last-of-type {
43
- border-right: 1px solid ${theme.table.secondary};
40
+ border-right: 1px solid var(--colorsUtilityMajor100);
44
41
  }
45
42
  `}
46
43
 
47
44
  ${as === "th" && (0, _styledComponents.css)`
48
45
  background-color: transparent;
49
46
  border-width: 0;
50
- border-bottom: 1px solid ${theme.table.secondary};
47
+ border-bottom: 1px solid var(--colorsUtilityMajor100);
51
48
  box-sizing: border-box;
52
49
  font-weight: 700;
53
50
  left: auto;
@@ -72,8 +69,5 @@ const StyledFlatTableCheckbox = _styledComponents.default.td`
72
69
  padding-top: 0px;
73
70
  }
74
71
  `;
75
- StyledFlatTableCheckbox.defaultProps = {
76
- theme: _base.default
77
- };
78
72
  var _default = StyledFlatTableCheckbox;
79
73
  exports.default = _default;
@@ -9,10 +9,6 @@ var _styledComponents = _interopRequireWildcard(require("styled-components"));
9
9
 
10
10
  var _styledSystem = require("styled-system");
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,7 +22,6 @@ const StyledFlatTableHeader = _styledComponents.default.th`
26
22
  ${({
27
23
  align,
28
24
  alternativeBgColor,
29
- theme,
30
25
  colWidth,
31
26
  leftPosition,
32
27
  makeCellSticky,
@@ -65,9 +60,13 @@ const StyledFlatTableHeader = _styledComponents.default.th`
65
60
  }
66
61
 
67
62
  ${alternativeBgColor && (0, _styledComponents.css)`
68
- &&& {
69
- background-color: ${theme.flatTable.headerAlternativeBackground}`}
70
- };
63
+ &&&:first-child {
64
+ border-left: 1px solid var(--colorsActionMinor550);
65
+ }
66
+ &&& {
67
+ background-color: var(--colorsActionMinor550);
68
+ }
69
+ `};
71
70
 
72
71
  ${makeCellSticky && (0, _styledComponents.css)`
73
72
  left: ${leftPosition}px;
@@ -102,8 +101,5 @@ const StyledFlatTableHeader = _styledComponents.default.th`
102
101
  }
103
102
  `}
104
103
  `;
105
- StyledFlatTableHeader.defaultProps = {
106
- theme: _base.default
107
- };
108
104
  var _default = StyledFlatTableHeader;
109
105
  exports.default = _default;
@@ -36,14 +36,14 @@ const stickyColumnFocusStyling = (index, theme) => {
36
36
  return `
37
37
  border-bottom: 1px solid transparent;
38
38
  border-left: 1px solid
39
- ${index === 0 ? theme.colors.focus : theme.table.secondary};
39
+ ${index === 0 ? "var(--colorsSemanticFocus500)" : "var(--colorsUtilityMajor100)"};
40
40
  background-clip: padding-box;
41
41
  z-index: ${theme.zIndex.overlay + 2};
42
42
 
43
43
  :before {
44
44
  content: "";
45
- border-top: 2px solid ${theme.colors.focus};
46
- border-bottom: 2px solid ${theme.colors.focus};
45
+ border-top: 2px solid var(--colorsSemanticFocus500);
46
+ border-bottom: 2px solid var(--colorsSemanticFocus500);
47
47
  display: block;
48
48
  left: 0px;
49
49
  top: -1px;
@@ -55,20 +55,20 @@ const stickyColumnFocusStyling = (index, theme) => {
55
55
  `;
56
56
  };
57
57
 
58
- const borderColor = (colorTheme, theme) => {
58
+ const borderColor = colorTheme => {
59
59
  switch (colorTheme) {
60
60
  case "light":
61
- return theme.flatTable.light.border;
61
+ return "var(--colorsUtilityMajor100)";
62
62
 
63
63
  case "transparent-base":
64
- return theme.flatTable.transparentBase.border;
64
+ return "var(--colorsUtilityMajor025)";
65
65
 
66
66
  case "transparent-white":
67
- return theme.flatTable.transparentWhite.border;
67
+ return "var(--colorsUtilityYang100)";
68
68
  // default theme is "dark"
69
69
 
70
70
  default:
71
- return theme.flatTable.dark.border;
71
+ return "var(--colorsUtilityMajor400)";
72
72
  }
73
73
  };
74
74
 
@@ -98,8 +98,8 @@ const StyledFlatTableRow = _styledComponents.default.tr`
98
98
  }) => {
99
99
  const backgroundColor = bgColor ? (0, _color.toColor)(theme, bgColor) : undefined;
100
100
  const customBorderColor = horizontalBorderColor ? (0, _color.toColor)(theme, horizontalBorderColor) : undefined;
101
- const colorOfSelected = isInSidebar ? theme.flatTable.drawerSidebar.selected : theme.flatTable.selected;
102
- const colorOfHighlighted = isInSidebar ? theme.flatTable.drawerSidebar.highlighted : theme.flatTable.highlighted;
101
+ const colorOfSelected = isInSidebar ? "var(--colorsUtilityMajor150)" : "var(--colorsUtilityMajor075)";
102
+ const colorOfHighlighted = isInSidebar ? "var(--colorsUtilityMajor100)" : "var(--colorsUtilityMajor050)";
103
103
  const allCellTypes = `${_flatTableRowHeader.StyledFlatTableRowHeader}, ${_flatTableCell.StyledFlatTableCell}, ${_flatTableCheckbox.default}`;
104
104
  return (0, _styledComponents.css)`
105
105
  border-collapse: separate;
@@ -110,12 +110,16 @@ const StyledFlatTableRow = _styledComponents.default.tr`
110
110
  width: auto;
111
111
  outline: 2px solid #0000;
112
112
 
113
+ [data-component="icon"] {
114
+ color: var(--colorsActionMinor500);
115
+ }
116
+
113
117
  ${allCellTypes} {
114
118
  ${backgroundColor && `background-color: ${backgroundColor};`}
115
119
 
116
120
  ${horizontalBorderSize !== "small" && (0, _styledComponents.css)`
117
121
  border-bottom: ${horizontalBorderSizes[horizontalBorderSize]} solid
118
- ${theme.table.secondary};
122
+ var(--colorsUtilityMajor100);
119
123
  `}
120
124
 
121
125
  ${customBorderColor && (0, _styledComponents.css)`
@@ -124,11 +128,11 @@ const StyledFlatTableRow = _styledComponents.default.tr`
124
128
  }
125
129
 
126
130
  ${_flatTableHeader.default} {
127
- border-bottom: 1px solid ${borderColor(colorTheme, theme)};
131
+ border-bottom: 1px solid ${borderColor(colorTheme)};
128
132
 
129
133
  ${!isInSidebar && `
130
134
  :first-child {
131
- border-left: 1px solid ${borderColor(colorTheme, theme)};
135
+ border-left: 1px solid ${borderColor(colorTheme)};
132
136
  }
133
137
  `}
134
138
  }
@@ -143,7 +147,7 @@ const StyledFlatTableRow = _styledComponents.default.tr`
143
147
  cursor: pointer;
144
148
 
145
149
  :focus {
146
- outline: 2px solid ${theme.colors.focus};
150
+ outline: 2px solid var(--colorsSemanticFocus500);
147
151
  outline-offset: -1px;
148
152
 
149
153
  ${_flatTableRowHeader.StyledFlatTableRowHeader} {
@@ -165,7 +169,7 @@ const StyledFlatTableRow = _styledComponents.default.tr`
165
169
 
166
170
  :hover {
167
171
  ${allCellTypes} {
168
- background-color: ${backgroundColor || theme.flatTable.hover};
172
+ background-color: ${backgroundColor || "var(--colorsUtilityMajor025)"};
169
173
  }
170
174
  }
171
175
  `}
@@ -176,43 +180,42 @@ const StyledFlatTableRow = _styledComponents.default.tr`
176
180
  cursor: pointer;
177
181
 
178
182
  :focus {
179
- outline: 2px solid ${theme.colors.focus};
183
+ outline: 2px solid var(--colorsSemanticFocus500);
180
184
  outline-offset: -1px;
181
185
  }
182
186
 
183
187
  :hover {
184
- background-color: ${backgroundColor || theme.flatTable.hover};
188
+ background-color: ${backgroundColor || "var(colorsUtilityMajor025)"};
185
189
  }
186
190
  }
187
191
  `}
188
192
 
189
193
  ${![-1, 0].includes(rowHeaderIndex) && (0, _styledComponents.css)`
190
194
  td:nth-of-type(${rowHeaderIndex + 1}) {
191
- border-left: 1px solid ${customBorderColor || theme.table.secondary};
195
+ border-left: 1px solid
196
+ ${customBorderColor || "var(--colorsUtilityMajor100)"};
192
197
  }
193
198
 
194
199
  th:nth-of-type(${rowHeaderIndex + 2}) {
195
- border-left: 1px solid
196
- ${customBorderColor || borderColor(colorTheme, theme)};
200
+ border-left: 1px solid ${customBorderColor || borderColor(colorTheme)};
197
201
  }
198
202
  `}
199
203
 
200
204
  ${applyBorderLeft && (0, _styledComponents.css)`
201
205
  th:first-of-type {
202
- border-left: 1px solid
203
- ${customBorderColor || borderColor(colorTheme, theme)};
206
+ border-left: 1px solid ${customBorderColor || borderColor(colorTheme)};
204
207
  }
205
208
  `}
206
209
 
207
210
  ${isInSidebar && (0, _styledComponents.css)`
208
211
  ${allCellTypes} {
209
- background-color: ${bgColor || theme.flatTable.drawerSidebar.headerBackground};
212
+ background-color: ${bgColor || "var(--colorsUtilityMajor040)"};
210
213
  };
211
214
  }
212
215
 
213
216
  ${_flatTableHeader.default} {
214
- background-color: ${theme.flatTable.drawerSidebar.headerBackground};
215
- border-bottom-color: ${theme.table.secondary};
217
+ background-color: var(--colorsUtilityMajor040);
218
+ border-bottom-color: var(--colorsUtilityMajor100);
216
219
  }
217
220
 
218
221
  td:first-of-type,
@@ -232,7 +235,7 @@ const StyledFlatTableRow = _styledComponents.default.tr`
232
235
  :hover {
233
236
  ${_flatTableCell.StyledFlatTableCell},
234
237
  ${_flatTableCheckbox.default}:not(th) {
235
- background-color: ${backgroundColor || theme.flatTable.drawerSidebar.hover};
238
+ background-color: ${backgroundColor || "var(--colorsUtilityMajor075)"};
236
239
  }
237
240
  }
238
241
  `}
@@ -253,7 +256,7 @@ const StyledFlatTableRow = _styledComponents.default.tr`
253
256
 
254
257
  ${isSubRow && (0, _styledComponents.css)`
255
258
  ${allCellTypes} {
256
- background-color: ${backgroundColor || theme.flatTable.subRow.background};
259
+ background-color: ${backgroundColor || "var(--colorsActionMinor025)"};
257
260
  }
258
261
 
259
262
  ${_flatTableCell.StyledFlatTableCell}:first-child > div,
@@ -264,23 +267,24 @@ const StyledFlatTableRow = _styledComponents.default.tr`
264
267
  `}
265
268
 
266
269
  ${isDragging && (0, _styledComponents.css)`
267
- border: ${isInSidebar ? theme.palette.slateTint(40) : theme.palette.slateTint(55)}
270
+ border: ${isInSidebar ? "var(--colorsUtilityMajor300)" : "var(--colorsUtilityMajor200)"}
268
271
  2px solid;
269
272
  cursor: grabbing;
270
273
  ${allCellTypes} {
271
- background-color: ${isInSidebar ? theme.palette.slateTint(60) : theme.palette.slateTint(75)};
274
+ background-color: ${isInSidebar ? "var(--colorsUtilityMajor200)" : "var(--colorsUtilityMajor150)"};
272
275
  }
273
276
  `}
274
277
 
275
278
  ${draggable && (0, _styledComponents.css)`
276
279
  ${_icon.default}:first-of-type {
277
280
  font-size: 16px;
281
+ color: var(--colorsActionMinor500);
278
282
  }
279
283
  `}
280
284
 
281
285
  ${isFirstSubRow && (0, _styledComponents.css)`
282
286
  ${allCellTypes} {
283
- box-shadow: inset 0 6px 4px -4px ${theme.flatTable.subRow.shadow};
287
+ box-shadow: var(--boxShadow075);
284
288
  }
285
289
  `}
286
290
 
@@ -35,8 +35,8 @@ const StyledFlatTableRowHeader = _styledComponents.default.th`
35
35
  verticalBorder,
36
36
  verticalBorderColor
37
37
  }) => (0, _styledComponents.css)`
38
- background-color: #fff;
39
- border: 1px solid ${theme.table.secondary};
38
+ background-color: var(--colorsUtilityYang100);
39
+ border: 1px solid var(--colorsUtilityMajor100);
40
40
  border-top: none;
41
41
  box-sizing: border-box;
42
42
  left: 0;
@@ -98,7 +98,4 @@ const StyledFlatTableRowHeaderContent = _styledComponents.default.div`
98
98
  line-height: 1em;
99
99
  `}
100
100
  `;
101
- exports.StyledFlatTableRowHeaderContent = StyledFlatTableRowHeaderContent;
102
- StyledFlatTableRowHeaderContent.defaultProps = {
103
- theme: _base.default
104
- };
101
+ exports.StyledFlatTableRowHeaderContent = StyledFlatTableRowHeaderContent;
@@ -76,55 +76,51 @@ const StyledFlatTable = _styledComponents.default.table`
76
76
  }}
77
77
 
78
78
  ${({
79
- isZebra,
80
- theme
79
+ isZebra
81
80
  }) => isZebra && (0, _styledComponents.css)`
82
81
  ${_flatTableRow.default}:nth-child(2n) {
83
82
  ${_flatTableRowHeader.StyledFlatTableRowHeader},
84
83
  ${_flatTableCell.StyledFlatTableCell},
85
84
  ${_flatTableCheckbox.default} {
86
- background-color: ${theme.table.zebra};
85
+ background-color: var(--colorsUtilityMajor010);
87
86
  }
88
87
  }
89
88
  ${_flatTableRow.default}:hover {
90
89
  ${_flatTableCell.StyledFlatTableCell},
91
90
  ${_flatTableRowHeader.StyledFlatTableRowHeader},
92
91
  ${_flatTableCheckbox.default} {
93
- background-color: ${theme.flatTable.hover};
92
+ background-color: var(--colorsUtilityMajor025);
94
93
  }
95
94
  }
96
95
  `}
97
96
  `;
98
97
  exports.StyledFlatTable = StyledFlatTable;
99
98
  StyledFlatTable.defaultProps = {
100
- theme: _themes.baseTheme,
101
99
  size: "medium"
102
100
  };
103
101
  const StyledFlatTableWrapper = (0, _styledComponents.default)(_box.default)`
104
102
  ${({
105
- isInSidebar,
106
- theme
103
+ isInSidebar
107
104
  }) => (0, _styledComponents.css)`
108
105
  box-sizing: border-box;
109
106
 
110
107
  :focus {
111
- outline: 2px solid ${theme.colors.focus};
108
+ outline: 2px solid var(--colorsSemanticFocus500);
112
109
 
113
110
  :not(:focus-visible) {
114
111
  outline: none;
115
112
  }
116
113
 
117
114
  :focus-visible {
118
- outline: 2px solid ${theme.colors.focus};
115
+ outline: 2px solid var(--colorsSemanticFocus500);
119
116
  }
120
117
  }
121
118
 
122
- ${isInSidebar ? "min-width: fit-content" : `box-shadow: inset 0px 0px 0px 1px ${theme.table.secondary}`};
119
+ ${isInSidebar ? "min-width: fit-content" : `box-shadow: inset 0px 0px 0px 1px var(--colorsUtilityMajor100)`};
123
120
  `}
124
121
 
125
122
  ${({
126
- colorTheme,
127
- theme
123
+ colorTheme
128
124
  }) => {
129
125
  switch (colorTheme) {
130
126
  case "light":
@@ -132,9 +128,9 @@ const StyledFlatTableWrapper = (0, _styledComponents.default)(_box.default)`
132
128
  ${_flatTableHeader.default},
133
129
  ${_flatTableHead.default} ${_flatTableRowHeader.StyledFlatTableRowHeader},
134
130
  ${_flatTableHead.default} ${_flatTableCheckbox.default} {
135
- background-color: ${theme.flatTable.light.headerBackground};
136
- border-right: 1px solid ${theme.flatTable.light.border};
137
- border-bottom-color: ${theme.flatTable.light.border};
131
+ background-color: var(--colorsUtilityMajor100);
132
+ border-right: 1px solid var(--colorsUtilityMajor150);
133
+ border-bottom-color: var(--colorsUtilityMajor100);
138
134
  }
139
135
  `;
140
136
 
@@ -143,9 +139,9 @@ const StyledFlatTableWrapper = (0, _styledComponents.default)(_box.default)`
143
139
  ${_flatTableHeader.default},
144
140
  ${_flatTableHead.default} ${_flatTableRowHeader.StyledFlatTableRowHeader},
145
141
  ${_flatTableHead.default} ${_flatTableCheckbox.default} {
146
- background-color: ${theme.flatTable.transparentBase.headerBackground};
147
- border-right: 1px solid ${theme.flatTable.transparentBase.border};
148
- border-bottom-color: ${theme.table.secondary};
142
+ background-color: var(--colorsUtilityMajor025);
143
+ border-right: 1px solid var(--colorsUtilityMajor025);
144
+ border-bottom-color: var(--colorsUtilityMajor100);
149
145
  }
150
146
  `;
151
147
 
@@ -154,9 +150,9 @@ const StyledFlatTableWrapper = (0, _styledComponents.default)(_box.default)`
154
150
  ${_flatTableHeader.default},
155
151
  ${_flatTableHead.default} ${_flatTableRowHeader.StyledFlatTableRowHeader},
156
152
  ${_flatTableHead.default} ${_flatTableCheckbox.default} {
157
- background-color: ${theme.flatTable.transparentWhite.headerBackground};
158
- border-right: 1px solid ${theme.flatTable.transparentWhite.border};
159
- border-bottom-color: ${theme.table.secondary};
153
+ background-color: var(--colorsUtilityYang100);
154
+ border-right: 1px solid var(--colorsUtilityYang100);
155
+ border-bottom-color: var(--colorsUtilityMajor100);
160
156
  }
161
157
  `;
162
158
  // default theme is "dark"
@@ -166,26 +162,24 @@ const StyledFlatTableWrapper = (0, _styledComponents.default)(_box.default)`
166
162
  ${_flatTableHead.default} ${_flatTableCheckbox.default},
167
163
  ${_flatTableHeader.default},
168
164
  ${_flatTableHead.default} ${_flatTableRowHeader.StyledFlatTableRowHeader} {
169
- background-color: ${theme.flatTable.dark.headerBackground};
170
- border-right: 1px solid ${theme.flatTable.dark.border};
171
- color: ${theme.colors.white};
172
- border-bottom-color: ${theme.flatTable.dark.border};
165
+ background-color: var(--colorsUtilityMajor400);
166
+ border-right: 1px solid var(--colorsUtilityMajor300);
167
+ color: var(--colorsUtilityYang100);
168
+ border-bottom-color: var(--colorsUtilityMajor300);
173
169
  }
174
170
  `;
175
171
  }
176
172
  }}
177
173
 
178
174
  ${({
179
- isInSidebar,
180
- theme
175
+ isInSidebar
181
176
  }) => isInSidebar && (0, _styledComponents.css)`
182
177
  ${_flatTableHeader.default}, ${_flatTableHead.default} ${_flatTableRowHeader.StyledFlatTableRowHeader},
183
178
  ${_flatTableHead.default} ${_flatTableCheckbox.default} {
184
- background-color: ${theme.flatTable.drawerSidebar.headerBackground};
185
- border-right: 2px solid
186
- ${theme.flatTable.drawerSidebar.headerBackground};
187
- color: ${theme.colors.black};
188
- border-bottom-color: ${theme.table.secondary};
179
+ background-color: var(--colorsUtilityMajor040);
180
+ border-right: 2px solid var(--colorsUtilityMajor040);
181
+ color: var(--colorsUtilityYin090);
182
+ border-bottom-color: var(--colorsUtilityMajor100);
189
183
  }
190
184
  `}
191
185
 
@@ -221,7 +215,4 @@ const StyledFlatTableFooter = _styledComponents.default.div`
221
215
  bottom: 0px;
222
216
  `}
223
217
  `;
224
- exports.StyledFlatTableFooter = StyledFlatTableFooter;
225
- StyledFlatTableFooter.defaultProps = {
226
- theme: _themes.baseTheme
227
- };
218
+ exports.StyledFlatTableFooter = StyledFlatTableFooter;
@@ -9,8 +9,6 @@ var _styledComponents = _interopRequireDefault(require("styled-components"));
9
9
 
10
10
  var _icon = _interopRequireDefault(require("../../icon/icon.style"));
11
11
 
12
- var _themes = require("../../../style/themes");
13
-
14
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
13
 
16
14
  const StyledSort = _styledComponents.default.div`
@@ -25,9 +23,7 @@ const StyledSort = _styledComponents.default.div`
25
23
  width: 16px;
26
24
  height: 16px;
27
25
  padding-left: 6px;
28
- color: ${({
29
- theme
30
- }) => theme.flatTable.headerIconColor};
26
+ color: var(--colorsUtilityMajor200);
31
27
  }
32
28
 
33
29
  :hover {
@@ -36,9 +32,7 @@ const StyledSort = _styledComponents.default.div`
36
32
  }
37
33
 
38
34
  :focus {
39
- outline: 1px solid ${({
40
- theme
41
- }) => theme.colors.focus};
35
+ outline: 1px solid var(--colorsSemanticFocus500);
42
36
  }
43
37
  `;
44
38
  exports.StyledSort = StyledSort;
@@ -46,7 +40,4 @@ const StyledSpaceHolder = _styledComponents.default.div`
46
40
  display: inline-block;
47
41
  width: 22px;
48
42
  `;
49
- exports.StyledSpaceHolder = StyledSpaceHolder;
50
- StyledSort.defaultProps = {
51
- theme: _themes.baseTheme
52
- };
43
+ exports.StyledSpaceHolder = StyledSpaceHolder;
@@ -36,12 +36,13 @@ declare namespace PopoverContainer {
36
36
  export { position_1 as position };
37
37
  const shouldCoverButton_1: boolean;
38
38
  export { shouldCoverButton_1 as shouldCoverButton };
39
- export function renderOpenComponent_1({ tabIndex, onClick, dataElement, ref, ariaLabel, }: {
39
+ export function renderOpenComponent_1({ tabIndex, onClick, dataElement, ref, ariaLabel, id, }: {
40
40
  tabIndex: any;
41
41
  onClick: any;
42
42
  dataElement: any;
43
43
  ref: any;
44
44
  ariaLabel: any;
45
+ id: any;
45
46
  }): JSX.Element;
46
47
  export { renderOpenComponent_1 as renderOpenComponent };
47
48
  export function renderCloseComponent_1({ dataElement, tabIndex, onClick, ref, ariaLabel, }: {
@@ -78,7 +78,8 @@ const PopoverContainer = ({
78
78
  dataElement: "popover-container-open-component",
79
79
  onClick: handleOpenButtonClick,
80
80
  ref: openButtonRef,
81
- ariaLabel: openButtonAriaLabel || title
81
+ ariaLabel: openButtonAriaLabel || title,
82
+ id: isOpen ? undefined : popoverContainerId
82
83
  };
83
84
  const renderCloseComponentProps = {
84
85
  dataElement: "popover-container-close-component",
@@ -90,7 +91,7 @@ const PopoverContainer = ({
90
91
  return /*#__PURE__*/_react.default.createElement(_popoverContainer.PopoverContainerWrapperStyle, {
91
92
  "data-component": "popover-container",
92
93
  role: "region",
93
- "aria-labelledby": isOpen ? popoverContainerId : undefined
94
+ "aria-labelledby": popoverContainerId
94
95
  }, renderOpenComponent(renderOpenComponentProps), /*#__PURE__*/_react.default.createElement(_reactTransitionGroup.Transition, {
95
96
  in: isOpen,
96
97
  timeout: {
@@ -173,7 +174,8 @@ PopoverContainer.defaultProps = {
173
174
  onClick,
174
175
  dataElement,
175
176
  ref,
176
- ariaLabel
177
+ ariaLabel,
178
+ id
177
179
  /* eslint-enable react/prop-types */
178
180
 
179
181
  }) => /*#__PURE__*/_react.default.createElement(_popoverContainer.PopoverContainerOpenIcon, {
@@ -182,7 +184,8 @@ PopoverContainer.defaultProps = {
182
184
  "data-element": dataElement,
183
185
  ref: ref,
184
186
  "aria-label": ariaLabel,
185
- "aria-haspopup": true
187
+ "aria-haspopup": true,
188
+ id: id
186
189
  }, /*#__PURE__*/_react.default.createElement(_icon.default, {
187
190
  type: "settings"
188
191
  })),
@@ -7,15 +7,12 @@ exports.StyledCounterWrapper = exports.StyledCounter = 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 StyledCounter = _styledComponents.default.span`
15
13
  color: ${({
16
- theme,
17
14
  hasError
18
- }) => hasError ? `${theme.colors.error};` : `${theme.editor.counter};`}
15
+ }) => hasError ? "var(--colorsSemanticNegative500)" : "var(--colorsUtilityYin055)"};
19
16
  width: 100%;
20
17
  `;
21
18
  exports.StyledCounter = StyledCounter;
@@ -29,7 +26,4 @@ const StyledCounterWrapper = _styledComponents.default.div`
29
26
  text-align: right;
30
27
  align-items: center;
31
28
  `;
32
- exports.StyledCounterWrapper = StyledCounterWrapper;
33
- StyledCounter.defaultProps = {
34
- theme: _base.default
35
- };
29
+ exports.StyledCounterWrapper = StyledCounterWrapper;
@@ -7,8 +7,6 @@ exports.default = void 0;
7
7
 
8
8
  var _styledComponents = _interopRequireWildcard(require("styled-components"));
9
9
 
10
- var _base = _interopRequireDefault(require("../../../../../style/themes/base"));
11
-
12
10
  var _icon = _interopRequireDefault(require("../../../../icon/icon.style"));
13
11
 
14
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -32,26 +30,22 @@ const StyledToolbarButton = _styledComponents.default.button.attrs({
32
30
  }
33
31
 
34
32
  ${({
35
- theme,
36
33
  isActive
37
34
  }) => (0, _styledComponents.css)`
38
35
  :focus,
39
36
  :active {
40
- outline: 2px solid ${theme.colors.focus};
37
+ outline: 2px solid var(--colorsSemanticFocus500);
41
38
  outline-offset: -2px;
42
39
  }
43
40
 
44
41
  :hover {
45
- background-color: ${theme.editor.button.hover};
42
+ background-color: var(--colorsActionMinor200);
46
43
  }
47
44
 
48
45
  ${isActive && (0, _styledComponents.css)`
49
- background-color: ${theme.editor.button.hover};
46
+ background-color: var(--colorsActionMinor200);
50
47
  `}
51
48
  `}
52
49
  `;
53
- StyledToolbarButton.defaultProps = {
54
- theme: _base.default
55
- };
56
50
  var _default = StyledToolbarButton;
57
51
  exports.default = _default;
@@ -9,8 +9,6 @@ var _styledComponents = _interopRequireDefault(require("styled-components"));
9
9
 
10
10
  var _button = _interopRequireDefault(require("../../../button/button.style"));
11
11
 
12
- var _base = _interopRequireDefault(require("../../../../style/themes/base"));
13
-
14
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
13
 
16
14
  const StyledToolbar = _styledComponents.default.div`
@@ -23,19 +21,12 @@ const StyledToolbar = _styledComponents.default.div`
23
21
  user-select: none;
24
22
  order: 2;
25
23
  border: none;
26
- ${({
27
- theme
28
- }) => `
29
- background-color: ${theme.editor.toolbar.background};
30
- border-top: 1px solid ${theme.editor.border};
31
- `}
24
+ border-top: 1px solid var(--colorsUtilityMajor200);
25
+ background-color: var(--colorsUtilityMajor025);
32
26
  min-width: 290px;
33
27
  z-index: 10;
34
28
  `;
35
29
  exports.StyledToolbar = StyledToolbar;
36
- StyledToolbar.defaultProps = {
37
- theme: _base.default
38
- };
39
30
  const StyledEditorStyleControls = _styledComponents.default.div`
40
31
  display: inline-block;
41
32
  text-align: left;
@@ -44,9 +35,6 @@ const StyledEditorStyleControls = _styledComponents.default.div`
44
35
  margin-left: -2px;
45
36
  `;
46
37
  exports.StyledEditorStyleControls = StyledEditorStyleControls;
47
- StyledEditorStyleControls.defaultProps = {
48
- theme: _base.default
49
- };
50
38
  const StyledEditorActionControls = _styledComponents.default.div`
51
39
  display: inline-block;
52
40
  text-align: right;
@@ -58,7 +46,4 @@ const StyledEditorActionControls = _styledComponents.default.div`
58
46
  min-height: 33px;
59
47
  }
60
48
  `;
61
- exports.StyledEditorActionControls = StyledEditorActionControls;
62
- StyledEditorActionControls.defaultProps = {
63
- theme: _base.default
64
- };
49
+ exports.StyledEditorActionControls = StyledEditorActionControls;
@@ -29,7 +29,6 @@ StyledEditorWrapper.defaultProps = {
29
29
  };
30
30
  const StyledEditorContainer = _styledComponents.default.div`
31
31
  ${({
32
- theme,
33
32
  hasError,
34
33
  rows,
35
34
  hasPreview
@@ -50,7 +49,7 @@ const StyledEditorContainer = _styledComponents.default.div`
50
49
  min-height: inherit;
51
50
  height: 100%;
52
51
  min-width: 290px;
53
- background-color: ${theme.colors.white};
52
+ background-color: var(--colorsUtilityYang100);
54
53
  line-height: ${lineHeight}px;
55
54
 
56
55
  ${!(0, _browserTypeCheck.isSafari)(navigator) && (0, _styledComponents.css)`
@@ -70,17 +69,13 @@ const StyledEditorContainer = _styledComponents.default.div`
70
69
  padding: 14px 8px;
71
70
  }
72
71
 
73
- background-color: ${theme.colors.white};
74
- outline: ${hasError ? `2px solid ${theme.colors.error};` : `1px solid ${theme.editor.border};`};
72
+ background-color: var(--colorsUtilityYang100);
73
+ outline: ${hasError ? "2px solid var(--colorsSemanticNegative500)" : "1px solid var(--colorsUtilityMajor200)"};
75
74
  `}
76
75
  `;
77
76
  exports.StyledEditorContainer = StyledEditorContainer;
78
- StyledEditorContainer.defaultProps = {
79
- theme: _base.default
80
- };
81
77
  const StyledEditorOutline = _styledComponents.default.div`
82
78
  ${({
83
- theme,
84
79
  isFocused,
85
80
  hasError
86
81
  }) => (0, _styledComponents.css)`
@@ -88,12 +83,9 @@ const StyledEditorOutline = _styledComponents.default.div`
88
83
  min-width: 320px;
89
84
 
90
85
  ${isFocused && (0, _styledComponents.css)`
91
- outline: 3px solid ${theme.colors.focus};
86
+ outline: 3px solid var(--colorsSemanticFocus500);
92
87
  outline-offset: ${hasError ? "2px;" : "1px;"};
93
88
  `}
94
89
  `}
95
90
  `;
96
- exports.StyledEditorOutline = StyledEditorOutline;
97
- StyledEditorOutline.defaultProps = {
98
- theme: _base.default
99
- };
91
+ exports.StyledEditorOutline = StyledEditorOutline;
@@ -106,7 +106,7 @@ const Textbox = ({
106
106
  labelHelp,
107
107
  fieldHelp
108
108
  });
109
- const labelId = externalLabelId || internalLabelId;
109
+ const labelId = label ? externalLabelId || internalLabelId : "";
110
110
  return /*#__PURE__*/_react.default.createElement(_tooltipProvider.TooltipProvider, {
111
111
  helpAriaLabel: helpAriaLabel,
112
112
  tooltipPosition: tooltipPosition
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "carbon-react",
3
- "version": "104.23.0",
3
+ "version": "104.25.0",
4
4
  "description": "A library of reusable React components for easily building user interfaces.",
5
5
  "engineStrict": true,
6
6
  "engines": {