@moda/om 18.1.0 → 18.3.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/CHANGELOG.md +14 -0
- package/dist/index.cjs.js +47 -16
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +47 -16
- package/dist/index.esm.js.map +1 -1
- package/dist/src/components/AspectRatioBox/AspectRatioBox.d.ts +4 -4
- package/dist/src/components/Text/Text.d.ts +1 -1
- package/package.json +4 -4
- package/src/components/AspectRatioBox/AspectRatioBox.tsx +25 -5
- package/src/components/Badge/Badge.scss +3 -3
- package/src/components/Breakpoint/Breakpoint.scss +2 -1
- package/src/components/Button/Button.scss +6 -6
- package/src/components/Checkbox/Checkbox.scss +2 -2
- package/src/components/ColorSwatch/ColorSwatch.scss +3 -3
- package/src/components/Divider/Divider.scss +1 -1
- package/src/components/Expandable/Expandable.scss +3 -3
- package/src/components/LoadingShapes/LoadingShapes.scss +1 -1
- package/src/components/Popover/Popover.scss +4 -4
- package/src/components/RadioButton/RadioButton.scss +3 -3
- package/src/components/Select/Select.scss +1 -1
- package/src/components/Select/SelectOption.scss +1 -1
- package/src/components/Select/SelectOptions.scss +1 -1
- package/src/components/SlidingPane/SlidingPane.scss +1 -1
- package/src/components/Text/Text.tsx +1 -1
- package/src/components/Toast/Toast.scss +1 -1
- package/src/mixins/input-styles/_input-styles.scss +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -4852,34 +4852,65 @@ var _excluded$C = ["aspectWidth", "aspectHeight", "maxWidth", "maxHeight", "outl
|
|
|
4852
4852
|
var DEFAULT_PRODUCT_ASPECT_WIDTH = 128;
|
|
4853
4853
|
var DEFAULT_PRODUCT_ASPECT_HEIGHT = 205;
|
|
4854
4854
|
var DEFAULT_PRODUCT_ASPECT_RATIO = DEFAULT_PRODUCT_ASPECT_HEIGHT / DEFAULT_PRODUCT_ASPECT_WIDTH;
|
|
4855
|
-
var
|
|
4856
|
-
var
|
|
4857
|
-
|
|
4858
|
-
_ref$aspectHeight = _ref.aspectHeight,
|
|
4859
|
-
aspectHeight = _ref$aspectHeight === void 0 ? DEFAULT_PRODUCT_ASPECT_HEIGHT : _ref$aspectHeight,
|
|
4855
|
+
var scaleDimensions = function scaleDimensions(_ref) {
|
|
4856
|
+
var width = _ref.width,
|
|
4857
|
+
height = _ref.height,
|
|
4860
4858
|
maxWidth = _ref.maxWidth,
|
|
4861
|
-
maxHeight = _ref.maxHeight
|
|
4862
|
-
|
|
4863
|
-
|
|
4864
|
-
|
|
4865
|
-
|
|
4866
|
-
|
|
4867
|
-
|
|
4859
|
+
maxHeight = _ref.maxHeight;
|
|
4860
|
+
if (maxWidth && maxHeight) return dist$3.scale({
|
|
4861
|
+
width: width,
|
|
4862
|
+
height: height,
|
|
4863
|
+
maxWidth: maxWidth,
|
|
4864
|
+
maxHeight: maxHeight
|
|
4865
|
+
});
|
|
4866
|
+
if (maxWidth) return dist$3.scale({
|
|
4867
|
+
width: width,
|
|
4868
|
+
height: height,
|
|
4869
|
+
maxWidth: maxWidth
|
|
4870
|
+
});
|
|
4871
|
+
if (maxHeight) return dist$3.scale({
|
|
4872
|
+
width: width,
|
|
4873
|
+
height: height,
|
|
4874
|
+
maxHeight: maxHeight
|
|
4875
|
+
});
|
|
4876
|
+
return {
|
|
4877
|
+
width: width,
|
|
4878
|
+
height: height,
|
|
4879
|
+
paddingBottom: dist$3.paddingBottom({
|
|
4880
|
+
width: width,
|
|
4881
|
+
height: height
|
|
4882
|
+
}),
|
|
4883
|
+
scale: 1
|
|
4884
|
+
};
|
|
4885
|
+
};
|
|
4886
|
+
var AspectRatioBox = /*#__PURE__*/React__default.forwardRef(function (_ref2, forwardedRef) {
|
|
4887
|
+
var _ref2$aspectWidth = _ref2.aspectWidth,
|
|
4888
|
+
aspectWidth = _ref2$aspectWidth === void 0 ? DEFAULT_PRODUCT_ASPECT_WIDTH : _ref2$aspectWidth,
|
|
4889
|
+
_ref2$aspectHeight = _ref2.aspectHeight,
|
|
4890
|
+
aspectHeight = _ref2$aspectHeight === void 0 ? DEFAULT_PRODUCT_ASPECT_HEIGHT : _ref2$aspectHeight,
|
|
4891
|
+
maxWidth = _ref2.maxWidth,
|
|
4892
|
+
maxHeight = _ref2.maxHeight,
|
|
4893
|
+
_ref2$outlined = _ref2.outlined,
|
|
4894
|
+
outlined = _ref2$outlined === void 0 ? false : _ref2$outlined,
|
|
4895
|
+
children = _ref2.children,
|
|
4896
|
+
className = _ref2.className,
|
|
4897
|
+
rest = _objectWithoutProperties(_ref2, _excluded$C);
|
|
4898
|
+
var _scaleDimensions = scaleDimensions({
|
|
4868
4899
|
width: aspectWidth,
|
|
4869
4900
|
height: aspectHeight,
|
|
4870
4901
|
maxWidth: maxWidth,
|
|
4871
4902
|
maxHeight: maxHeight
|
|
4872
4903
|
}),
|
|
4873
|
-
width =
|
|
4874
|
-
paddingBottom =
|
|
4904
|
+
width = _scaleDimensions.width,
|
|
4905
|
+
paddingBottom = _scaleDimensions.paddingBottom;
|
|
4875
4906
|
return /*#__PURE__*/React__default.createElement("div", _extends$1({
|
|
4876
4907
|
ref: forwardedRef,
|
|
4877
4908
|
className: classNames('AspectRatioBox', {
|
|
4878
4909
|
'AspectRatioBox--outlined': outlined
|
|
4879
4910
|
}, className),
|
|
4880
|
-
style: {
|
|
4911
|
+
style: maxWidth || maxHeight ? {
|
|
4881
4912
|
maxWidth: "".concat(width, "px")
|
|
4882
|
-
}
|
|
4913
|
+
} : undefined
|
|
4883
4914
|
}, rest), /*#__PURE__*/React__default.createElement("div", {
|
|
4884
4915
|
className: "AspectRatioBox__wrapper",
|
|
4885
4916
|
style: {
|