Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/main-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
run: npm ci
shell: bash
- name: Build Storybook
run: npx sb build
run: npm run build-storybook
shell: bash
- name: Upload to S3
uses: gravity-ui/preview-upload-to-s3-action@v1
Expand Down
1 change: 0 additions & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
registry=https://registry.npmjs.org
legacy-peer-deps=true
12 changes: 4 additions & 8 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,13 @@ import type {StorybookConfig} from '@storybook/react-webpack5';
const config: StorybookConfig = {
framework: {
name: '@storybook/react-webpack5',
options: {fastRefresh: true, legacyRootApi: false},
options: {},
},
stories: ['../src/**/*.stories.@(ts|tsx)'],
docs: {
autodocs: false,
features: {
backgrounds: false,
},
addons: [
'@storybook/preset-scss',
{name: '@storybook/addon-essentials', options: {backgrounds: false}},
'./theme-addon/register.tsx',
],
addons: ['@storybook/addon-webpack5-compiler-babel', '@storybook/preset-scss'],
};

export default config;
4 changes: 3 additions & 1 deletion .storybook/manager.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import {addons} from '@storybook/addons';
import {addons} from 'storybook/manager-api';
import {themes} from './theme';

import './theme-addon/register';

addons.setConfig({
theme: themes.light,
});
14 changes: 8 additions & 6 deletions .storybook/preview.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import {MINIMAL_VIEWPORTS} from '@storybook/addon-viewport';
import {MINIMAL_VIEWPORTS} from 'storybook/viewport';
import type {Decorator} from '@storybook/react';
import {withMobile} from './decorators/withMobile';
import {withLang} from './decorators/withLang';
Expand All @@ -24,9 +24,8 @@ const withContextProvider: Decorator = (Story, context) => {
export const decorators = [withMobile, withLang, withContextProvider];

export const parameters = {
jsx: {showFunctions: true}, // To show functions in sources
viewport: {
viewports: MINIMAL_VIEWPORTS,
options: MINIMAL_VIEWPORTS,
},
options: {
storySort: {
Expand All @@ -36,10 +35,15 @@ export const parameters = {
},
};

export const initialGlobals = {
theme: 'light',
lang: 'en',
platform: 'desktop',
};

export const globalTypes = {
theme: {
name: 'Theme',
defaultValue: 'light',
toolbar: {
icon: 'mirror',
items: [
Expand All @@ -52,7 +56,6 @@ export const globalTypes = {
},
lang: {
name: 'Language',
defaultValue: 'en',
toolbar: {
icon: 'globe',
items: [
Expand All @@ -63,7 +66,6 @@ export const globalTypes = {
},
platform: {
name: 'Platform',
defaultValue: 'desktop',
toolbar: {
items: [
{value: 'desktop', title: 'Desktop', icon: 'browser'},
Expand Down
5 changes: 2 additions & 3 deletions .storybook/theme-addon/register.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import * as React from 'react';
import {addons, types} from '@storybook/addons';
import {useGlobals} from '@storybook/api';
import {FORCE_RE_RENDER} from '@storybook/core-events';
import {addons, types, useGlobals} from 'storybook/manager-api';
import {FORCE_RE_RENDER} from 'storybook/internal/core-events';
import {getThemeType} from '@gravity-ui/uikit';
import {themes} from '../theme';

Expand Down
8 changes: 5 additions & 3 deletions .storybook/theme.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {create} from '@storybook/theming';
import {create} from 'storybook/theming';

export const CloudThemeLight = create({
base: 'light',
Expand Down Expand Up @@ -27,8 +27,10 @@ export const CloudThemeLight = create({
inputBorderRadius: 4,

brandUrl: 'https://github.com/gravity-ui/dashkit',
brandTitle: `<div style="font-size: 18px; color: #027bf3; font-weight: 600; margin-top: -6px; margin-bottom: 2px;">DashKit</div>
<div style="font-size: 14px;color: #7d7d7d;font-weight: 400;">Dashkit Component</div>`,
brandTitle: `<div>
<div style="font-size: 18px; color: #027bf3; font-weight: 600; margin-top: -6px; margin-bottom: 2px;">DashKit</div>
<div style="font-size: 14px;color: #7d7d7d;font-weight: 400;">Dashkit Component</div>
</div>`,
});

export const CloudThemeDark = create({
Expand Down
Loading
Loading