Socket
Book a DemoInstallSign in
Socket

@evolv-delivery/verizon-design-system

Package Overview
Dependencies
Maintainers
0
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@evolv-delivery/verizon-design-system

A library of web components for rapid experiment development. Built to be compatible with the Verizon Design System 3.0

latest
Source
npmnpm
Version
0.5.0
Version published
Maintainers
0
Created
Source

Verizon Design System

A library of web components for experiments.

NPM scripts

ScriptDescription
npm run buildBuilds dist/../index.js files
npm run watchAutomatically builds on save of src/index.js
npm run serveHosts dist folder on port 8080
npm run devWatch and serve
npm run shipBuild and publish to npm
npm startSame as npm run dev

Using in a project

Verizon Design System components are automatically available anywhere the integration is active.

Local Hosting

Run npm start to host locally. To run in your browser inject the following into your <head> tag using Resource Override

(() => {
    if (window.self !== window.top) return;
    
    console.log('[evolv-local] verizon design system: inject')
    
    const script = document.createElement('script');
    script.type = 'module';
    script.text = 'import integration from "http://localhost:8080/index.js"; console.log("[evolv-local] verizon design system: load"); integration()';
    document.head.appendChild(script);
})();

Base Component

The core component from which all other components inherit. This gives the following properties to all components:

Properties

NameDescriptionDefaultAccepts
breakpointThe screensize to display tablet and desktop styles768px<css-size>
colorThe text color of the componentinheritinherit, <color-code>, <css-color>
cssA stylesheet to add to the component. Selectors are required, @media statements are valid.null<css-stylesheet>
surfaceWhether to style the component as if it's on a light or a dark backgroundlightlight, dark

Color Codes

OptionHex
black#000000
white#ffffff
red#ee0000
gray11#1b1d1f
gray20#333333
gray44#6f7171
gray65#a7a7a7
gray85#d8dada
gray95#f6f6f6

Example:

<evolv-title size="2xlarge" color="white">Buy more phones</evolv-title>

CSS Color

Any valid CSS color.

Example:

<evolv-icon name="trash-can" color="#ee0000" size="1.5rem"></evolv-icon>
<evolv-button-icon name="close" color="rgb(111, 11, 1)" size="large"></evolv-button-icon>

CSS Stylesheet

CSS to be injected into the style tag.

Example:

<evolv-button css=".button {background-color: var(--color-red); color: var(--color-gray-95)}">Button<>

Components

Accordion

Tag

<evolv-accordion title-size="medium">
  <evolv-accordion-item>
    <evolv-accordion-header>Aries</evolv-accordion-header>
    <evolv-accordion-details>It's going to be a regular day, nothing special.</evolv-accordion-details>
  </evolv-accordion-item>
  <evolv-accordion-item>
    <evolv-accordion-header>Taurus</evolv-accordion-header>
    <evolv-accordion-details>Yikes. It's not looking so good, maybe stay home.</evolv-accordion-details>
  </evolv-accordion-item>
  <evolv-accordion-item>
    <evolv-accordion-header>Gemini</evolv-accordion-header>
    <evolv-accordion-details>This is it, the day you've been waiting for! Wear your good shirt.</evolv-accordion-details>
  </evolv-accordion-item>
  <evolv-accordion-item>
    <evolv-accordion-header>Cancer</evolv-accordion-header>
    <evolv-accordion-details>Ominous winds blow from the east. Something nameless stirres from its ancient slumber. Highlight marital status.</evolv-accordion-details>
  </evolv-accordion-item>
</evolv-accordion>

Properties

