All Projects → jwplayer → jw-design-library

jwplayer / jw-design-library

Licence: other
A library of product design patterns comprised of code, usage and guidelines.

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to jw-design-library

ui-ux
The learning guide contains the Basics, Intermediate and Advance resources for User Interface and User Experience Design
Stars: ✭ 187 (+1068.75%)
Mutual labels:  design-patterns, design-system
Daisyui
⭐️ ⭐️ ⭐️ ⭐️ ⭐️  Tailwind Components
Stars: ✭ 382 (+2287.5%)
Mutual labels:  design-patterns, design-system
design-system
British Columbia Government Design System for Digital Services
Stars: ✭ 33 (+106.25%)
Mutual labels:  design-patterns, design-system
System Design And Architecture
Learn how to design large-scale systems. Prep for the system design interview.
Stars: ✭ 1,005 (+6181.25%)
Mutual labels:  design-patterns, design-system
System Design Primer
Learn how to design large-scale systems. Prep for the system design interview. Includes Anki flashcards.
Stars: ✭ 154,659 (+966518.75%)
Mutual labels:  design-patterns, design-system
data sciences campaign
【数据科学家系列课程】
Stars: ✭ 91 (+468.75%)
Mutual labels:  product-design, design-patterns
spark-design-system
Spark Design System
Stars: ✭ 101 (+531.25%)
Mutual labels:  design-patterns, design-system
Calcite Components
Web Components for the Calcite Design System. Built with Stencil JS. Currently in Beta!
Stars: ✭ 96 (+500%)
Mutual labels:  design-patterns, design-system
Awesome Design Systems
A curated list of bookmarks, resources and articles about design systems focused on developers.
Stars: ✭ 222 (+1287.5%)
Mutual labels:  design-patterns, design-system
moon-design
Moon Design System for React
Stars: ✭ 209 (+1206.25%)
Mutual labels:  design-patterns, design-system
react-uswds
USWDS 3.0 components built in React
Stars: ✭ 108 (+575%)
Mutual labels:  design-patterns, design-system
betterdocs
📚 Web version of https://github.com/khusnetdinov/ruby.fundamental repo - Fundamental programming with ruby examples and references. It covers threads, SOLID principles, design patterns, data structures, algorithms. Books for reading.
Stars: ✭ 25 (+56.25%)
Mutual labels:  design-patterns
CodeSignal-Practice Solutions
No description or website provided.
Stars: ✭ 28 (+75%)
Mutual labels:  design-system
uml-diagram-for-kotlin-design-pattern-examples
UML diagram list of GoF design pattern examples written in Kotlin.
Stars: ✭ 23 (+43.75%)
Mutual labels:  design-patterns
notes
My personal tutorials and notes.
Stars: ✭ 34 (+112.5%)
Mutual labels:  design-patterns
HeadFirstDesignPatternsSwift
An implementation of examples from "Head First Design Patterns", written in Swift.
Stars: ✭ 20 (+25%)
Mutual labels:  design-patterns
Java-design-patterns
Java Design patterns.
Stars: ✭ 49 (+206.25%)
Mutual labels:  design-patterns
windicss-analysis
🔍 A visual analyzer for Windi CSS
Stars: ✭ 120 (+650%)
Mutual labels:  design-system
Design-Patterns-In-Swift-CN
设计模式(Swift 5.0 实现)- 中文版
Stars: ✭ 290 (+1712.5%)
Mutual labels:  design-patterns
design-patterns-cpp14
🙏 Design patterns implemented in C++14
Stars: ✭ 35 (+118.75%)
Mutual labels:  design-patterns

JW Design Library (Hook)

owners contributors

Design library for colors, icons & styles used in JW Player products. Built with Amazon Style Dictionary.

For visual docs, check out Neverland Design System

Development

Ensure you're using Node v16 and run:

yarn install

