I was exploring the source code of the @atlaskit/storybook-addon-design-system package and noticed that index.ts inside the src directory exports an empty object ({}).
when i try to import withDesignTokens function for setting decorator in storybook config file then i got empty object error. How to solve this problem?
and also if i try to import withDesignTokens from decorator file inside src folder then type is not matched with what storybook decorator is seeking?
This addon is designed to be used via Storybook configuration, not by manually importing decorators.
You should register/inject it in .storybook/main.ts
export default {
addons: ['@atlaskit/storybook-addon-design-system'],
};
If you need a design token decorator, instead of using withDesignTokens, use the Atlaskit setup
import { setGlobalTheme } from '@atlaskit/tokens';
this is the supported way to enable design tokens.
Please take it with a pinch of salt, but you may find more answers if you post this to Atlassian Developer Community.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.