Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@instructure/ui-utils

Package Overview
Dependencies
Maintainers
32
Versions
2049
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@instructure/ui-utils - npm Package Compare versions

Comparing version 8.56.4 to 8.56.5-pr-snapshot-1728655013879

8

CHANGELOG.md

@@ -6,2 +6,10 @@ # Change Log

## [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)
**Note:** Version bump only for package @instructure/ui-utils
## [8.56.4](https://github.com/instructure/instructure-ui/compare/v8.56.3...v8.56.4) (2024-10-02)

@@ -8,0 +16,0 @@

6

lib/__new-tests__/px.test.js
"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.4",
"version": "8.56.5-pr-snapshot-1728655013879",
"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.4",
"@instructure/ui-babel-preset": "8.56.5-pr-snapshot-1728655013879",
"@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.4",
"@instructure/ui-dom-utils": "8.56.4",
"@instructure/console": "8.56.5-pr-snapshot-1728655013879",
"@instructure/ui-dom-utils": "8.56.5-pr-snapshot-1728655013879",
"@types/ua-parser-js": "^0.7.37",

@@ -37,0 +37,0 @@ "bowser": "^2.11.0",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc