carbon-react 104.53.0 → 104.53.3

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 (27) hide show
  1. package/esm/components/flat-table/flat-table-row/flat-table-row.style.js +1 -1
  2. package/esm/components/select/multi-select/multi-select.component.js +5 -6
  3. package/esm/components/select/simple-select/simple-select-test.stories.js +127 -117
  4. package/esm/components/tooltip/tooltip.component.js +4 -0
  5. package/esm/style/themes/aegean/aegean-theme.config.d.ts +0 -8
  6. package/esm/style/themes/aegean/aegean-theme.config.js +0 -10
  7. package/esm/style/themes/base/base-theme.config.d.ts +1 -296
  8. package/esm/style/themes/base/base-theme.config.js +2 -303
  9. package/esm/style/themes/base/index.d.ts +1 -303
  10. package/esm/style/themes/mint/mint-theme.config.d.ts +0 -7
  11. package/esm/style/themes/mint/mint-theme.config.js +0 -7
  12. package/esm/style/themes/sage/index.d.ts +0 -241
  13. package/esm/style/themes/sage/index.js +1 -1
  14. package/lib/components/flat-table/flat-table-row/flat-table-row.style.js +1 -1
  15. package/lib/components/select/multi-select/multi-select.component.js +5 -6
  16. package/lib/components/select/simple-select/simple-select-test.stories.js +126 -115
  17. package/lib/components/tooltip/tooltip.component.js +5 -0
  18. package/lib/style/themes/aegean/aegean-theme.config.d.ts +0 -8
  19. package/lib/style/themes/aegean/aegean-theme.config.js +0 -13
  20. package/lib/style/themes/base/base-theme.config.d.ts +1 -296
  21. package/lib/style/themes/base/base-theme.config.js +2 -304
  22. package/lib/style/themes/base/index.d.ts +1 -303
  23. package/lib/style/themes/mint/mint-theme.config.d.ts +0 -7
  24. package/lib/style/themes/mint/mint-theme.config.js +0 -7
  25. package/lib/style/themes/sage/index.d.ts +0 -241
  26. package/lib/style/themes/sage/index.js +1 -1
  27. package/package.json +1 -1
