carbon-react 101.0.1 → 101.1.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.
- package/lib/__internal__/field-help/field-help.style.js +1 -1
- package/lib/components/select/multi-select/multi-select.component.js +9 -12
- package/lib/components/text-editor/__internal__/decorators/link-decorator.js +9 -2
- package/lib/style/design-tokens/debug-theme.util.js +3 -2
- package/lib/style/themes/base/base-theme.config.js +3 -1
- package/lib/style/themes/sage/index.js +2 -1
- package/package.json +4 -4
|
@@ -19,9 +19,9 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj;
|
|
|
19
19
|
|
|
20
20
|
const FieldHelpStyle = _styledComponents.default.span`
|
|
21
21
|
display: block;
|
|
22
|
+
flex: 1;
|
|
22
23
|
margin-top: 8px;
|
|
23
24
|
white-space: pre-wrap;
|
|
24
|
-
width: 100%;
|
|
25
25
|
|
|
26
26
|
${({
|
|
27
27
|
labelInline,
|
|
@@ -344,7 +344,7 @@ const MultiSelect = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
344
344
|
} = optionData;
|
|
345
345
|
|
|
346
346
|
if (selectionType === "navigationKey") {
|
|
347
|
-
setHighlightedValue(
|
|
347
|
+
setHighlightedValue(newValue);
|
|
348
348
|
return;
|
|
349
349
|
}
|
|
350
350
|
|
|
@@ -353,26 +353,23 @@ const MultiSelect = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
353
353
|
}
|
|
354
354
|
|
|
355
355
|
setTextValue("");
|
|
356
|
+
const isAlreadySelected = selectedValue.findIndex(val => (0, _isExpectedValue.default)(val, newValue)) !== -1;
|
|
357
|
+
|
|
358
|
+
if (!isAlreadySelected && isControlled.current && onChange) {
|
|
359
|
+
onChange(createCustomEvent([...selectedValue, newValue]));
|
|
360
|
+
}
|
|
361
|
+
|
|
356
362
|
setSelectedValue(previousValue => {
|
|
357
363
|
textboxRef.focus();
|
|
358
364
|
isMouseDownReported.current = false;
|
|
359
|
-
const isAlreadySelected = previousValue.findIndex(val => (0, _isExpectedValue.default)(val, newValue)) !== -1;
|
|
360
365
|
|
|
361
366
|
if (isAlreadySelected) {
|
|
362
367
|
return previousValue;
|
|
363
368
|
}
|
|
364
369
|
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
if (isControlled.current && onChange) {
|
|
368
|
-
onChange(createCustomEvent(valueList));
|
|
369
|
-
return previousValue;
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
return valueList;
|
|
370
|
+
return [...previousValue, newValue];
|
|
373
371
|
});
|
|
374
|
-
},
|
|
375
|
-
[createCustomEvent, onChange, textboxRef]);
|
|
372
|
+
}, [createCustomEvent, onChange, textboxRef, selectedValue]);
|
|
376
373
|
|
|
377
374
|
function onSelectListClose() {
|
|
378
375
|
setOpenState(false);
|
|
@@ -29,8 +29,15 @@ function findWithRegex(regex, contentBlock, callback) {
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
const linkStrategy = (contentBlock, callback) => {
|
|
32
|
-
const
|
|
33
|
-
|
|
32
|
+
const combineRegex = (...regex) => new RegExp(regex.map(r => r.source).join(""), "g");
|
|
33
|
+
|
|
34
|
+
const urlRegex = combineRegex(/\b/, /(http:\/\/|https:\/\/|www\.)/, // prefix
|
|
35
|
+
/([\w-]+:([\w-]+@))?/, // userinfo
|
|
36
|
+
/([\w-]+\.)+\w+/, // domain
|
|
37
|
+
/(:\d+)?/, // port
|
|
38
|
+
/(\/[\w#!:.?+=&%@!-/]+)?/, // paths, queries, fragments
|
|
39
|
+
/\b/);
|
|
40
|
+
findWithRegex(urlRegex, contentBlock, callback);
|
|
34
41
|
};
|
|
35
42
|
|
|
36
43
|
var _default = {
|
|
@@ -38,14 +38,15 @@ const debugTheme = themeProperties => Object.fromEntries(Object.entries(themePro
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
if (typeof value === "object") {
|
|
41
|
-
return [key, debugTheme(value)];
|
|
41
|
+
return key === "compatibility" ? [key, value] : [key, debugTheme(value)];
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
return [key, ""];
|
|
45
45
|
}));
|
|
46
46
|
|
|
47
47
|
var _default = { ...debugTheme(_mint.default),
|
|
48
|
-
..._common.default
|
|
48
|
+
compatibility: { ..._common.default
|
|
49
|
+
},
|
|
49
50
|
name: "sage-debug"
|
|
50
51
|
};
|
|
51
52
|
exports.default = _default;
|
|
@@ -5,6 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
|
|
8
|
+
var _common = _interopRequireDefault(require("@sage/design-tokens/js/base/common"));
|
|
9
|
+
|
|
8
10
|
var _atOpacity = _interopRequireDefault(require("../../utils/at-opacity"));
|
|
9
11
|
|
|
10
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -340,7 +342,7 @@ var _default = palette => {
|
|
|
340
342
|
},
|
|
341
343
|
|
|
342
344
|
get compatibility() {
|
|
343
|
-
return {
|
|
345
|
+
return { ..._common.default,
|
|
344
346
|
colorsActionMajor500: this.colors.primary,
|
|
345
347
|
colorsActionMajor600: this.colors.secondary,
|
|
346
348
|
colorsActionDisabled500: this.disabled.background,
|
|
@@ -12,7 +12,8 @@ var _index = _interopRequireDefault(require("../mint/index"));
|
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
13
|
|
|
14
14
|
var _default = { ..._index.default,
|
|
15
|
-
..._common.default
|
|
15
|
+
compatibility: { ..._common.default
|
|
16
|
+
},
|
|
16
17
|
name: "sage (experimental)"
|
|
17
18
|
};
|
|
18
19
|
exports.default = _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "carbon-react",
|
|
3
|
-
"version": "101.0
|
|
3
|
+
"version": "101.1.0",
|
|
4
4
|
"description": "A library of reusable React components for easily building user interfaces.",
|
|
5
5
|
"engineStrict": true,
|
|
6
6
|
"engines": {
|
|
@@ -59,9 +59,9 @@
|
|
|
59
59
|
"@babel/preset-typescript": "7.12.7",
|
|
60
60
|
"@commitlint/cli": "^11.0.0",
|
|
61
61
|
"@commitlint/config-conventional": "^11.0.0",
|
|
62
|
-
"@semantic-release/changelog": "^
|
|
62
|
+
"@semantic-release/changelog": "^6.0.1",
|
|
63
63
|
"@semantic-release/exec": "^6.0.2",
|
|
64
|
-
"@semantic-release/git": "^
|
|
64
|
+
"@semantic-release/git": "^10.0.1",
|
|
65
65
|
"@storybook/addon-a11y": "^6.3.6",
|
|
66
66
|
"@storybook/addon-actions": "^6.3.6",
|
|
67
67
|
"@storybook/addon-controls": "^6.3.7",
|
|
@@ -132,7 +132,7 @@
|
|
|
132
132
|
"react-dom": "^16.12.0",
|
|
133
133
|
"react-test-renderer": "^16.12.0",
|
|
134
134
|
"rimraf": "^3.0.2",
|
|
135
|
-
"semantic-release": "^
|
|
135
|
+
"semantic-release": "^18.0.1",
|
|
136
136
|
"semver": "^7.3.5",
|
|
137
137
|
"sprintf-js": "^1.1.2",
|
|
138
138
|
"styled-components": "^4.4.1",
|