Skip to content

Commit

Permalink
Address some storybook warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
swissspidy committed Dec 2, 2023
1 parent 06704fa commit ab6c0e3
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 45 deletions.
10 changes: 4 additions & 6 deletions .storybook/main.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -29,25 +29,24 @@ module.exports = {
'../packages/dashboard/src/**/stories/index.js',
'../packages/story-editor/src/**/stories/index.js',
'../packages/wp-dashboard/src/**/stories/index.js',
'../packages/wp-story-editor/src/**/stories/index.js',
'../packages/activation-notice/src/**/stories/index.js',
'../packages/design-system/src/**/stories/index.js',
'../packages/animation/src/**/stories/*.js',
],
storyIndexers: (indexers) => {
const indexer = (fileName, opts) => {
experimental_indexers: (indexers) => {
const createIndex = async (fileName, opts) => {
const code = readFileSync(fileName, {
encoding: 'utf-8',
});
return loadCsf(code, {
...opts,
fileName,
}).parse();
}).parse().indexInputs;
};
return [
{
test: /stories\/.*\.js$/,
indexer,
createIndex,
},
...(indexers || []),
];
Expand All @@ -66,7 +65,6 @@ module.exports = {
toolbars: true,
},
},
'@storybook/addon-storysource',
],
framework: {
name: '@storybook/react-webpack5',
Expand Down
24 changes: 0 additions & 24 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
"@storybook/addon-docs": "^7.6.3",
"@storybook/addon-essentials": "^7.6.3",
"@storybook/addon-links": "^7.6.3",
"@storybook/addon-storysource": "^7.6.3",
"@storybook/addon-viewport": "^7.6.3",
"@storybook/client-api": "^7.6.3",
"@storybook/client-logger": "^7.6.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
/**
* Internal dependencies
*/
import CircularProgress from '..';
import CircularProgress from '../circular';

export default {
title: 'Stories Editor/Components/Circular Progress',
Expand Down
10 changes: 5 additions & 5 deletions packages/design-system/src/components/menu/stories/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import {
nestedDropDownOptions,
reallyLongOptions,
} from '../../../storybookUtils/sampleData';
import { getOptions } from '../utils';
import { getGroups } from '../utils';

export default {
title: 'DesignSystem/Components/Menu',
Expand Down Expand Up @@ -92,10 +92,10 @@ const styleOverrideForAnimationEffectMenu = css`
}
`;

const _basicDropDownOptions = getOptions(basicDropDownOptions);
const _effectChooserOptions = getOptions(effectChooserOptions);
const _nestedDropDownOptions = getOptions(nestedDropDownOptions);
const _reallyLongOptions = getOptions(reallyLongOptions);
const _basicDropDownOptions = getGroups(basicDropDownOptions);
const _effectChooserOptions = getGroups(effectChooserOptions);
const _nestedDropDownOptions = getGroups(nestedDropDownOptions);
const _reallyLongOptions = getGroups(reallyLongOptions);

export const _default = {
render: function Render({ onMenuItemClick, ...args }) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ import { useCallback, useEffect, useState } from '@googleforcreators/react';
import { theme } from '../../../theme';
import { Table } from '../../../icons';
import { Button, ButtonSize, ButtonType, ButtonVariant } from '../../button';
import { BaseTooltip as Tooltip, Placement } from '..';
import { Placement } from '../../popup';
import { Tooltip } from '..';
import { Text } from '../../typography';

export default {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {
Text,
Link,
List,
BaseTooltip,
Tooltip as BaseTooltip,
} from '@googleforcreators/design-system';

/**
Expand Down
13 changes: 8 additions & 5 deletions packages/story-editor/src/components/tablist/stories/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,26 @@ import styled from 'styled-components';
import {
TextSize,
Link,
BaseTooltip,
Tooltip as BaseTooltip,
Text,
} from '@googleforcreators/design-system';

/**
* Internal dependencies
*/
import { useState } from '@googleforcreators/react';
import { Thumbnail, THUMBNAIL_TYPES } from '../../thumbnail';
import { THUMBNAIL_BG } from '../../thumbnail/stories/demoThumbnails';
import { CARD_TYPE } from '../../checklistCard/constants';
import { StyledVideoOptimizationIcon } from '../../checklistCard/styles';
import { DefaultCtaButton } from '../../checklistCard/defaultCtaButton';
import { DefaultFooterText } from '../../checklistCard/defaultFooterText';
import { Tablist } from '../styles';
import TablistPanel from '../tablistPanel';
import { CheckboxCta } from '../../checklistCard/checkboxCta';
import { ChecklistCard } from '../../checklistCard';
import {
ChecklistCard,
CARD_TYPE,
DefaultCtaButton,
DefaultFooterText,
} from '../../checklistCard';
import { PANEL_STATES } from '../constants';

export default {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@
* External dependencies
*/
import styled from 'styled-components';
import { BaseTooltip, Icons } from '@googleforcreators/design-system';
import {
Tooltip as BaseTooltip,
Icons,
} from '@googleforcreators/design-system';

/**
* Internal dependencies
*/
Expand Down

0 comments on commit ab6c0e3

Please sign in to comment.