NameDescriptionDefaultAccepts
disable-trackWhether to disable Adobe Target trackingfalsetrue, false
breakpointUsed by evolv-title and evolv-button-icon elements to increase size above a certain screen width768px<css length>
durationSets the animation duration for opening evolv-details panels0.33s<css duration>
handle-alignWhether the accordion handle is aligned left or rightleftleft, right
icon-sizeThe size of the evolv-button-icon element,Based on title-size if present, otherwise smallsmall, large
idA name for the accordion, used by data-track attributes and aria ids.accordion-<index><valid id>
open-firstSets the initial state of the first accordion item to openfalsetrue, false
paddingThe padding for evolv-accordion-header and evolv-accordion-details elements1.5rem<css length>
padding-tabletThe padding for evolv-accordion-header and evolv-accordion-details elements on screens over breakpoint in width2rem<css length>
title-sizeThe size of the evolv-title elements to usesmallsmall, medium, large
title-boldThe bold option for evolv-title elementsfalsetrue, false
title-colorThe color option for evolv-title elementsblackSee Properties
track-nameThe name to use for Adobe Target tracking on accordion headers. Priority is first given to track-name set on the header, followed by track-name set on the accordion itself. If neither are supplied then the track-name will be generated from the idnull
typesingle only allows one accordion item to be open at a time. multi allows multiple items open simultaneouslymultisingle, multi

Body

Tag

<evolv-body size="medium">Our phones are faster than ever, the fastest phones you've ever seen.</evolv-body>

<evolv-body size="large">Your price comes to:
  <evolv-body size="large" bold="true" primitive="span">
    29.99
  </evolv-body>
</evolv-body>

Properties

NameDescriptionDefaultAccepts
primitiveThe html tag to use for the text elementpp, span, <html-tag>
sizeEither <size> and proportionate style of the textsmallmicro, small, medium, large
strikethroughWhether to cross out textfalsetrue, false
Size:
sizefont-familyfont-sizeline-heightfont-weight
microVerizon-NHG-eTX0.6875rem1rem400
smallVerizon-NHG-eTX0.75rem1rem400
mediumVerizon-NHG-eDS0.875rem1.125rem400
largeVerizon-NHG-eDS1rem1.25rem400

Button

Tag

<evolv-button use="secondary" width="50%">Click here</evolv-button>

Class

window.evolv.vds.Button

Properties

NameDescriptionDefaultAccepts
displayChanges the display property of the button.flexflex, block, inline-block
sizeRenders the button in the correpsponding size.largelarge, small
text-colorThe color the text inside the button. If left blank sets automatically based on use and surfacenull<color-code>, <css-color>
useWhether the button face matches the color attribute (primary) or is transparent (secondary) button.primaryprimary, secondary
widthThe width for rendering the button.auto<number> or <css width>
disabledDisables button.falsetrue, false

ButtonIcon

Tag

<!-- Can use <evolv-icon> built in icons -->
<evolv-button-icon name="close"></evolv-button-icon>

<!-- Or use custom SVG by omitting the 'name' attribute -->
<evolv-button-icon>
  <svg width="28" height="28" viewBox="0 0 28 28">
    <!-- fill="currentColor" allows the SVG to inherit color the parent element -->
    <circle cx="14" cy="14" r="14" fill="currentColor" />
  </svg>
</evolv-button-icon>

Class

window.evolv.vds.ButtonIcon

Properties

NameDescriptionDefaultAccepts
nameThe name of the iconemptypencil, down-caret, right-arrow, trash-can, phone, phone-plan, phone-protection, info, close
sizeThe size of the iconsmallsmall, large Refer to Notes
titleThe title to be passed to the icon, visible to assistive technologies<name><string>

Notes

sizewidth and height
small1.25rem
large1.75rem

Icon

Tag

<evolv-icon name="trash-can" size="medium"></evolv-icon>

Class

window.evolv.vds.Icon

Properties

NameDescriptionDefaultAccepts
nameThe name of the icon, leave blank to supply svg icon as contentnullpencil, down-caret, right-arrow, trash-can, phone, phone-plan, phone-protection, info, close
colorThe text color of the iconinheritSee Properties
sizeThe font size of the icon, can be a preset size or any <css-size>smallsmall, medium, large, xlarge, <css-size> Refer to Notes
titleThe title to be passed to the icon, visible to assistive technologies<name><string>
typeWhether the icon size is standAlone, determined by the size attribute, or inline, inherited from text size of the parentstandAloneinline, standAlone

