-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
37 changed files
with
1,949 additions
and
1,227 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,45 @@ | ||
import * as jest from 'jest-mock' | ||
|
||
import ThemeDecorator from '../src/ThemeDecorator' | ||
import { type Preview } from '@storybook/react' | ||
|
||
import themeDecorator from '../src/ThemeDecorator' | ||
import { COLOR_MODES, DEFAULT_COLOR_MODE } from '../src/theme' | ||
|
||
// @ts-expect-error | ||
window.jest = jest | ||
|
||
export const parameters = { | ||
layout: 'fullscreen', | ||
actions: { argTypesRegex: '^on[A-Z].*' }, | ||
controls: { | ||
matchers: { | ||
color: /(background|color)$/i, | ||
date: /Date$/, | ||
const preview: Preview = { | ||
parameters: { | ||
layout: 'fullscreen', | ||
actions: { argTypesRegex: '^on[A-Z].*' }, | ||
controls: { | ||
matchers: { | ||
color: /(background|color)$/i, | ||
date: /Date$/, | ||
}, | ||
}, | ||
options: { | ||
storySort: { | ||
order: ['Semantic System', '*'], | ||
}, | ||
}, | ||
}, | ||
options: { | ||
storySort: { | ||
order: ['Semantic System', '*'], | ||
globalTypes: { | ||
theme: { | ||
description: 'Global theme for components', | ||
defaultValue: DEFAULT_COLOR_MODE, | ||
toolbar: { | ||
// The label to show for this toolbar item | ||
title: 'Theme', | ||
icon: 'circlehollow', | ||
// Array of plain string values or MenuItem shape (see below) | ||
items: COLOR_MODES, | ||
// Change title based on selected value | ||
dynamicTitle: true, | ||
}, | ||
}, | ||
}, | ||
decorators: [themeDecorator], | ||
} | ||
|
||
export const decorators = [ThemeDecorator] | ||
export default preview |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.