design-token-editor
Advanced tools
Comparing version 0.1.0 to 0.2.0
@@ -1,3 +0,2 @@ | ||
export { default as TokenRow } from './TokenRow'; | ||
export { default as TokensTable } from './TokensTable'; | ||
export { default as TokenEditor } from './TokenEditor'; |
@@ -6,5 +6,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.TokenEditor = exports.TokensTable = exports.TokenRow = void 0; | ||
var TokenRow_1 = require("./TokenRow"); | ||
Object.defineProperty(exports, "TokenRow", { enumerable: true, get: function () { return __importDefault(TokenRow_1).default; } }); | ||
exports.TokenEditor = exports.TokensTable = void 0; | ||
var TokensTable_1 = require("./TokensTable"); | ||
@@ -11,0 +9,0 @@ Object.defineProperty(exports, "TokensTable", { enumerable: true, get: function () { return __importDefault(TokensTable_1).default; } }); |
@@ -1,3 +0,2 @@ | ||
export { default as TokenRow } from './TokenRow'; | ||
export { default as TokensTable } from './TokensTable'; | ||
export { default as TokenEditor } from './TokenEditor'; |
@@ -1,3 +0,2 @@ | ||
export { default as TokenRow } from './TokenRow'; | ||
export { default as TokensTable } from './TokensTable'; | ||
export { default as TokenEditor } from './TokenEditor'; |
/** | ||
* Do not edit directly | ||
* Generated on Sat, 28 Jan 2023 23:15:43 GMT | ||
* Generated on Sun, 29 Jan 2023 14:30:23 GMT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/** | ||
* Do not edit directly | ||
* Generated on Sat, 28 Jan 2023 23:15:43 GMT | ||
* Generated on Sun, 29 Jan 2023 14:30:23 GMT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
{ | ||
"name": "design-token-editor", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"description": "A react component to view/edit design token values", | ||
@@ -8,2 +8,13 @@ "main": "./lib/cjs/index.js", | ||
"types": "./lib/esm/index.d.ts", | ||
"exports": { | ||
".": { | ||
"import": "./lib/esm/index.js", | ||
"require": "./lib/cjs/index.js", | ||
"default": "./lib/cjs/index.js" | ||
}, | ||
"./esm/": "./lib/esm/", | ||
"./css/": "./lib/css/", | ||
"./tokens": "./lib/tokens/tokens.js", | ||
"./lib/": "./lib/" | ||
}, | ||
"scripts": { | ||
@@ -59,2 +70,3 @@ "start": "npm-run-all -p watch:* storybook", | ||
"@types/react-dom": "^18.0.10", | ||
"@utrecht/design-tokens": "^1.0.0-alpha.429", | ||
"babel-loader": "^8.3.0", | ||
@@ -61,0 +73,0 @@ "chokidar": "^3.5.3", |
# Design token editor | ||
[![Build package](https://github.com/sergei-maertens/design-token-editor/actions/workflows/build.yml/badge.svg)](https://github.com/sergei-maertens/design-token-editor/actions/workflows/build.yml) | ||
[![Build and publish storybook](https://github.com/sergei-maertens/design-token-editor/actions/workflows/storybook.yml/badge.svg)](https://github.com/sergei-maertens/design-token-editor/actions/workflows/storybook.yml) | ||
[![NPM package](https://img.shields.io/npm/v/design-token-editor.svg)](https://www.npmjs.com/package/design-token-editor) | ||
@@ -14,2 +16,4 @@ [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat)](https://github.com/prettier/prettier) | ||
[Storybook][Storybook] documents the (public) API. | ||
## Who is it for? | ||
@@ -54,44 +58,4 @@ | ||
See the [Storybook](https://sergei-maertens.github.io/design-token-editor/) | ||
documentation for the available components and public API. | ||
Please see the [Storybook][Storybook] documentation. | ||
### Including the styles | ||
The package ships with stylesheets to include for proper styling: | ||
- `design-token-editor/lib/css/dte.css` with the styles | ||
- `design-token-editor/lib/css/index.css` (or `root.css`) with the default theme values | ||
Note that the `index.css` has the theme values scoped under the `.dte-default-theme` | ||
selector, while the `root.css` uses the `root:` selector. Using the former is | ||
recommended, but it requires you to apply the `dte-default-theme` class name to your | ||
container element. | ||
You are of course free to create your own theme, in which case you should specify the | ||
appropriate selector to use. | ||
### Rendering a table of available tokens | ||
For example in storybook MDX format: | ||
```jsx | ||
import {TokensTable} from 'design-token-editor'; | ||
import myTokens from 'my-design-tokens/dist/tokens'; | ||
<div className="dte-default-theme"> | ||
<TokensTable container={myTokens} autoExpand />; | ||
</div>; | ||
``` | ||
### Providing the editor | ||
**Warning** - the editor is WIP | ||
```jsx | ||
import {TokenEditor} from 'design-token-editor'; | ||
import myTokens from 'my-design-tokens/dist/tokens'; | ||
<div className="dte-default-theme"> | ||
<TokenEditor tokens={myTokens} initialValues={{'my.tokens.foo': 'bar'}} />; | ||
</div>; | ||
``` | ||
[Storybook]: https://sergei-maertens.github.io/design-token-editor/ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
66225
27
1282
60