Adding Icons

  1. Create a feature branch from master
  2. Pull in any new SVG files into the dictionary/assets folder
  3. In /dictionary/properties, locate the yaml config of choice and add new names/values in accordance with file structure
  4. Run yarn build. If the build succeeds, you should see your changes in the /dist folder.
  5. Bump the version # accordingly to align with semantic versioning
  6. Open a PR against master

Releasing

To release Hook, we need to publish it to NPM.

  1. Set your local npm config to the internal registry
  2. Checkout master and pull in the latest: git checkout master && git pull
  3. Ensure that your local /dist folder and version # are correct
  4. Run npm publish
  5. @design/jw-design-library will reflect the new version here
  6. Draft a release with a changelog of updates and 💥 breaking changes

Usage

Everything you'll need exists in Hook's /dist folder. Style variables are available in pure CSS, SCSS, and Less.

Install in your project

Set your npm config to the JW Player NPM registry and run:

yarn add @design/jw-design-library

Colors

Import the color variables and apply them in your stylesheet like this:

@import (reference) "@design/jw-design-library/dist/scss/brand-colors.scss";

p {
    color: $ds-color-brand-midnight;
}

Fonts

To use our fonts, reference the CDN route in your HTML document <head>:

<link href="https://hook.jwplayer.com/jw-design-library/5.3.0/css/fonts.css" rel="stylesheet" />

Then import the variables and apply the font-family and font-weight as needed:

@import '@design/jw-design-library/dist/scss/fonts.scss';

p {
    font-family: $ds-global-font-family-custom;
    font-weight: $ds-global-font-weight-custom-semibold;
}

code, pre {
    font-family: $ds-global-font-family-code;
}

Icons

We recommend using our WUI components if possible, but you can also import the SVGs individually.

In a create-react-app project, for example:

import React from 'react';
import { ReactComponent as DownloadIcon } from '@design/jw-design-library/dist/icon/dashboard/download.svg';

const App = () => {
  return (
    <div className="App">
      <DownloadIcon />
    </div>
  );
}
export default App;

If you prefer working with a sprite, you can import the sprite from /dist/sprites or download it directly from the Neverland docs.

<svg>
  <use href="/path_to_hook/icons/sprite_name.svg#icon_name"></use>
</svg>

Under the Hood

The file build.js imports various modules from scripts/ to build the full style-dictionary config. Here's a really quick rundown:

  • formatters/svg-sprite runs each matched icon through SVGO, then converts the SVG into a <symbol>. After all icons in the group are optimized, a wrapper is added and the SVG file is output.

  • formatters/font-face uses the structure found in font-face.yaml to output @font-face declarations in CSS. All font files referenced in the dictionary are copied to dist/fonts. If you use fonts.css then you must copy or resolve the paths for the font files, or things won't work!

  • transformers/content-array-to-list: Converts property values into comma-separated lists. This is used to output data colors for Less.

    prop:
      value:
      - '#000000'
      - '#CCCCCC'
      - '#FFFFFF'

    The example above has this final output:

    @prop: #000000, #cccccc, #ffffff;
  • transformers/content-list-to-js-array: Converts property values into bracketed arrays. This, combined with content-array-to-list, is used to output data colors for JS. The example above has this final output:

    export const prop = ["#000000","#cccccc","#ffffff"];
  • transform-groups/less-transform-group: Overrides the built-in less transformGroup, to add content/arrayList and switch to color/css for rgba output.

  • transform-groups/js-transform-group: Overrides the built-in js transformGroup, to add content/arrayToList and content/listToJsArray.

  • utils/mock-require: Rather than rewrite the combineJSON function present in style-dictionary, we intercept the require call itself to render YAML with js-yaml when necessary. This may change if combineJSON ever changes.

  • utils/svgo: Since SVGO is asynchronous by design, we use a wrapper module with sync-rpc to treat it as if it's synchronous. You may notice the dots when icons are being built - each dot represents a sprite that has been "synchronously" optimized by SVGO.

Related Links

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].