@pushengineering/umg-web-components 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/css-tag.js +56 -0
- package/dist/node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/decorators/base.js +9 -0
- package/dist/node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/decorators/custom-element.js +13 -0
- package/dist/node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/decorators/property.js +37 -0
- package/dist/node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/decorators/query-assigned-elements.js +19 -0
- package/dist/node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/decorators/query.js +34 -0
- package/dist/node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/decorators/state.js +12 -0
- package/dist/node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/reactive-element.js +260 -0
- package/dist/node_modules/.pnpm/lit-element@4.0.4/node_modules/lit-element/lit-element.js +50 -0
- package/dist/node_modules/.pnpm/lit-html@3.1.2/node_modules/lit-html/directive.js +27 -0
- package/dist/node_modules/.pnpm/lit-html@3.1.2/node_modules/lit-html/directives/class-map.js +37 -0
- package/dist/node_modules/.pnpm/lit-html@3.1.2/node_modules/lit-html/directives/if-defined.js +10 -0
- package/dist/node_modules/.pnpm/lit-html@3.1.2/node_modules/lit-html/directives/map.js +15 -0
- package/dist/node_modules/.pnpm/lit-html@3.1.2/node_modules/lit-html/directives/range.js +14 -0
- package/dist/node_modules/.pnpm/lit-html@3.1.2/node_modules/lit-html/directives/style-map.js +39 -0
- package/dist/node_modules/.pnpm/lit-html@3.1.2/node_modules/lit-html/lit-html.js +259 -0
- package/dist/packages/web-components/classes/event-manager/event-manager.js +50 -0
- package/dist/packages/web-components/classes/index.js +4 -0
- package/dist/packages/web-components/components/badge/badge.js +146 -0
- package/dist/packages/web-components/components/banner/banner.js +389 -0
- package/dist/packages/web-components/components/banner-image/banner-image.js +161 -0
- package/dist/packages/web-components/components/box/box.js +208 -0
- package/dist/packages/web-components/components/button/button.js +336 -0
- package/dist/packages/web-components/components/button-group/button-group.js +98 -0
- package/dist/packages/web-components/components/button-icon/button-icon.js +246 -0
- package/dist/packages/web-components/components/caption-card/caption-card.js +331 -0
- package/dist/packages/web-components/components/deferred-media/deferred-media.js +212 -0
- package/dist/packages/web-components/components/disclosure/disclosure.js +255 -0
- package/dist/packages/web-components/components/event-table/event-content.js +106 -0
- package/dist/packages/web-components/components/event-table/event-date.js +45 -0
- package/dist/packages/web-components/components/event-table/event-table.js +74 -0
- package/dist/packages/web-components/components/event-table/event.js +45 -0
- package/dist/packages/web-components/components/footer/footer.js +153 -0
- package/dist/packages/web-components/components/grid/grid-cell.js +40 -0
- package/dist/packages/web-components/components/grid/grid.js +106 -0
- package/dist/packages/web-components/components/header/header.js +368 -0
- package/dist/packages/web-components/components/header-drawer/header-drawer.js +292 -0
- package/dist/packages/web-components/components/header-drawer/menu-drawer.js +176 -0
- package/dist/packages/web-components/components/horizontal-stack/horizontal-stack.js +93 -0
- package/dist/packages/web-components/components/icon/icon.js +81 -0
- package/dist/packages/web-components/components/icon/icons.svg.js +191 -0
- package/dist/packages/web-components/components/image/image.js +157 -0
- package/dist/packages/web-components/components/index.js +82 -0
- package/dist/packages/web-components/components/link/link.js +95 -0
- package/dist/packages/web-components/components/link-group/link-group.js +126 -0
- package/dist/packages/web-components/components/logo/logo.js +161 -0
- package/dist/packages/web-components/components/media-gallery/media-gallery.js +82 -0
- package/dist/packages/web-components/components/media-gallery/media.js +31 -0
- package/dist/packages/web-components/components/media-text/media-text.js +276 -0
- package/dist/packages/web-components/components/media-text/styles/media-size.js +119 -0
- package/dist/packages/web-components/components/menu/menu.js +328 -0
- package/dist/packages/web-components/components/modal/modal.js +143 -0
- package/dist/packages/web-components/components/number-field/number-field.js +339 -0
- package/dist/packages/web-components/components/overlay/overlay.js +77 -0
- package/dist/packages/web-components/components/page/page.js +105 -0
- package/dist/packages/web-components/components/popover/popover.js +163 -0
- package/dist/packages/web-components/components/rich-text/rich-text.js +126 -0
- package/dist/packages/web-components/components/section/section.js +400 -0
- package/dist/packages/web-components/components/select/select.js +359 -0
- package/dist/packages/web-components/components/slider/slide.js +68 -0
- package/dist/packages/web-components/components/slider/slider-controls.js +258 -0
- package/dist/packages/web-components/components/slider/slider.js +374 -0
- package/dist/packages/web-components/components/slider/styles/controls.js +98 -0
- package/dist/packages/web-components/components/slider/styles/slider.js +233 -0
- package/dist/packages/web-components/components/socials/socials.js +96 -0
- package/dist/packages/web-components/components/table/table.js +158 -0
- package/dist/packages/web-components/components/text/text.js +245 -0
- package/dist/packages/web-components/components/text-field/text-field.js +257 -0
- package/dist/packages/web-components/components/thumbnail-slider/thumbnail-slide.js +51 -0
- package/dist/packages/web-components/components/thumbnail-slider/thumbnail-slider.js +88 -0
- package/dist/packages/web-components/components/vertical-stack/vertical-stack.js +95 -0
- package/dist/packages/web-components/components/video/video.js +185 -0
- package/dist/packages/web-components/scripts/mergeStyles.js +8 -0
- package/dist/packages/web-components/scripts/polyfills/scrollyfills.js +43 -0
- package/dist/packages/web-components/scripts/settings.js +7 -0
- package/dist/packages/web-components/scripts/themeStyleSheet.js +9 -0
- package/dist/packages/web-components/scripts/utilities/debounce.js +9 -0
- package/dist/packages/web-components/scripts/utilities/paddingTransformations.js +46 -0
- package/dist/packages/web-components/styles/button.js +55 -0
- package/dist/packages/web-components/styles/fonts.js +181 -0
- package/dist/packages/web-components/styles/global.js +40 -0
- package/dist/packages/web-components/styles/grid.js +114 -0
- package/dist/packages/web-components/styles/group.js +121 -0
- package/dist/packages/web-components/styles/icon-size.js +19 -0
- package/dist/packages/web-components/styles/link.js +30 -0
- package/dist/packages/web-components/styles/placeholder-media.js +27 -0
- package/package.json +92 -0
- package/readme.md +266 -0
package/readme.md
ADDED
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
# Table of Contents
|
|
2
|
+
|
|
3
|
+
- [Table of Contents](#table-of-contents)
|
|
4
|
+
- [UMG UX Components Library README](#umg-ux-components-library-readme)
|
|
5
|
+
- [Learn More about Web Components](#learn-more-about-web-components)
|
|
6
|
+
- [Local Development Environment](#local-development-environment)
|
|
7
|
+
- [Prerequisites](#prerequisites)
|
|
8
|
+
- [Installation](#installation)
|
|
9
|
+
- [Build scripts](#build-scripts)
|
|
10
|
+
- [Lit - Lightning-Fast Components](#lit---lightning-fast-components)
|
|
11
|
+
- [Storybook Integration for Component Previews and Documentation](#storybook-integration-for-component-previews-and-documentation)
|
|
12
|
+
- [Integrating UMG Components into Your Project](#integrating-umg-components-into-your-project)
|
|
13
|
+
- [Package installation](#package-installation)
|
|
14
|
+
- [Importing components](#importing-components)
|
|
15
|
+
- [Theme Styling](#theme-styling)
|
|
16
|
+
- [Design Tokens](#design-tokens)
|
|
17
|
+
- [Installing the default theme and system tokens](#installing-the-default-theme-and-system-tokens)
|
|
18
|
+
- [Types of Design Tokens](#types-of-design-tokens)
|
|
19
|
+
- [Leveraging Design Tokens](#leveraging-design-tokens)
|
|
20
|
+
- [More Ways to Customise](#more-ways-to-customise)
|
|
21
|
+
- [CSS Selector Rules](#css-selector-rules)
|
|
22
|
+
- [CSS Selectors Cheatsheet](#css-selectors-cheatsheet)
|
|
23
|
+
- [Chromatic notes](#chromatic-notes)
|
|
24
|
+
# UMG UX Components Library README
|
|
25
|
+
Welcome to the UMG UX Components Library! This library provides a collection of UX frontend components designed to be fast, reusable, and highly customisable for any project, without relying on proprietary technologies or frameworks. These components leverage standard Web APIs and are compatible with all modern browsers.
|
|
26
|
+
|
|
27
|
+
## Learn More about Web Components
|
|
28
|
+
To deepen your understanding of web components, their key concepts, and the specific web APIs we employ, we recommend reading the [MDN guide on Web Components](https://developer.mozilla.org/en-US/docs/Web/API/Web_components).
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
# Local Development Environment
|
|
32
|
+
|
|
33
|
+
## Prerequisites
|
|
34
|
+
|
|
35
|
+
Before you begin, make sure you have the following prerequisites installed on your system:
|
|
36
|
+
|
|
37
|
+
Node.js v16.14 or higher. You can download it from [here](https://nodejs.org/en/download)
|
|
38
|
+
[PNPM](https://pnpm.io/) v8 or higher. Install it via these links: [Mac](https://github.com/nvm-sh/nvm) | [Windows](https://github.com/coreybutler/nvm-windows)
|
|
39
|
+
|
|
40
|
+
## Installation
|
|
41
|
+
1. Install Node.js globally using one of the following methods:
|
|
42
|
+
- Mac: [NVM](https://github.com/nvm-sh/nvm)
|
|
43
|
+
- Windows: [NVM for Windows](https://github.com/coreybutler/nvm-windows)
|
|
44
|
+
- Direct download: [Node.js](https://nodejs.org/en/download)
|
|
45
|
+
|
|
46
|
+
2. Install PNPM globally using one of the following methods:
|
|
47
|
+
- Mac: ``brew install pnpm``
|
|
48
|
+
- Windows PowerShell: Run the command ``iwr https://get.pnpm.io/install.ps1 -useb | iex``
|
|
49
|
+
|
|
50
|
+
For more details, check the: [PNPM documentation](https://pnpm.io/)
|
|
51
|
+
|
|
52
|
+
1. Clone the project repository using this command:
|
|
53
|
+
```
|
|
54
|
+
git clone git@github.com:Push-Entertainment/umg-component-library.git
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
2. Initialise the project by running the following command in your terminal within the project's root directory:
|
|
58
|
+
```
|
|
59
|
+
pnpm install
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Build scripts
|
|
63
|
+
|
|
64
|
+
We've provided various build scripts to streamline your development process:
|
|
65
|
+
|
|
66
|
+
- Develop components: `pnpm dev`
|
|
67
|
+
- Develop Storybook: `pnpm dev-storybook`
|
|
68
|
+
- Build components and design tokens: `pnpm build`
|
|
69
|
+
- Build components, design tokens and Storybook static site: `pnpm build-all`
|
|
70
|
+
- Build design tokens: `pnpm build-tokens`
|
|
71
|
+
- Build Storybook static site: `pnpm build-storybook`
|
|
72
|
+
|
|
73
|
+
# Lit - Lightning-Fast Components
|
|
74
|
+
|
|
75
|
+
Our library is built using Lit, a framework that simplifies component development without sacrificing performance or relying on non-standard frameworks. Lit builds on web component standards, is lightweight, and reduces boilerplate code. You can find Lit 2's documentation [here](https://lit.dev/docs/).
|
|
76
|
+
|
|
77
|
+
To save time, minimise errors, and future-proof your code, we've written this library in TypeScript and utilise Lit's decorator methods, which TypeScript transpiles into browser-compatible JavaScript.
|
|
78
|
+
|
|
79
|
+
# Storybook Integration for Component Previews and Documentation
|
|
80
|
+
|
|
81
|
+
We've seamlessly integrated Storybook into our component library to provide you with a powerful playground tool with component previews and comprehensive documentation. Storybook serves as a valuable resource for both developers and designers, offering a visual representation of each component's behavior and appearance in different scenarios.
|
|
82
|
+
|
|
83
|
+
- Exploring Components in Storybook
|
|
84
|
+
With Storybook, you can easily navigate and explore our components:
|
|
85
|
+
|
|
86
|
+
- Preview Components: View live, interactive previews of each component to understand how they look and behave in various situations.
|
|
87
|
+
|
|
88
|
+
- Component Variations: Explore different variations and configurations of each component, helping you tailor them to your specific project requirements.
|
|
89
|
+
|
|
90
|
+
- Interactive Documentation: Access detailed documentation and usage examples for each component, making it easier to implement them effectively in your project.
|
|
91
|
+
|
|
92
|
+
The Storybook application can be loaded into a browser by running `pnpm dev-storybook` in `node_modules/@pushengineering/umg-components`.
|
|
93
|
+
|
|
94
|
+
# Integrating UMG Components into Your Project
|
|
95
|
+
## Package installation
|
|
96
|
+
|
|
97
|
+
To integrate UMG Components into your project, follow these steps:
|
|
98
|
+
|
|
99
|
+
1. Ensure you have [Node v16.14^](https://nodejs.org/en/download) installed globally or locally within your project.
|
|
100
|
+
2. In your project's source folder, create a `package.json` file with a minimum configuration like this:
|
|
101
|
+
```
|
|
102
|
+
{
|
|
103
|
+
"name": "project-name",
|
|
104
|
+
"target": "web",
|
|
105
|
+
"type": "module",
|
|
106
|
+
"sideEffects": false,
|
|
107
|
+
"dependencies": {
|
|
108
|
+
"@pushengineering/umg-components": "^1.0.0"
|
|
109
|
+
},
|
|
110
|
+
}
|
|
111
|
+
```
|
|
112
|
+
3. In the root of your project's source folder, run the following command:
|
|
113
|
+
```
|
|
114
|
+
npm run install
|
|
115
|
+
```
|
|
116
|
+
If you've previously installed Node packages in your project, skip this step and run:
|
|
117
|
+
```
|
|
118
|
+
npm install @pushengineering/umg-components --save-dev
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
## Importing components
|
|
122
|
+
Our components are written as ES6 modules for seamless integration into your project without the need for transpilation through tools like Webpack or Babel. You can still use pre-processors like Vite, Webpack, or Roll-up for tree shaking and minification while preserving ES modules.
|
|
123
|
+
|
|
124
|
+
To initialise a web component and render it in your HTML and the DOM, simply import the component script within your page's entry scripts or as a script tag directly inside your page.
|
|
125
|
+
|
|
126
|
+
For example, to import the slider web component and its internal component dependencies, add the following to your main script or as a script tag in your page:
|
|
127
|
+
|
|
128
|
+
```
|
|
129
|
+
import '@pushengineering/umg-web-components/slider'
|
|
130
|
+
```
|
|
131
|
+
Or use a script tag like this:
|
|
132
|
+
|
|
133
|
+
```
|
|
134
|
+
<script async type="module" src="path-to-component-modules/slider.js">
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
If the slider component contains additional web components, such as image banners, you'll also need to import them:
|
|
138
|
+
|
|
139
|
+
```
|
|
140
|
+
import '@pushengineering/umg-web-components/banner'
|
|
141
|
+
import '@pushengineering/umg-web-components/image'
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
If these banner image components require captions with text and buttons, import them as well:
|
|
145
|
+
|
|
146
|
+
```
|
|
147
|
+
import '@pushengineering/umg-web-components/button-group'
|
|
148
|
+
import '@pushengineering/umg-web-components/button'
|
|
149
|
+
import '@pushengineering/umg-web-components/text'
|
|
150
|
+
``````
|
|
151
|
+
|
|
152
|
+
Once imported, you can use these components throughout your page without further imports.
|
|
153
|
+
|
|
154
|
+
## Theme Styling
|
|
155
|
+
|
|
156
|
+
### Design Tokens
|
|
157
|
+
Our UMG UX Components Library is designed on top of a design system that uses custom CSS variables also known as design tokens. These design tokens are mapped to default values assigned to various elements within our components and at the document level. They empower you to customize the theme in a cascading, controlled manner, ensuring consistent design and behavior throughout your application.
|
|
158
|
+
|
|
159
|
+
#### Installing the default theme and system tokens
|
|
160
|
+
To ensure that unthemed components display as intended, it's crucial to include the default design tokens in your application.
|
|
161
|
+
|
|
162
|
+
Follow these steps to integrate the default design tokens into your application:
|
|
163
|
+
|
|
164
|
+
1. Navigate to the following directory in your application: `/your-local-source-folder/node_modules/@pushengineering/umg-web-components/packages/web-components/public`.
|
|
165
|
+
2. In your code editor open the `design-tokens.css` file.
|
|
166
|
+
3. Copy the contents of this file.
|
|
167
|
+
4. Paste the copied contents inside a `<style>` tag within the `<head>` section of your application's HTML page. This approach optimises page performance compared to linking to an external stylesheet.
|
|
168
|
+
|
|
169
|
+
#### Types of Design Tokens
|
|
170
|
+
We've organised our design tokens into two distinct groups, each serving a specific purpose:
|
|
171
|
+
|
|
172
|
+
1. **Theme Customisation Tokens**
|
|
173
|
+
The first group of design tokens empowers developers to freely theme the component library without compromising core behavior and design consistency. These tokens cover a wide range of areas, including:
|
|
174
|
+
|
|
175
|
+
- Typography
|
|
176
|
+
- Colour
|
|
177
|
+
- Shape
|
|
178
|
+
- Space
|
|
179
|
+
- And more
|
|
180
|
+
|
|
181
|
+
With these tokens, you have the flexibility to tailor the look and feel of our components to align perfectly with your project's unique visual identity. They allow you to adapt our components to your brand's colour scheme, typography, and spacing guidelines, among other things.
|
|
182
|
+
|
|
183
|
+
2. **Opinionated Design Tokens**
|
|
184
|
+
The second group of design tokens consists of opinionated values that solidify our components' expected behavior. These tokens are meticulously crafted to ensure accessibility and deliver an exceptional user experience. They are founded on a series of memorable visual scales governing:
|
|
185
|
+
|
|
186
|
+
- Type
|
|
187
|
+
- Grids
|
|
188
|
+
- Responsive Sizing and Spacing
|
|
189
|
+
- Borders
|
|
190
|
+
- And more
|
|
191
|
+
|
|
192
|
+
These opinionated tokens establish consistency in design and reduce decision-making overhead where it is least useful in terms of customisation. By adhering to these scales, you can rest assured that our components will consistently deliver a cohesive and user-friendly experience across your application.
|
|
193
|
+
|
|
194
|
+
#### Leveraging Design Tokens
|
|
195
|
+
To make use of these design tokens, simply customise their values to align with your design system's specifications. You can override the default values assigned to the tokens, tailoring them to your project's exact requirements.
|
|
196
|
+
|
|
197
|
+
By integrating our components with your design tokens, you'll be able to achieve a harmonious blend of visual consistency and user experience excellence in your application, while also benefiting from the flexibility to adapt our components to your unique brand identity.
|
|
198
|
+
|
|
199
|
+
### More Ways to Customise
|
|
200
|
+
Our component styles are encapsulated within web component shadow DOMs, to prevent external styles from inadvertantly targeting elements and creating unwanted side effects. You can safely use CSS variables or custom properties to style components, but we also provide the CSS `::part` and `::part()` selectors for more targeted styling within shadow DOMs.
|
|
201
|
+
|
|
202
|
+
If you need to apply external styles to web component elements when all the above fails to achieve your design needs, consider using [constructed stylesheets](https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleSheet/CSSStyleSheet). We've registered a constructed stylesheet named `umgtheme` that's adopted by each web component in the library.
|
|
203
|
+
|
|
204
|
+
To use this feature, add the following script to your theme template, updating the paths to match your project structure, and ensuring that it runs early in the script loading order:
|
|
205
|
+
|
|
206
|
+
```
|
|
207
|
+
<script type="module">
|
|
208
|
+
/* Local path './node_modules/@pushengineering/umg-web-components/lit' */
|
|
209
|
+
import { css, unsafeCSS } from '../node_modules/lit'
|
|
210
|
+
|
|
211
|
+
window.constructibleStyleSheets = {};
|
|
212
|
+
|
|
213
|
+
const styleSheetPromise = (cssPath, variableName) => fetch(cssPath)
|
|
214
|
+
.then(response => response.text())
|
|
215
|
+
.then(cssRaw => {
|
|
216
|
+
const cssResult = css`${unsafeCSS(cssRaw)}`;
|
|
217
|
+
window.constructibleStyleSheets[variableName] = cssResult;
|
|
218
|
+
return cssResult.styleSheet;
|
|
219
|
+
}).catch(error => console.error(`😡 [${variableName}]`, error));
|
|
220
|
+
|
|
221
|
+
Promise.all([
|
|
222
|
+
styleSheetPromise(
|
|
223
|
+
"/global.css", /* path-to-public-stylesheet */
|
|
224
|
+
"umgtheme", /* Do not edit */
|
|
225
|
+
)
|
|
226
|
+
]).then(styleSheets => {
|
|
227
|
+
document.adoptedStyleSheets = styleSheets;
|
|
228
|
+
});
|
|
229
|
+
</script>
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
### CSS Selector Rules
|
|
233
|
+
|
|
234
|
+
When styling web components from an external stylesheet, keep these rules in mind:
|
|
235
|
+
|
|
236
|
+
- Elements rendered in Light DOM are targetable as usual with standard CSS selectors.
|
|
237
|
+
|
|
238
|
+
- To target elements within shadow roots or the Shadow DOM, you can pass values via CSS variables registered for elements within the Shadow DOM. Combine standard CSS selectors with the `::part()` CSS pseudo-element selector by referencing the element's part name, e.g., `#section-name::part(button)`.
|
|
239
|
+
|
|
240
|
+
- To specifically target an element in the shadow root with a part name shared by other elements on the page, you can uniquely reference the element using a unique parent ID or class along with the `::part()` selector, e.g., `#section-name .slide-button::part(button)`.
|
|
241
|
+
|
|
242
|
+
### CSS Selectors Cheatsheet
|
|
243
|
+
|
|
244
|
+
| **Target**: | doc-root | custom-element | custom-element-root | shadow-root | light-dom |
|
|
245
|
+
|-----------------------------:|:--------:|:--------------:|:-------------------:|:-------------:|:--------------------------------:|
|
|
246
|
+
| selector path: | | | | | |
|
|
247
|
+
| stylesheet.css | ✓ | ✓ | ✓ | *::part(foo) | ✓ |
|
|
248
|
+
| doc-style > | ✓ | ✓ | ✓ | x | ✓ |
|
|
249
|
+
| doc-style > custom-element > | | ✓ | ✓ | *::part(foo) | ✓ |
|
|
250
|
+
| custom-element > | | :host | ✓ | ✓ | ::slotted(foo) NOT [root]class > |
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
# Chromatic notes
|
|
254
|
+
|
|
255
|
+
Please note that Chromatic requires Node.js to be at version 16.19.1 or lower. Versions higher than this may cause issues with the CLI.
|
|
256
|
+
|
|
257
|
+
To install Chromatic CLI, run the following command:
|
|
258
|
+
|
|
259
|
+
```
|
|
260
|
+
# npm
|
|
261
|
+
npm install --save-dev chromatic
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
Make sure to set the `CHROMATIC_PROJECT_TOKEN` in your environment to enable the `npm run chromatic` command.
|
|
265
|
+
You can find your project token in Chromatic under Project → Manage.
|
|
266
|
+
|