@instructure/ui-utils 8.56.5-pr-snapshot-1728655013879 → 8.56.5-pr-snapshot-1729507712924

Sign up to get free protection for your applications and to get access to all the features.
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
- ## [8.56.5-pr-snapshot-1728655013879](https://github.com/instructure/instructure-ui/compare/v8.56.4...v8.56.5-pr-snapshot-1728655013879) (2024-10-11)
6
+ ## [8.56.5-pr-snapshot-1729507712924](https://github.com/instructure/instructure-ui/compare/v8.56.4...v8.56.5-pr-snapshot-1729507712924) (2024-10-21)
7
7
 
8
8
  **Note:** Version bump only for package @instructure/ui-utils
9
9
 
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
 
3
3
  require("@testing-library/jest-dom");
4
- var _uiDomUtils = require("@instructure/ui-dom-utils");
4
+ var _getFontSize = require("@instructure/ui-dom-utils/lib/getFontSize.js");
5
5
  var _px = require("../px");
6
6
  /*
7
7
  * The MIT License (MIT)
@@ -41,11 +41,11 @@ describe('px', () => {
41
41
  expect((0, _px.px)('30px')).toEqual(30);
42
42
  });
43
43
  it('converts rem to px', () => {
44
- expect((0, _px.px)('50rem')).toEqual(50 * (0, _uiDomUtils.getFontSize)());
44
+ expect((0, _px.px)('50rem')).toEqual(50 * (0, _getFontSize.getFontSize)());
45
45
  });
46
46
  it('converts em to px', () => {
47
47
  node.style.fontSize = '24px';
48
- expect((0, _px.px)('10em', node)).toEqual(10 * (0, _uiDomUtils.getFontSize)(node));
48
+ expect((0, _px.px)('10em', node)).toEqual(10 * (0, _getFontSize.getFontSize)(node));
49
49
  });
50
50
  it('handles unitless input', () => {
51
51
  expect((0, _px.px)('4')).toEqual(4);
package/lib/px.js CHANGED
@@ -7,7 +7,8 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.default = void 0;
8
8
  exports.px = px;
9
9
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
10
- var _uiDomUtils = require("@instructure/ui-dom-utils");
10
+ var _canUseDOM = require("@instructure/ui-dom-utils/lib/canUseDOM.js");
11
+ var _getFontSize = require("@instructure/ui-dom-utils/lib/getFontSize.js");
11
12
  var _parseUnit3 = require("./parseUnit");
12
13
  /*
13
14
  * The MIT License (MIT)
@@ -60,11 +61,11 @@ function px(val, el) {
60
61
  num = _parseUnit2[0],
61
62
  unit = _parseUnit2[1];
62
63
  if (unit === 'rem') {
63
- return num * (0, _uiDomUtils.getFontSize)();
64
+ return num * (0, _getFontSize.getFontSize)();
64
65
  } else if (unit === 'em') {
65
- const doc = _uiDomUtils.canUseDOM ? document.body : null;
66
+ const doc = _canUseDOM.canUseDOM ? document.body : null;
66
67
  const container = el || doc;
67
- return num * (0, _uiDomUtils.getFontSize)(container);
68
+ return num * (0, _getFontSize.getFontSize)(container);
68
69
  } else {
69
70
  return num;
70
71
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-utils",
3
- "version": "8.56.5-pr-snapshot-1728655013879",
3
+ "version": "8.56.5-pr-snapshot-1729507712924",
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",
@@ -22,15 +22,15 @@
22
22
  },
23
23
  "license": "MIT",
24
24
  "devDependencies": {
25
- "@instructure/ui-babel-preset": "8.56.5-pr-snapshot-1728655013879",
25
+ "@instructure/ui-babel-preset": "8.56.5-pr-snapshot-1729507712924",
26
26
  "@testing-library/jest-dom": "^6.1.4",
27
27
  "@testing-library/react": "^14.1.2",
28
28
  "@types/json-stable-stringify": "^1.0.34"
29
29
  },
30
30
  "dependencies": {
31
31
  "@babel/runtime": "^7.23.2",
32
- "@instructure/console": "8.56.5-pr-snapshot-1728655013879",
33
- "@instructure/ui-dom-utils": "8.56.5-pr-snapshot-1728655013879",
32
+ "@instructure/console": "8.56.5-pr-snapshot-1729507712924",
33
+ "@instructure/ui-dom-utils": "8.56.5-pr-snapshot-1729507712924",
34
34
  "@types/ua-parser-js": "^0.7.37",
35
35
  "bowser": "^2.11.0",
36
36
  "fast-deep-equal": "^3.1.3",