@instructure/ui-utils 11.7.9-snapshot-0 → 11.7.9-snapshot-1
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 +1 -1
- package/lib/px.js +4 -5
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
## [11.7.9-snapshot-
|
|
6
|
+
## [11.7.9-snapshot-1](https://github.com/instructure/instructure-ui/compare/v11.7.8...v11.7.9-snapshot-1) (2026-10-06)
|
|
7
7
|
|
|
8
8
|
**Note:** Version bump only for package @instructure/ui-utils
|
|
9
9
|
|
package/lib/px.js
CHANGED
|
@@ -5,8 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
exports.px = px;
|
|
8
|
-
var
|
|
9
|
-
var _getFontSize = require("@instructure/ui-dom-utils/lib/getFontSize.js");
|
|
8
|
+
var _uiDomUtils = require("@instructure/ui-dom-utils");
|
|
10
9
|
var _parseUnit = require("./parseUnit.js");
|
|
11
10
|
/*
|
|
12
11
|
* The MIT License (MIT)
|
|
@@ -56,11 +55,11 @@ function px(val, el) {
|
|
|
56
55
|
}
|
|
57
56
|
const [num, unit] = (0, _parseUnit.parseUnit)(val);
|
|
58
57
|
if (unit === 'rem') {
|
|
59
|
-
return num * (0,
|
|
58
|
+
return num * (0, _uiDomUtils.getFontSize)();
|
|
60
59
|
} else if (unit === 'em') {
|
|
61
|
-
const doc =
|
|
60
|
+
const doc = _uiDomUtils.canUseDOM ? document.body : null;
|
|
62
61
|
const container = el || doc;
|
|
63
|
-
return num * (0,
|
|
62
|
+
return num * (0, _uiDomUtils.getFontSize)(container);
|
|
64
63
|
} else {
|
|
65
64
|
return num;
|
|
66
65
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-utils",
|
|
3
|
-
"version": "11.7.9-snapshot-
|
|
3
|
+
"version": "11.7.9-snapshot-1",
|
|
4
4
|
"description": "A collection of utilities for UI components",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"module": "./es/index.js",
|
|
@@ -20,13 +20,13 @@
|
|
|
20
20
|
"fast-deep-equal": "^3.1.3",
|
|
21
21
|
"json-stable-stringify": "^1.3.0",
|
|
22
22
|
"ua-parser-js": "^1.0.39",
|
|
23
|
-
"@instructure/console": "11.7.9-snapshot-
|
|
24
|
-
"@instructure/shared-types": "11.7.9-snapshot-
|
|
25
|
-
"@instructure/ui-dom-utils": "11.7.9-snapshot-
|
|
23
|
+
"@instructure/console": "11.7.9-snapshot-1",
|
|
24
|
+
"@instructure/shared-types": "11.7.9-snapshot-1",
|
|
25
|
+
"@instructure/ui-dom-utils": "11.7.9-snapshot-1"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"vitest": "^5.0.0",
|
|
29
|
-
"@instructure/ui-babel-preset": "11.7.9-snapshot-
|
|
29
|
+
"@instructure/ui-babel-preset": "11.7.9-snapshot-1"
|
|
30
30
|
},
|
|
31
31
|
"//dependency-comments": {
|
|
32
32
|
"ua-parser-js": "Do not upgrade to 2.x, it has a problematic license"
|