@@ -89,7 +89,7 @@ const StyledFlatTableRow = styled.tr`
89
89
  width: auto;
90
90
  outline: 2px solid #0000;
91
91
 
92
- [data-component="icon"] {
92
+ [data-component="icon"]:not([color]) {
93
93
  color: var(--colorsActionMinor500);
94
94
  }
95
95
 
@@ -107,7 +107,7 @@ const MultiSelect = /*#__PURE__*/React.forwardRef(({
107
107
  const newValue = [...previousValue];
108
108
  newValue.splice(index, 1);
109
109
 
110
- if (isControlled.current && onChange) {
110
+ if (onChange) {
111
111
  onChange(createCustomEvent(newValue));
112
112
  return newValue;
113
113
  }
@@ -228,11 +228,6 @@ const MultiSelect = /*#__PURE__*/React.forwardRef(({
228
228
  onFilterChange(filterText);
229
229
  }
230
230
  }, [filterText, onFilterChange]);
231
- useEffect(() => {
232
- if (!isControlled.current && onChange) {
233
- onChange(createCustomEvent(selectedValue));
234
- }
235
- }, [createCustomEvent, onChange, selectedValue]);
236
231
 
237
232
  function handleTextboxClick(event) {
238
233
  isMouseDownReported.current = false;
@@ -351,6 +346,10 @@ const MultiSelect = /*#__PURE__*/React.forwardRef(({
351
346
  return previousValue;
352
347
  }
353
348
 
349
+ if (onChange) {
350
+ onChange(createCustomEvent([...previousValue, newValue]));
351
+ }
352
+
354
353
  return [...previousValue, newValue];
355
354
  });
356
355
  }, [createCustomEvent, onChange, textboxRef, selectedValue]);
@@ -1,8 +1,6 @@
1
1
  function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
2
 
3
- // it's not mdx file because of https://github.com/storybookjs/storybook/issues/11542
4
3
  import React from "react";
5
- import { action } from "@storybook/addon-actions";
6
4
  import { Select, Option } from "..";
7
5
  export default {
8
6
  component: Select,
@@ -18,40 +16,145 @@ export default {
18
16
  argTypes: {
19
17
  value: {
20
18
  table: {
21
- disabled: true
22
- }
19
+ disable: true
20
+ },
21
+ control: false
22
+ },
23
+ disablePortal: {
24
+ table: {
25
+ disable: true
26
+ },
27
+ control: false
28
+ },
29
+ defaultValue: {
30
+ table: {
31
+ disable: true
32
+ },
33
+ control: false
34
+ },
35
+ children: {
36
+ table: {
37
+ disable: true
38
+ },
39
+ control: false
40
+ },
41
+ openOnFocus: {
42
+ table: {
43
+ disable: true
44
+ },
45
+ control: false
46
+ },
47
+ transparent: {
48
+ table: {
49
+ disable: true
50
+ },
51
+ control: false
52
+ },
53
+ tableHeader: {
54
+ table: {
55
+ disable: true
56
+ },
57
+ control: false
58
+ },
59
+ multiColumn: {
60
+ table: {
61
+ disable: true
62
+ },
63
+ control: false
64
+ },
65
+ isLoading: {
66
+ table: {
67
+ disable: true
68
+ },
69
+ control: false
70
+ },
71
+ onListScrollBottom: {
72
+ table: {
73
+ disable: true
74
+ },
75
+ control: false
76
+ },
77
+ tooltipPosition: {
78
+ table: {
79
+ disable: true
80
+ },
81
+ control: false
82
+ },
83
+ "data-component": {
84
+ table: {
85
+ disable: true
86
+ },
87
+ control: false
88
+ },
89
+ "data-element": {
90
+ table: {
91
+ disable: true
92
+ },
93
+ control: false
94
+ },
95
+ "data-role": {
96
+ table: {
97
+ disable: true
98
+ },
99
+ control: false
23
100
  },
24
101
  listPlacement: {
25
102
  options: ["auto", "auto-start", "auto-end", "top", "top-start", "top-end", "bottom", "bottom-start", "bottom-end", "right", "right-start", "right-end", "left", "left-start", "left-end"],
26
103
  control: {
27
104
  type: "select"
28
105
  }
106
+ },
107
+ onOpen: {
108
+ action: "onOpen",
109
+ table: {
110
+ disable: true
111
+ },
112
+ control: false
113
+ },
114
+ onChange: {
115
+ action: "onChange",
116
+ table: {
117
+ disable: true
118
+ },
119
+ control: false
120
+ },
121
+ onClick: {
122
+ action: "onClick",
123
+ table: {
124
+ disable: true
125
+ },
126
+ control: false
127
+ },
128
+ onFocus: {
129
+ action: "onFocus",
130
+ table: {
131
+ disable: true
132
+ },
133
+ control: false
134
+ },
135
+ onBlur: {
136
+ action: "onBlur",
137
+ table: {
138
+ disable: true
139
+ },
140
+ control: false
141
+ },
142
+ onKeyDown: {
143
+ action: "onKeyDown",
144
+ table: {
145
+ disable: true
146
+ },
147
+ control: false
29
148
  }
30
149
  }
31
150
  };
32
151
 
33
- const Default = args => {
152
+ const Template = args => {
34
153
  return /*#__PURE__*/React.createElement(Select, _extends({
35
154
  name: "simple",
36
155
  id: "simple",
37
156
  label: "label",
38
- labelInline: true,
39
- onOpen: action("onOpen"),
40
- onChange: action("onChange", {
41
- depth: 2
42
- }),
43
- onClick: action("onClick", {
44
- depth: 2
45
- }),
46
- onFocus: action("onFocus", {
47
- depth: 2
48
- }),
49
- onBlur: action("onBlur", {
50
- depth: 2
51
- }),
52
- onKeyDown: action("onKeyDown", {
53
- depth: 2
54
- })
157
+ labelInline: true
55
158
  }, args), /*#__PURE__*/React.createElement(Option, {
56
159
  text: "Amber",
57
160
  value: "1"
@@ -82,102 +185,9 @@ const Default = args => {
82
185
  }));
83
186
  };
84
187
 
85
- Default.storyName = "default";
86
- Default.argTypes = {
87
- value: {
88
- table: {
89
- disable: true
90
- },
91
- control: false
92
- },
93
- disablePortal: {
94
- table: {
95
- disable: true
96
- },
97
- control: false
98
- },
99
- defaultValue: {
100
- table: {
101
- disable: true
102
- },
103
- control: false
104
- },
105
- children: {
106
- table: {
107
- disable: true
108
- },
109
- control: false
110
- },
111
- openOnFocus: {
112
- table: {
113
- disable: true
114
- },
115
- control: false
116
- },
117
- transparent: {
118
- table: {
119
- disable: true
120
- },
121
- control: false
122
- },
123
- tableHeader: {
124
- table: {
125
- disable: true
126
- },
127
- control: false
128
- },
129
- multiColumn: {
130
- table: {
131
- disable: true
132
- },
133
- control: false
134
- },
135
- onOpen: {
136
- table: {
137
- disable: true
138
- },
139
- control: false
140
- },
141
- isLoading: {
142
- table: {
143
- disable: true
144
- },
145
- control: false
146
- },
147
- onListScrollBottom: {
148
- table: {
149
- disable: true
150
- },
151
- control: false
152
- },
153
- tooltipPosition: {
154
- table: {
155
- disable: true
156
- },
157
- control: false
158
- },
159
- "data-component": {
160
- table: {
161
- disable: true
162
- },
163
- control: false
164
- },
165
- "data-element": {
166
- table: {
167
- disable: true
168
- },
169
- control: false
170
- },
171
- "data-role": {
172
- table: {
173
- disable: true
174
- },
175
- control: false
176
- }
177
- };
188
+ export const Default = Template.bind({});
178
189
  Default.args = {
179
190
  mt: 0,
180
191
  listPlacement: undefined,
181
192
  flipEnabled: true
182
- };
183
- export { Default };
193
+ };
@@ -3,11 +3,13 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
3
3
  import React, { useRef } from "react";
4
4
  import PropTypes from "prop-types";
5
5
  import Tippy from "@tippyjs/react/headless";
6
+ import { sticky } from "tippy.js";
6
7
  import StyledTooltip from "./tooltip.style";
7
8
  import StyledPointer from "./tooltip-pointer.style";
8
9
  import tagComponent from "../../__internal__/utils/helpers/tags/tags";
9
10
  import CarbonScopedTokensProvider from "../../style/design-tokens/carbon-scoped-tokens-provider/carbon-scoped-tokens-provider.component";
10
11
  const TOOLTIP_DELAY = 100;
12
+ const tippyPlugins = [sticky];
11
13
  const Tooltip = /*#__PURE__*/React.forwardRef(({
12
14
  children,
13
15
  isVisible,
@@ -60,6 +62,8 @@ const Tooltip = /*#__PURE__*/React.forwardRef(({
60
62
  }, isVisible !== undefined && {
61
63
  visible: isVisible
62
64
  }, {
65
+ plugins: tippyPlugins,
66
+ sticky: true,
63
67
  render: attrs => tooltip(attrs, message),
64
68
  reference: target,
65
69
  popperOptions: {
@@ -1,19 +1,11 @@
1
1
  declare function _default(palette: any): {
2
2
  name: string;
3
3
  colors: {
4
- base: any;
5
4
  primary: any;
6
5
  secondary: any;
7
6
  tertiary: any;
8
- whiteMix: any;
9
- withOpacity: string;
10
- hoveredTabKeyline: any;
11
- disabled: any;
12
7
  loadingBarBackground: any;
13
8
  };
14
- stepSequence: {
15
- completedText: any;
16
- };
17
9
  readonly compatibility: {
18
10
  colorsActionMajor500: any;
19
11
  colorsActionMajor600: any;
@@ -1,22 +1,12 @@
1
- import atOpacity from "../../utils/at-opacity";
2
1
  export default (palette => {
3
- const baseWithOpacity = atOpacity(palette.productBlue);
4
2
  return {
5
3
  name: "aegean",
6
4
  colors: {
7
- base: palette.productBlue,
8
5
  primary: palette.productBlueShade(3),
9
6
  secondary: palette.productBlueShade(23),
10
7
  tertiary: palette.productBlueShade(43),
11
- whiteMix: palette.productBlueTint(90),
12
- withOpacity: baseWithOpacity(0.55),
13
- hoveredTabKeyline: palette.productBlueTint(30),
14
- disabled: palette.productBlueTint(40),
15
8
  loadingBarBackground: palette.productBlueTint(70)
16
9
  },
17
- stepSequence: {
18
- completedText: palette.productBlueShade(23)
19
- },
20
10
 
21
11
  get compatibility() {
22
12
  return {
@@ -5,316 +5,21 @@ declare function _default(palette: any): {
5
5
  spacing: number;
6
6
  space: string[];
7
7
  colors: {
8
- base: any;
9
8
  primary: any;
10
9
  secondary: any;
11
10
  tertiary: any;
12
- brand: any;
13
- disabled: any;
14
- whiteMix: any;
15
- withOpacity: string;
16
11
  loadingBarBackground: any;
17
- black: string;
18
- slate: string;
19
12
  white: string;
20
- border: any;
21
- dashedBorder: string;
22
- dashedButtonText: string;
23
- dashedHoverBackground: string;
24
- focusedIcon: any;
25
- focusedLinkBackground: any;
26
- previewBackground: any;
27
- hoveredTabKeyline: any;
28
13
  error: any;
29
14
  focus: any;
30
15
  info: any;
31
- success: any;
32
16
  warning: any;
33
17
  destructive: {
34
18
  hover: any;
35
19
  };
36
- asterisk: any;
37
- };
38
- progressTracker: {
39
- background: any;
40
- innerBackground: any;
41
- trafficNeutral: any;
42
- };
43
- anchorNavigation: {
44
- divider: any;
45
- navItemHoverBackground: any;
46
- };
47
- accordion: {
48
- border: any;
49
- background: any;
50
- };
51
- tileSelect: {
52
- border: any;
53
- disabledBackground: any;
54
- hoverBackground: any;
55
- descriptionColor: any;
56
- disabledText: any;
57
- };
58
- batchSelection: {
59
- lightTheme: any;
60
- };
61
- hr: {
62
- background: any;
63
- };
64
- editor: {
65
- border: any;
66
- counter: string;
67
- placeholder: string;
68
- button: {
69
- hover: any;
70
- };
71
- toolbar: {
72
- background: any;
73
- };
74
- };
75
- menu: {
76
- focus: any;
77
- divider: any;
78
- itemColor: any;
79
- itemColorDisabled: any;
80
- light: {
81
- text: string;
82
- background: any;
83
- selected: any;
84
- divider: any;
85
- alternate: any;
86
- title: any;
87
- submenuBackground: string;
88
- searchIcon: any;
89
- searchIconHover: any;
90
- };
91
- dark: {
92
- text: string;
93
- background: any;
94
- divider: any;
95
- submenuBackground: any;
96
- selected: any;
97
- alternate: any;
98
- title: any;
99
- searchIcon: any;
100
- searchIconHover: any;
101
- };
102
- black: {
103
- text: string;
104
- background: any;
105
- submenuBackground: any;
106
- selected: any;
107
- divider: any;
108
- alternate: any;
109
- title: any;
110
- searchIcon: any;
111
- searchIconHover: any;
112
- };
113
- white: {
114
- text: string;
115
- background: string;
116
- selected: any;
117
- divider: any;
118
- alternate: any;
119
- submenuBackground: any;
120
- title: any;
121
- searchIcon: any;
122
- searchIconHover: any;
123
- };
124
- };
125
- card: {
126
- footerBackground: any;
127
- footerBorder: any;
128
- };
129
- carousel: {
130
- activeSelectorBackground: any;
131
- inactiveSelectorBackground: any;
132
- };
133
- flatTable: {
134
- light: {
135
- headerBackground: any;
136
- border: any;
137
- };
138
- dark: {
139
- headerBackground: any;
140
- border: any;
141
- };
142
- subRow: {
143
- background: any;
144
- shadow: string;
145
- };
146
- transparentWhite: {
147
- headerBackground: string;
148
- border: string;
149
- };
150
- transparentBase: {
151
- headerBackground: any;
152
- border: any;
153
- };
154
- drawerSidebar: {
155
- headerBackground: any;
156
- hover: any;
157
- highlighted: any;
158
- selected: any;
159
- };
160
- hover: any;
161
- headerIconColor: any;
162
- headerAlternativeBackground: any;
163
- selected: any;
164
- highlighted: any;
165
- };
166
- help: {
167
- color: any;
168
- hover: any;
169
- };
170
- text: {
171
- color: any;
172
- placeholder: any;
173
- size: string;
174
- };
175
- readOnly: {
176
- textboxBackground: any;
177
- textboxBorder: any;
178
- textboxText: any;
179
- };
180
- content: {
181
- secondaryColor: any;
182
20
  };
183
21
  disabled: {
184
- border: any;
185
- button: any;
186
- disabled: any;
187
- input: any;
188
- text: any;
189
- buttonText: string;
190
22
  background: any;
191
- switch: any;
192
- };
193
- draggableItem: {
194
- border: any;
195
- };
196
- checkable: {
197
- checked: string;
198
- };
199
- table: {
200
- primary: any;
201
- secondary: any;
202
- tertiary: any;
203
- header: any;
204
- hover: any;
205
- selected: any;
206
- zebra: any;
207
- dragging: any;
208
- };
209
- drawer: {
210
- background: any;
211
- divider: any;
212
- };
213
- pager: {
214
- active: string;
215
- disabled: string;
216
- alternate: any;
217
- };
218
- icon: {
219
- default: string;
220
- defaultHover: string;
221
- onLightBackground: any;
222
- onLightBackgroundHover: any;
223
- disabled: string;
224
- };
225
- popoverContainer: {
226
- iconColor: string;
227
- };
228
- navigationBar: {
229
- light: {
230
- background: any;
231
- borderBottom: any;
232
- };
233
- dark: {
234
- background: string;
235
- borderBottom: string;
236
- };
237
- black: {
238
- background: any;
239
- };
240
- white: {
241
- borderBottom: any;
242
- };
243
- };
244
- numeralDate: {
245
- passive: string;
246
- error: string;
247
- };
248
- portrait: {
249
- border: any;
250
- background: any;
251
- initials: string;
252
- };
253
- picklist: {
254
- locked: any;
255
- lockedContent: any;
256
- lockedText: any;
257
- };
258
- pill: {
259
- neutral: any;
260
- warning: any;
261
- neutralBackgroundFocus: any;
262
- warningButtonFocus: any;
263
- errorButtonFocus: any;
264
- };
265
- search: {
266
- active: any;
267
- button: string;
268
- passive: any;
269
- icon: any;
270
- iconHover: any;
271
- searchActive: string;
272
- darkVariantPlaceholder: any;
273
- darkVariantBorder: any;
274
- darkVariantText: string;
275
- iconDarkVariant: any;
276
- iconDarkVariantHover: any;
277
- };
278
- select: {
279
- border: string;
280
- selected: any;
281
- optionHeader: any;
282
- tableHeaderBorder: any;
283
- };
284
- shadows: {
285
- depth1: string;
286
- depth2: string;
287
- depth3: string;
288
- depth4: string;
289
- cards: string;
290
- cardsIE: string;
291
- };
292
- stepSequence: {
293
- completedText: any;
294
- };
295
- switch: {
296
- off: any;
297
- offDisabled: any;
298
- offHover: any;
299
- on: any;
300
- onDisabled: any;
301
- onHover: any;
302
- disabledFontColor: string;
303
- };
304
- tile: {
305
- border: any;
306
- footerBackground: any;
307
- separator: any;
308
- };
309
- tab: {
310
- background: any;
311
- altHover: any;
312
- };
313
- editorLinkPreview: {
314
- background: any;
315
- hoverBackground: any;
316
- border: any;
317
- url: any;
318
23
  };
319
24
  zIndex: {
320
25
  smallOverlay: number;
@@ -337,7 +42,6 @@ declare function _default(palette: any): {
337
42
  colorsSemanticNegative600: any;
338
43
  colorsSemanticCaution500: any;
339
44
  colorsSemanticInfo500: any;
340
- fontSizes100: string;
341
45
  metaName: string;
342
46
  metaPublic: string;
343
47
  colorsLogo: string;
@@ -553,6 +257,7 @@ declare function _default(palette: any): {
553
257
  borderWidth300: string;
554
258
  borderWidth400: string;
555
259
  borderWidth000: string;
260
+ fontSizes100: string;
556
261
  fontSizes200: string;
557
262
  fontSizes300: string;
558
263
  fontSizes400: string;