@instructure/ui-utils
Advanced tools
Comparing version 8.56.5-pr-snapshot-1729507712924 to 8.56.5-pr-snapshot-1729546148514
@@ -6,3 +6,3 @@ # Change Log | ||
## [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) | ||
## [8.56.5-pr-snapshot-1729546148514](https://github.com/instructure/instructure-ui/compare/v8.56.4...v8.56.5-pr-snapshot-1729546148514) (2024-10-21) | ||
@@ -9,0 +9,0 @@ **Note:** Version bump only for package @instructure/ui-utils |
"use strict"; | ||
require("@testing-library/jest-dom"); | ||
var _getFontSize = require("@instructure/ui-dom-utils/lib/getFontSize.js"); | ||
var _uiDomUtils = require("@instructure/ui-dom-utils"); | ||
var _px = require("../px"); | ||
@@ -44,7 +44,7 @@ /* | ||
it('converts rem to px', () => { | ||
expect((0, _px.px)('50rem')).toEqual(50 * (0, _getFontSize.getFontSize)()); | ||
expect((0, _px.px)('50rem')).toEqual(50 * (0, _uiDomUtils.getFontSize)()); | ||
}); | ||
it('converts em to px', () => { | ||
node.style.fontSize = '24px'; | ||
expect((0, _px.px)('10em', node)).toEqual(10 * (0, _getFontSize.getFontSize)(node)); | ||
expect((0, _px.px)('10em', node)).toEqual(10 * (0, _uiDomUtils.getFontSize)(node)); | ||
}); | ||
@@ -51,0 +51,0 @@ it('handles unitless input', () => { |
@@ -10,4 +10,3 @@ "use strict"; | ||
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray")); | ||
var _canUseDOM = require("@instructure/ui-dom-utils/lib/canUseDOM.js"); | ||
var _getFontSize = require("@instructure/ui-dom-utils/lib/getFontSize.js"); | ||
var _uiDomUtils = require("@instructure/ui-dom-utils"); | ||
var _parseUnit3 = require("./parseUnit"); | ||
@@ -65,7 +64,7 @@ /* | ||
if (unit === 'rem') { | ||
return num * (0, _getFontSize.getFontSize)(); | ||
return num * (0, _uiDomUtils.getFontSize)(); | ||
} else if (unit === 'em') { | ||
const doc = _canUseDOM.canUseDOM ? document.body : null; | ||
const doc = _uiDomUtils.canUseDOM ? document.body : null; | ||
const container = el || doc; | ||
return num * (0, _getFontSize.getFontSize)(container); | ||
return num * (0, _uiDomUtils.getFontSize)(container); | ||
} else { | ||
@@ -72,0 +71,0 @@ return num; |
{ | ||
"name": "@instructure/ui-utils", | ||
"version": "8.56.5-pr-snapshot-1729507712924", | ||
"version": "8.56.5-pr-snapshot-1729546148514", | ||
"description": "A collection of utilities for UI components", | ||
@@ -25,3 +25,3 @@ "author": "Instructure, Inc. Engineering and Product Design", | ||
"devDependencies": { | ||
"@instructure/ui-babel-preset": "8.56.5-pr-snapshot-1729507712924", | ||
"@instructure/ui-babel-preset": "8.56.5-pr-snapshot-1729546148514", | ||
"@testing-library/jest-dom": "^6.1.4", | ||
@@ -33,4 +33,4 @@ "@testing-library/react": "^14.1.2", | ||
"@babel/runtime": "^7.23.2", | ||
"@instructure/console": "8.56.5-pr-snapshot-1729507712924", | ||
"@instructure/ui-dom-utils": "8.56.5-pr-snapshot-1729507712924", | ||
"@instructure/console": "8.56.5-pr-snapshot-1729546148514", | ||
"@instructure/ui-dom-utils": "8.56.5-pr-snapshot-1729546148514", | ||
"@types/ua-parser-js": "^0.7.37", | ||
@@ -37,0 +37,0 @@ "bowser": "^2.11.0", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
397592
6837
+ Added@instructure/console@8.56.5-pr-snapshot-1729546148514(transitive)
+ Added@instructure/shared-types@8.56.5-pr-snapshot-1729546148514(transitive)
+ Added@instructure/ui-dom-utils@8.56.5-pr-snapshot-1729546148514(transitive)
- Removed@instructure/console@8.56.5-pr-snapshot-1729507712924(transitive)
- Removed@instructure/shared-types@8.56.5-pr-snapshot-1729507712924(transitive)
- Removed@instructure/ui-dom-utils@8.56.5-pr-snapshot-1729507712924(transitive)
Updated@instructure/console@8.56.5-pr-snapshot-1729546148514
Updated@instructure/ui-dom-utils@8.56.5-pr-snapshot-1729546148514