@geometricpanda/storybook-addon-badges
Advanced tools
Comparing version 1.1.0--canary.10.0d7612f.0 to 1.1.0--canary.10.c269189.0
{ | ||
"name": "@geometricpanda/storybook-addon-badges", | ||
"version": "1.1.0--canary.10.0d7612f.0", | ||
"version": "1.1.0--canary.10.c269189.0", | ||
"description": "A Storybook addon which allows you to add badges to your stories", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -36,10 +36,11 @@ [![npm version](https://badge.fury.io/js/%40geometricpanda%2Fstorybook-addon-badges.svg)](https://www.npmjs.com/package/@geometricpanda/storybook-addon-badges) | ||
Optionally, you can define custom badge styles in `.storybook/preview.js`. | ||
Optionally, you can define custom badge styles in `.storybook/preview.ts`. | ||
```js | ||
// .storybook/preview.js | ||
import { addParameters } from '@storybook/react'; | ||
```ts | ||
// .storybook/preview.ts | ||
import {BadgesConfig} from "@geometricpanda/storybook-addon-badges"; | ||
import {addParameters} from '@storybook/react'; | ||
addParameters({ | ||
badgesConfig: { | ||
badgesConfig: <BadgesConfig>{ | ||
beta: { | ||
@@ -69,7 +70,10 @@ styles: { | ||
```js | ||
```ts | ||
// .storybook/preview.ts | ||
import {BadgesConfig} from "@geometricpanda/storybook-addon-badges"; | ||
import {addParameters} from '@storybook/react'; | ||
addParameters({ | ||
badgesConfig: { | ||
badgesConfig: <BadgesConfig>{ | ||
beta: { | ||
...betaConfig, | ||
tooltip: { | ||
@@ -90,3 +94,3 @@ title: 'This is Beta', | ||
deprecated: { | ||
...deprecatedConfig, | ||
title: "Deprecated", | ||
tooltip: 'This component is deprecated, please avoid using it.', | ||
@@ -115,8 +119,9 @@ }, | ||
// .storybook/preview.js | ||
import { addParameters } from '@storybook/react'; | ||
// .storybook/preview.ts | ||
import {BADGE, BadgesConfig} from "@geometricpanda/storybook-addon-badges"; | ||
import {addParameters} from '@storybook/react'; | ||
addParameters({ | ||
badgesConfig: { | ||
[BADGES.STATUS]: { | ||
badgesConfig: <BadgesConfig>{ | ||
[BADGE.STATUS]: { | ||
styles: { | ||
@@ -154,16 +159,17 @@ backgroundColor: '#FFF', | ||
```typescript | ||
// .storybook/preview.js | ||
import { addParameters } from '@storybook/react'; | ||
// .storybook/preview.ts | ||
import {BADGE, BadgesConfig} from "@geometricpanda/storybook-addon-badges"; | ||
import {addParameters} from '@storybook/react'; | ||
addParameters({ | ||
badgesConfig: { | ||
[BADGES.STATUS]: { | ||
styles: { | ||
backgroundColor: '#FFF', | ||
borderColor: '#018786', | ||
color: '#018786', | ||
}, | ||
title: 'Status', | ||
badgesConfig: <BadgeConfig>{ | ||
[BADGE.STATUS]: { | ||
styles: { | ||
backgroundColor: '#FFF', | ||
borderColor: '#018786', | ||
color: '#018786', | ||
}, | ||
title: 'Status', | ||
}, | ||
}, | ||
}, | ||
}); | ||
@@ -170,0 +176,0 @@ ``` |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
42006
282
0