Artsy's Design System
- Storybook: https://palette-storybook.artsy.net
Docs: https://palette.artsy.net(Deprecated: Documentation will be moved to Storybook to have a single source of truth.)- Point People: @dzucconi, @damassi
Palette is a collection of primitive, product-agnostic elements that help encapsulate Artsy's look and feel at base level. This project is intended to be used across our digital product portfolio.
If the component applies to Artsy as a brand and can/will be used across multiple digital products, then Palette is a great place for it. If it's highly product specific then it's best to leave the component where it's used. We can always move things later!
If you'd like to add a new component to Palette please raise the need in our #design-system Slack channel.
When adding new components, you'll need to create corresponding Storybook stories. Follow these conventions:
- Place the story file in the same directory as the component, e.g.
src/elements/Button/Button.story.tsx - Use PascalCase for the filename, matching the component name
Each story file should include:
import React from "react";
import { MyComponent } from "./MyComponent";
import { STORYBOOK_PROPS_BLOCKLIST } from "../../utils/storybookBlocklist";
export default {
component: MyComponent,
title: "Components/MyComponent",
tags: ["autodocs"],
parameters: {
docs: {
description: {
component: "A short description of what this component does.",
},
},
controls: {
exclude: STORYBOOK_PROPS_BLOCKLIST,
},
},
};
export const Default = {
args: {
// default props
},
parameters: {
docs: {
description: {
story: "A short description of this story variant.",
},
},
},
};- Always add autodocs: Include
tags: ["autodocs"]and component description - Use the blocklist: Add
controls: { exclude: STORYBOOK_PROPS_BLOCKLIST } - Separate stories for each variant: Don't use the
Stateshelper - create individual story exports - Use the
argsformat: Define props using theargsproperty for better autodocs integration - Add story descriptions: Include
docs.description.storyfor each story to explain its purpose
For a complete guide, see packages/palette/claude.md.
In the project root run the following:
$ yarn lerna bootstrap
$ yarn storybookThis will compile Palette and boot Storybooks, our default development environment. New components require stories.
Other relevant commands are:
$ yarn test
$ yarn type-checkWhen developing new components in Palette, it's often useful to test those components in consuming apps (such as Force). However, due to the poor support for symlinks, this can be difficult. Enter yalc. Yalc is a mini package manager that one can publish to and install from, which makes it easy to test code in realtime from outside of your app.
Note: @artsy/palette uses Storybooks for developing features; work there first! Then, when ready (and if necessary), test your code locally using the flow described below. You can also publish npm canary releases from the palette repo by attaching a
canarylabel to your PR.
- Install
yalcglobally:
yarn global add yalc- Navigate to
palettein the terminal and start the watcher:
cd palette/packages/palette
yarn local-palette-dev- Navigate back to Force and link:
cd force
yarn local-palette-dev
yarn startThis will update package.json to point at the yalc-published version of palette.
- When done developing your local palette feature, be sure to unlink:
yarn local-palette-dev:stopFor more info, check out our development guide in the docs.
Palette uses auto-release to automatically release on every PR. Every PR should have a label that matches one of the following
- Version: Trivial
- Version: Patch
- Version: Minor
- Version: Major
- Canary
Major, minor, and patch will cause a new release to be generated. Use major for breaking changes, minor for new non-breaking features, and patch for bug fixes. Trivial will not cause a release and should be used when updating documentation or non-project code.
If you don't want to release on a particular PR but the changes aren't trivial then use the Skip Release tag along side the appropriate version tag.
Canary tags will publish a canary version to NPM which can be used to test work in progress. See the CircleCI job for the exact version published and update your consuming app accordingly.
This project is the work of designers and engineers at Artsy, the world's leading and largest online art marketplace and platform for discovering art. One of our core Engineering Principles is being Open Source by Default which means we strive to share as many details of our work as possible.
You can learn more about this work from our blog and by following @ArtsyOpenSource or explore our public data by checking out our API. If you're interested in a career at Artsy, read through our job postings!