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

terra-heading

Package Overview
Dependencies
Maintainers
7
Versions
124
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

terra-heading - npm Package Compare versions

Comparing version 4.54.0 to 4.55.0

5

CHANGELOG.md

@@ -5,2 +5,7 @@ # Changelog

## 4.55.0 - (February 15, 2024)
* Changed
* Minor dependency version bump.
## 4.54.0 - (November 13, 2023)

@@ -7,0 +12,0 @@

4

lib/Heading.js

@@ -18,4 +18,4 @@ "use strict";

function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }

@@ -22,0 +22,0 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }

{
"name": "terra-heading",
"version": "4.54.0",
"version": "4.55.0",
"description": "Terra includes styling for all standard headings `h1` through `h6`, as well as styles that match the size of their respective heading.",

@@ -28,3 +28,3 @@ "author": "Cerner Corporation",

"prop-types": "^15.5.8",
"terra-arrange": "^3.55.0"
"terra-arrange": "^3.56.0"
},

@@ -48,3 +48,3 @@ "peerDependencies": {

},
"gitHead": "1be8c98fe2eeec64ef7a7fa457dd708da88e5170"
"gitHead": "31ec38baf909fed741b41a204f7fa28884ab327e"
}

@@ -7,3 +7,3 @@ import React from 'react';

it('should render a heading component', () => {
const heading = shallow(<Heading level={1}>Test</Heading>);
const heading = enzyme.shallow(<Heading level={1}>Test</Heading>);
expect(heading).toMatchSnapshot();

@@ -13,3 +13,3 @@ });

it('should render a heading component with isItalic prop set', () => {
const heading = shallow(<Heading level={1} isItalic>Test</Heading>);
const heading = enzyme.shallow(<Heading level={1} isItalic>Test</Heading>);
expect(heading).toMatchSnapshot();

@@ -19,3 +19,3 @@ });

it('should render a heading component with isVisuallyHidden prop set', () => {
const heading = shallow(<Heading level={1} isVisuallyHidden>Test</Heading>);
const heading = enzyme.shallow(<Heading level={1} isVisuallyHidden>Test</Heading>);
expect(heading).toMatchSnapshot();

@@ -25,3 +25,3 @@ });

it('should render a heading component with size prop set', () => {
const heading = shallow(<Heading level={1} size="large">Test</Heading>);
const heading = enzyme.shallow(<Heading level={1} size="large">Test</Heading>);
expect(heading).toMatchSnapshot();

@@ -31,3 +31,3 @@ });

it('should render a heading component with weight prop set', () => {
const heading = shallow(<Heading level={1} weight={200}>Test</Heading>);
const heading = enzyme.shallow(<Heading level={1} weight={200}>Test</Heading>);
expect(heading).toMatchSnapshot();

@@ -37,3 +37,3 @@ });

it('should support rendering a string as children', () => {
const heading = shallow(<Heading level={1}>String</Heading>);
const heading = enzyme.shallow(<Heading level={1}>String</Heading>);
expect(heading).toMatchSnapshot();

@@ -43,3 +43,3 @@ });

it('should support rendering an element as children', () => {
const heading = shallow(<Heading level={1}><span>Element</span></Heading>);
const heading = enzyme.shallow(<Heading level={1}><span>Element</span></Heading>);
expect(heading).toMatchSnapshot();

@@ -50,3 +50,3 @@ });

/* eslint-disable comma-dangle */
const heading = shallow(
const heading = enzyme.shallow(
<Heading level={1}>

@@ -64,3 +64,3 @@ <span>Element 1</span>

it('should have all props including customProps set correctly', () => {
const heading = shallow(<Heading level={1} id="id" size="small" weight={200} colorClass="TestClass" isItalic isVisuallyHidden>All props and custom attrs</Heading>);
const heading = enzyme.shallow(<Heading level={1} id="id" size="small" weight={200} colorClass="TestClass" isItalic isVisuallyHidden>All props and custom attrs</Heading>);
expect(heading).toMatchSnapshot();

@@ -71,3 +71,3 @@ });

it('should merge classes passed in with attributes', () => {
const heading = shallow(<Heading level={1} className="TestClass">Test</Heading>);
const heading = enzyme.shallow(<Heading level={1} className="TestClass">Test</Heading>);
expect(heading.prop('className')).toContain('TestClass');

@@ -77,3 +77,3 @@ });

it('should merge ids passed in with attributes', () => {
const heading = shallow(<Heading level={1} id="TestId">Test</Heading>);
const heading = enzyme.shallow(<Heading level={1} id="TestId">Test</Heading>);
expect(heading.prop('id')).toContain('TestId');

@@ -83,3 +83,3 @@ });

it('should append data passed in with attributes', () => {
const heading = shallow(<Heading level={1} data-terra-text-mock="MockData">Test</Heading>);
const heading = enzyme.shallow(<Heading level={1} data-terra-text-mock="MockData">Test</Heading>);
expect(heading.prop('data-terra-text-mock')).toContain('MockData');

@@ -90,3 +90,3 @@ });

/* eslint-disable react/forbid-component-props */
const heading = shallow(<Heading level={1} style={{ height: '100px' }}>Test</Heading>);
const heading = enzyme.shallow(<Heading level={1} style={{ height: '100px' }}>Test</Heading>);
expect(heading.prop('style')).toEqual({ height: '100px' });

@@ -99,3 +99,3 @@ /* eslint-disable react/forbid-component-props */

try {
shallow(<Heading level={1} />);
enzyme.shallow(<Heading level={1} />);
} catch (e) {

@@ -108,3 +108,3 @@ expect(e.message).toContain('The prop `children` is marked as required');

try {
shallow(<Heading>Test</Heading>);
enzyme.shallow(<Heading>Test</Heading>);
} catch (e) {

@@ -111,0 +111,0 @@ expect(e.message).toContain('The prop `level` is marked as required');

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