Notes

size only applies to icons with a type of standAlone.

sizewidth and height
small1rem
medium1.25rem
large1.5rem
xlarge1.75rem
<css-size><css-size>

Modal

Tag

const {html, render} = utils;

utils.app = {
  onClickProceed: (event) => console.log('Proceed'),
  onClickNoThanks: (event) => event.target.closest('evolv-modal').close(),
  openModal: () => document.body.insertAdjacentElement('beforeend', render(html`
    <evolv-modal>
      <evolv-modal-title>Special Offer</evolv-modal-title>
      <evolv-modal-body>10% off if you buy today</evolv-modal-body>
      <evolv-modal-footer>
        <evolv-button @click=${utils.app.onClickProceed}>Proceed</evolv-button>
        <evolv-button @click=${utils.app.onClickNoThanks}>No thanks</evolv-button>
      </evolv-modal-footer>
    <evolv-modal>`))
}

$mu('#productArea', 'product-area').inject(render(html`
  <evolv-button @click=${utils.app.openModal}>Open offer</evolv-button>
`), false).append()

Tag

<evolv-text-link href="/target/url/" size="small" type="standAlone">Link</evolv-text-link>

Class

window.evolv.vds.TextLink

Properties

NameDescriptionDefaultAccepts
typeDetermines display layout of TextLink.inlineinline, standAlone
sizeRenders TextLink in corresponding size. Requires type="standAlone" to be set.largesmall, large, See Notes

Notes

sizefont-size
small0.75rem
large1rem

Tooltip

Released in version 0.4.0

Tag

<evolv-tooltip content-title="Lorem ipusum">Nulla facilis eos dolorem totam est explicabo fuga. Cum magnam laudantium et itaque rerum sit. Amet laudantium nesciunt consequuntur nam accusamus odit. Sequi rerum et optio et aspernatur quam. Dolores nobis quos suscipit. Aut fugiat ipsam praesentium aliquid ut minima exercitationem illum. Natus explicabo rerum fugit in. Ut voluptatem nemo et. Nobis rem ut repellendus consectetur velit. Consequatur est aperiam praesentium illo facilis. Unde voluptas cumque et aliquid neque autem vel nam. Sit rerum aspernatur minima. Aut sequi vitae et natus est voluptas necessitatibus.</evolv-tooltip>

Properties

NameDescriptionDefaultAccepts
sizeRenders the tooltip in the correpsponding size. Requires type to be standAlone. Coming soon!largelarge, small
content-max-heightThe maximum height of the tooltip content
content-titleA title to be displayed above the tooltip content<string>
typeWhether the tooltip button is inline, inherited from the text size of the parent, or standAlone, determined by the size attributeinlineinline, standAlone

Title

Tag

<evolv-title bold="true">Bold small title</evolv-title>
<evolv-title size="medium" breakpoint="950px" primitive="h4">Medium title</evolv-title>

Class

window.evolv.vds.Title

Properties

NameDescriptionDefaultAccepts
colorThe text color of the titleinheritSee Properties
boldThe weight of the titlefalsetrue, false
sizeThe font size of the titlesmallxsmall, small, medium, large, xlarge, 2xlarge
primitiveThe base element for the titleAssigned based size See noteh1, h2, h3, h4, h5, h6, p, span
breakpointThe screen width at which to transition to a larger font size768px<css width>

Notes

The primitive attribute, if left blank, is assigned a default heading tag corresponding to its size:

sizeprimitive
xsmallh4
smallh3
mediumh2
largeh2
xlargeh1
2xlargeh1

FAQs

Package last updated on 06 Jan 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts