Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
@teamleader/ahoy
Advanced tools
Ahoy is a set of React components that implement the Teamleader design specification.
Ahoy can be installed as an npm package:
$ npm install --save @teamleader/ahoy
or
$ yarn install @teamleader/ahoy
In this minimal example, we import a Button
with styles already bundled:
import React from 'react';
import ReactDOM from 'react-dom';
import { Button } from '@teamleader/ahoy';
ReactDOM.render(<Button label="Hello World!" />, document.getElementById('app'));
Import the CSS into your project via JS or CSS.
JS
import '@teamleader/ahoy/es/index.css';
or CSS
@import url('@teamleader/ahoy/es/index.css');
The colors of the Ahoy system are:
For each color there are 5 tints.
The available color variables are
--color-aqua-lightest
--color-aqua-light
--color-aqua
--color-aqua-dark
--color-aqua-darkest
--color-gold-lightest
--color-gold-light
--color-gold
--color-gold-dark
--color-gold-darkest
--color-neutral-lightest
--color-neutral-light
--color-neutral
--color-neutral-dark
--color-neutral-darkest
--color-mint-lightest
--color-mint-light
--color-mint
--color-mint-dark
--color-mint-darkest
--color-ruby-lightest
--color-ruby-light
--color-ruby
--color-ruby-dark
--color-ruby-darkest
--color-teal-lightest
--color-teal-light
--color-teal
--color-teal-dark
--color-teal-darkest
--color-violet-lightest
--color-violet-light
--color-violet
--color-violet-dark
--color-violet-darkest
--color-black
--color-white
The colors are defined as hsl values. For each color the h, s an l value are also available as separate variables. There is also a variable that has the hsl values combined. This way you can do color calculations on them with native css (instead of using postcss-color plugin for example). Some examples:
lighten(12%)
hsl(var(--color-ruby-hsl-h), var(--color-ruby-hsl-s), calc(var(--color-ruby-hsl-l) - 12%))
tint(64%)
hsl(var(--color-ruby-h), var(--color-ruby-s), calc(var(--color-ruby-l) * 1.64))
alpha(12%)
hsl(var(--color-ruby-hsl) / 12%)
import { COLOR, COLORS, TINTS, colorsWithout, tintsWithout } from '@teamleader/ahoy';
COLOR
: an object that contains the colors as hex values (e.g. COLOR.MINT.DARKEST
).
COLORS
: an array with the color names (['aqua', 'gold', 'neutral', 'mint', 'ruby', 'teal', 'violet']
).
TINTS
: an array with the tint names (['lightest', 'light', 'normal', 'dark', 'darkest']
).
colorsWithout
: a function to get an array of colors without a given array of colors (colorsWithout(['neutral', 'violet])
)
tintsWithout
: a function to get an array of tints without a given array of tints (tintsWithout(['light', 'lightest])
)
This library officially supports the last two versions of the major browsers. This is mainly because of dependencies and ease of mind.
This project is licensed under the terms of the MIT license.
FAQs
Teamleader's Ahoy design system
The npm package @teamleader/ahoy receives a total of 163 weekly downloads. As such, @teamleader/ahoy popularity was classified as not popular.
We found that @teamleader/ahoy demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.