@automattic/privacy-toolset
TypeScript icon, indicating that this package has built-in type declarations

2.1.0 • Public • Published

Components

A library of tools created as React components designed to unify privacy mechanism in Automattic products.

Installation

  1. Install the toolset.
yarn add @automattic/privacy-toolset
  1. Add wp-components stylesheet

Many components include CSS to add style, you will need to add in order to appear correctly. Within WordPress, add the wp-components stylesheet as a dependency of your plugin's stylesheet. See wp_enqueue_style documentation for how to specify dependencies.

In non-WordPress projects, link to the build-style/style.css file directly, it is located at node_modules/@wordpress/components/build-style/style.css.

Source: @wordpress/components

Usage

// import the component you wish to use
import { CookieBanner } from '@automattic/privacy-toolset';

const Component = () => (
	<>
		<CookieBanner content={ contentDefinition } onAccept={ fn } />
	</>
);

Disclaimer: for the detailed content parameter structure, see src/cookie-banner/cookie-banner.stories.tsx.

Development Workflow

This package is developed as part of the Calypso monorepo. Run yarn in the root of the repository to get the required devDependencies.

Tests

yarn run test-packages -- packages/privacy-toolset

yarn run test-packages:watch -- packages/privacy-toolset

Using Storybook

yarn workspace @automattic/privacy-toolset run storybook

Readme

Keywords

none

Package Sidebar

Install

npm i @automattic/privacy-toolset

Weekly Downloads

2

Version

2.1.0

License

GPL-2.0-or-later

Unpacked Size

452 kB

Total Files

82

Last publish

Collaborators

  • porada
  • imranh920
  • gmjuhasz
  • rcarvalho
  • briowill
  • bgrgicak
  • dhenridev
  • daledupreez-a8c
  • jeherve
  • yuliyan
  • micbosia8c
  • jeremy.yip
  • wpvip-bot
  • etobiesen
  • kzoschke
  • brunobasto
  • kat3samsin
  • fmfernandes
  • newspack
  • robertsreberski_a8c
  • msurdi-a8c
  • chihsuan
  • manzoorwanijk
  • rjchow
  • andrea-sdl
  • scjr
  • spsiddarthan
  • t2dw4t
  • ehg_
  • wwa
  • sirreal
  • elazzabi
  • royho
  • luismulinari
  • macbre
  • mjangda
  • matticbot
  • a8c
  • blowery
  • noahtallen
  • hanifn
  • sgomes
  • tyxla
  • saroshaga
  • parkcityj
  • nejclovrencic
  • sirbrillig
  • chriszarate
  • robersongomes
  • johngodley