@micromag/core 0.3.24 → 0.3.29
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/es/components.js +1 -1
- package/es/utils.js +17 -1
- package/lib/components.js +1 -1
- package/lib/utils.js +17 -0
- package/package.json +2 -2
- package/scss/_theme.scss +4 -4
package/es/components.js
CHANGED
|
@@ -2307,7 +2307,7 @@ var Media = function Media(_ref) {
|
|
|
2307
2307
|
}) : thumbnail, title !== null || children !== null ? /*#__PURE__*/React.createElement("div", {
|
|
2308
2308
|
className: classNames(['card-body', styles$e.body, _defineProperty({}, bodyClassName, bodyClassName !== null)])
|
|
2309
2309
|
}, title !== null ? /*#__PURE__*/React.createElement("h5", {
|
|
2310
|
-
className: classNames(['mt-0', styles$e.title, _defineProperty({}, titleClassName, titleClassName !== null)])
|
|
2310
|
+
className: classNames(['mt-0', 'text-truncate', styles$e.title, _defineProperty({}, titleClassName, titleClassName !== null)])
|
|
2311
2311
|
}, /*#__PURE__*/React.createElement(Label, null, title)) : null, children) : null);
|
|
2312
2312
|
};
|
|
2313
2313
|
|
package/es/utils.js
CHANGED
|
@@ -739,4 +739,20 @@ var validateFields = function validateFields(fields, value) {
|
|
|
739
739
|
}, true);
|
|
740
740
|
};
|
|
741
741
|
|
|
742
|
-
|
|
742
|
+
var getContrastingColor = function getContrastingColor(backgroundColor) {
|
|
743
|
+
var _ref = backgroundColor || {},
|
|
744
|
+
_ref$color = _ref.color,
|
|
745
|
+
color = _ref$color === void 0 ? 'white' : _ref$color;
|
|
746
|
+
|
|
747
|
+
if (tinycolor.equals(color, tinycolor('white'))) {
|
|
748
|
+
return 'lightblue';
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
if (tinycolor.equals(color, tinycolor('black'))) {
|
|
752
|
+
return 'white';
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
return tinycolor(color).spin(30).toString();
|
|
756
|
+
};
|
|
757
|
+
|
|
758
|
+
export { convertStyleToString, createNullableOnChange, createUseEvent, getColorAsString, getComponentFromName, getContrastingColor, getDeviceScreens, getDisplayName, getFieldByName, getFieldFromPath, getFileName, getFontFamily as getFontFamilyFromFont, getGridLayoutName, largestRemainderRound as getLargestRemainderRound, getLayersFromBackground, getLayoutParts, getMediaFilesAsArray, getOptimalImageUrl, getScreenExtraField, getSecondsFromTime, getStyleFromBorder, getStyleFromBox, getStyleFromColor, getStyleFromContainer, getStyleFromHighlight, getStyleFromImage, getStyleFromLink, getStyleFromMargin, getStyleFromText, isImageFilled, isIos, isTextFilled$1 as isLabelFilled, isMessage, isTextFilled, isValidUrl, schemaId, setValue as setFieldValue, slug, unique, validateFields };
|
package/lib/components.js
CHANGED
|
@@ -2330,7 +2330,7 @@ var Media = function Media(_ref) {
|
|
|
2330
2330
|
}) : thumbnail, title !== null || children !== null ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2331
2331
|
className: classNames__default["default"](['card-body', styles$e.body, _defineProperty__default["default"]({}, bodyClassName, bodyClassName !== null)])
|
|
2332
2332
|
}, title !== null ? /*#__PURE__*/React__default["default"].createElement("h5", {
|
|
2333
|
-
className: classNames__default["default"](['mt-0', styles$e.title, _defineProperty__default["default"]({}, titleClassName, titleClassName !== null)])
|
|
2333
|
+
className: classNames__default["default"](['mt-0', 'text-truncate', styles$e.title, _defineProperty__default["default"]({}, titleClassName, titleClassName !== null)])
|
|
2334
2334
|
}, /*#__PURE__*/React__default["default"].createElement(Label, null, title)) : null, children) : null);
|
|
2335
2335
|
};
|
|
2336
2336
|
|
package/lib/utils.js
CHANGED
|
@@ -756,6 +756,22 @@ var validateFields = function validateFields(fields, value) {
|
|
|
756
756
|
}, true);
|
|
757
757
|
};
|
|
758
758
|
|
|
759
|
+
var getContrastingColor = function getContrastingColor(backgroundColor) {
|
|
760
|
+
var _ref = backgroundColor || {},
|
|
761
|
+
_ref$color = _ref.color,
|
|
762
|
+
color = _ref$color === void 0 ? 'white' : _ref$color;
|
|
763
|
+
|
|
764
|
+
if (tinycolor__default["default"].equals(color, tinycolor__default["default"]('white'))) {
|
|
765
|
+
return 'lightblue';
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
if (tinycolor__default["default"].equals(color, tinycolor__default["default"]('black'))) {
|
|
769
|
+
return 'white';
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
return tinycolor__default["default"](color).spin(30).toString();
|
|
773
|
+
};
|
|
774
|
+
|
|
759
775
|
Object.defineProperty(exports, 'pascalCase', {
|
|
760
776
|
enumerable: true,
|
|
761
777
|
get: function () { return changeCase.pascalCase; }
|
|
@@ -769,6 +785,7 @@ exports.createNullableOnChange = createNullableOnChange;
|
|
|
769
785
|
exports.createUseEvent = createUseEvent;
|
|
770
786
|
exports.getColorAsString = getColorAsString;
|
|
771
787
|
exports.getComponentFromName = getComponentFromName;
|
|
788
|
+
exports.getContrastingColor = getContrastingColor;
|
|
772
789
|
exports.getDeviceScreens = getDeviceScreens;
|
|
773
790
|
exports.getDisplayName = getDisplayName;
|
|
774
791
|
exports.getFieldByName = getFieldByName;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/core",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.29",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"javascript"
|
|
@@ -132,5 +132,5 @@
|
|
|
132
132
|
"publishConfig": {
|
|
133
133
|
"access": "public"
|
|
134
134
|
},
|
|
135
|
-
"gitHead": "
|
|
135
|
+
"gitHead": "fb4684ac9e69930c0ac4d9045b5148d011e92c7b"
|
|
136
136
|
}
|
package/scss/_theme.scss
CHANGED
|
@@ -75,7 +75,7 @@ $dropdown-link-hover-color: $body-color;
|
|
|
75
75
|
$btn-close-color: $body-color;
|
|
76
76
|
|
|
77
77
|
|
|
78
|
-
$btn-active-bg-shade-amount:
|
|
79
|
-
$btn-active-bg-tint-amount:
|
|
80
|
-
$btn-active-border-shade-amount:
|
|
81
|
-
$btn-active-border-tint-amount:
|
|
78
|
+
$btn-active-bg-shade-amount: 50% !default;
|
|
79
|
+
$btn-active-bg-tint-amount: 50% !default;
|
|
80
|
+
$btn-active-border-shade-amount: 50% !default;
|
|
81
|
+
$btn-active-border-tint-amount: 25% !default;
|