Skip to content

Commit 6d1a7bb

Browse files
Shared tooling: Storybook @lg-tools/storybook (#1815)
* lerna exec. extend build.tsconfig * updates internal tsconfig * updates paths * Create update-package-json.ts * adds turbo * Create turbo.yml * update ci * updates CI * Setup nx vs turbo benchmark job * Update benchmark.yml * rename lint script * rm yarn cache * update build dependencies * Adds baseline job * Updates configs & ci Update turbo.json Update turbo.json Update nx.json Update benchmark.yml restore build-storybook fixes dependencies Create sizeDiff.yml Update sizeDiff.yml Update sizeDiff.yml Update .npmpackagejsonlintrc.json rm lodash from icon-button rm bad references from palette story fix nx? * removes nx.json * lerna exec. extend build.tsconfig * rm old tsconfigs * fixes dependencies * rm readdir from rollup * rollup 2.79 * mv rollup.js => mjs * fixes for rollup 2.79 * use global rollup * use old svgr in icon * update rollup plugins * update svgr dependencies * adds rollup-plugin-node-externals * mv rollup config * Updates rollup script * legacy scripts * Only parse icons if we have to * Update update-package-json.ts * mv rollup.js => mjs * fixes for rollup 2.79 * adds rollup-plugin-node-externals * mv rollup config * Only parse icons if we have to Update rollup.config.mjs * lint * temporarily restore root level babel config * Restores compat mode Builds should remain the same * breaks out icon specific config * Creates lg-tools/rollup * separate tools/babel tools/tsconfig * moves dependencies * mv config to one package * lint * Update babel.config.js * restores svgr webpack (for SB) * upgrade to @rollup/plugin-terser * silence peer dependency warnings * Cleanup Prebuild script (#1818) * Update build.ts * rebuilds icons * lint build.ts * updates icon build config * renames default config * lint * mv svgrc.js * Update package.json * mv config fix icon build update root babel config * Adds color control to icon story * fixes icon build * rm explicit build tool * fix missing imports * lint * init storybook-decorators * mv decorators * Updates decorators package * Creates @lg-tools/storybook * lint * resolve missing dependency warning * fix * fix peer dep warnings * update build config paths * Create thick-rings-drop.md * Squashed commit of the following: commit d8c10d3 Author: Adam Thompson <[email protected]> Date: Wed Jun 28 12:40:22 2023 -0400 Shared tooling: Test `@lg-tools/test` (#1814) * lerna exec. extend build.tsconfig * updates internal tsconfig * updates paths * Create update-package-json.ts * adds turbo * Create turbo.yml * update ci * updates CI * Setup nx vs turbo benchmark job * Update benchmark.yml * rename lint script * rm yarn cache * update build dependencies * Adds baseline job * Updates configs & ci Update turbo.json Update turbo.json Update nx.json Update benchmark.yml restore build-storybook fixes dependencies Create sizeDiff.yml Update sizeDiff.yml Update sizeDiff.yml Update .npmpackagejsonlintrc.json rm lodash from icon-button rm bad references from palette story fix nx? * removes nx.json * lerna exec. extend build.tsconfig * rm old tsconfigs * fixes dependencies * rm readdir from rollup * rollup 2.79 * mv rollup.js => mjs * fixes for rollup 2.79 * use global rollup * use old svgr in icon * update rollup plugins * update svgr dependencies * adds rollup-plugin-node-externals * mv rollup config * Updates rollup script * legacy scripts * Only parse icons if we have to * Update update-package-json.ts * mv rollup.js => mjs * fixes for rollup 2.79 * adds rollup-plugin-node-externals * mv rollup config * Only parse icons if we have to Update rollup.config.mjs * lint * temporarily restore root level babel config * Restores compat mode Builds should remain the same * breaks out icon specific config * Creates lg-tools/rollup * separate tools/babel tools/tsconfig * moves dependencies * mv config to one package * lint * Update babel.config.js * restores svgr webpack (for SB) * upgrade to @rollup/plugin-terser * silence peer dependency warnings * Cleanup Prebuild script (#1818) * Update build.ts * rebuilds icons * lint build.ts * updates icon build config * renames default config * lint * mv svgrc.js * Update package.json * mv config fix icon build update root babel config * Adds color control to icon story * fixes icon build * rm explicit build tool * fix missing imports * lint * update ci * Setup nx vs turbo benchmark job * Updates configs & ci Update turbo.json Update turbo.json Update nx.json Update benchmark.yml restore build-storybook fixes dependencies Create sizeDiff.yml Update sizeDiff.yml Update sizeDiff.yml Update .npmpackagejsonlintrc.json rm lodash from icon-button rm bad references from palette story fix nx? * removes nx.json * Moves jest config * mv rename files * mv tools/jest -> tools/test * rm deps * run tests via lg-test command * lint * lint & fix * Update depcheck.ts * mv jest config to /config * fix * update build config path * update test cli * lint * Create afraid-peaches-boil.md * Squashed commit of the following: commit d84e7eb Author: Adam Thompson <[email protected]> Date: Wed Jun 28 10:56:13 2023 -0400 Shared tooling: Build `@lg-tools/build` [LG-3337] (#1809) * lerna exec. extend build.tsconfig * updates internal tsconfig * updates paths * Create update-package-json.ts * adds turbo * Create turbo.yml * update ci * updates CI * Setup nx vs turbo benchmark job * Update benchmark.yml * rename lint script * rm yarn cache * update build dependencies * Adds baseline job * Updates configs & ci Update turbo.json Update turbo.json Update nx.json Update benchmark.yml restore build-storybook fixes dependencies Create sizeDiff.yml Update sizeDiff.yml Update sizeDiff.yml Update .npmpackagejsonlintrc.json rm lodash from icon-button rm bad references from palette story fix nx? * removes nx.json * lerna exec. extend build.tsconfig * rm old tsconfigs * fixes dependencies * rm readdir from rollup * rollup 2.79 * mv rollup.js => mjs * fixes for rollup 2.79 * use global rollup * use old svgr in icon * update rollup plugins * update svgr dependencies * adds rollup-plugin-node-externals * mv rollup config * Updates rollup script * legacy scripts * Only parse icons if we have to * Update update-package-json.ts * mv rollup.js => mjs * fixes for rollup 2.79 * adds rollup-plugin-node-externals * mv rollup config * Only parse icons if we have to Update rollup.config.mjs * lint * temporarily restore root level babel config * Restores compat mode Builds should remain the same * breaks out icon specific config * Creates lg-tools/rollup * separate tools/babel tools/tsconfig * moves dependencies * mv config to one package * lint * Update babel.config.js * restores svgr webpack (for SB) * upgrade to @rollup/plugin-terser * silence peer dependency warnings * Cleanup Prebuild script (#1818) * Update build.ts * rebuilds icons * lint build.ts * updates icon build config * renames default config * lint * mv svgrc.js * Update package.json * mv config fix icon build update root babel config * Adds color control to icon story * fixes icon build * rm explicit build tool * fix missing imports * lint * Create spotty-jobs-judge.md commit d84e7eb Author: Adam Thompson <[email protected]> Date: Wed Jun 28 10:56:13 2023 -0400 Shared tooling: Build `@lg-tools/build` [LG-3337] (#1809) * lerna exec. extend build.tsconfig * updates internal tsconfig * updates paths * Create update-package-json.ts * adds turbo * Create turbo.yml * update ci * updates CI * Setup nx vs turbo benchmark job * Update benchmark.yml * rename lint script * rm yarn cache * update build dependencies * Adds baseline job * Updates configs & ci Update turbo.json Update turbo.json Update nx.json Update benchmark.yml restore build-storybook fixes dependencies Create sizeDiff.yml Update sizeDiff.yml Update sizeDiff.yml Update .npmpackagejsonlintrc.json rm lodash from icon-button rm bad references from palette story fix nx? * removes nx.json * lerna exec. extend build.tsconfig * rm old tsconfigs * fixes dependencies * rm readdir from rollup * rollup 2.79 * mv rollup.js => mjs * fixes for rollup 2.79 * use global rollup * use old svgr in icon * update rollup plugins * update svgr dependencies * adds rollup-plugin-node-externals * mv rollup config * Updates rollup script * legacy scripts * Only parse icons if we have to * Update update-package-json.ts * mv rollup.js => mjs * fixes for rollup 2.79 * adds rollup-plugin-node-externals * mv rollup config * Only parse icons if we have to Update rollup.config.mjs * lint * temporarily restore root level babel config * Restores compat mode Builds should remain the same * breaks out icon specific config * Creates lg-tools/rollup * separate tools/babel tools/tsconfig * moves dependencies * mv config to one package * lint * Update babel.config.js * restores svgr webpack (for SB) * upgrade to @rollup/plugin-terser * silence peer dependency warnings * Cleanup Prebuild script (#1818) * Update build.ts * rebuilds icons * lint build.ts * updates icon build config * renames default config * lint * mv svgrc.js * Update package.json * mv config fix icon build update root babel config * Adds color control to icon story * fixes icon build * rm explicit build tool * fix missing imports * lint * Create spotty-jobs-judge.md * lock * lint
1 parent 9bf52f4 commit 6d1a7bb

37 files changed

+307
-173
lines changed

.changeset/thick-rings-drop.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@lg-tools/storybook': minor
3+
'@lg-tools/storybook-decorators': minor
4+
---
5+
6+
First pre-release of shared LeafyGreen Storybook tooling

.storybook/decorators/PropCombinations/tsconfig.json

-3
This file was deleted.

.storybook/decorators/ReactStrictMode.tsx

-4
This file was deleted.

.storybook/main.ts

+2-107
Original file line numberDiff line numberDiff line change
@@ -1,107 +1,2 @@
1-
import { ProvidePlugin } from 'webpack';
2-
3-
const nodeModulesThatNeedToBeParsedBecauseTheyExposeES6 = [
4-
'@tanstack[\\\\/]react-table',
5-
'@tanstack[\\\\/]table-core',
6-
];
7-
8-
const config = {
9-
stories: [
10-
'../!(node_modules)/**/*.story.@(mdx|js|jsx|ts|tsx)',
11-
'../!(node_modules)/**/*.stories.@(mdx|js|jsx|ts|tsx)',
12-
],
13-
addons: [
14-
'@storybook/addon-links',
15-
'@storybook/addon-essentials',
16-
'@storybook/addon-interactions',
17-
'@storybook/addon-docs',
18-
'@storybook/addon-a11y',
19-
],
20-
framework: {
21-
name: '@storybook/react-webpack5',
22-
options: {
23-
fastRefresh: true,
24-
strictMode: true,
25-
},
26-
},
27-
core: {
28-
disableTelemetry: true,
29-
},
30-
staticDirs: ['./static'],
31-
32-
babel: async options => {
33-
return {
34-
...options,
35-
presets: [
36-
'@babel/preset-typescript',
37-
'@babel/preset-react',
38-
[
39-
'@babel/preset-env',
40-
{
41-
modules: false,
42-
},
43-
],
44-
],
45-
};
46-
},
47-
48-
webpackFinal: config => {
49-
// Default rule for images /\.(svg|ico|jpg|jpeg|png|gif|eot|otf|webp|ttf|woff|woff2|cur|ani|pdf)(\?.*)?$/
50-
const fileLoaderRule = config?.module?.rules.find(
51-
rule => rule?.test && rule?.test.test('.svg'),
52-
);
53-
fileLoaderRule.exclude = /\.svg$/;
54-
55-
config.module.rules.map(rule => {
56-
if (rule.test?.toString() !== String(/\.js$/)) return rule;
57-
const include = new RegExp(
58-
`[\\\\/]node_modules[\\\\/](${nodeModulesThatNeedToBeParsedBecauseTheyExposeES6.join(
59-
'|',
60-
)})`,
61-
);
62-
if (Array.isArray(rule.include)) {
63-
rule.include.push(include);
64-
} else {
65-
rule.include = [rule.include, include].filter(Boolean);
66-
}
67-
return rule;
68-
});
69-
70-
config.module.rules.push({
71-
test: /\.svg$/,
72-
enforce: 'pre',
73-
loader: require.resolve('@svgr/webpack'),
74-
});
75-
76-
// Required for Webpack 5
77-
config.resolve.fallback = {
78-
stream: require.resolve('stream-browserify'),
79-
buffer: require.resolve('buffer'),
80-
};
81-
config.plugins.push(
82-
new ProvidePlugin({
83-
process: 'process/browser',
84-
Buffer: ['buffer', 'Buffer'],
85-
}),
86-
);
87-
//
88-
89-
return config;
90-
},
91-
typescript: {
92-
check: false,
93-
checkOptions: {},
94-
reactDocgen: 'react-docgen-typescript',
95-
reactDocgenTypescriptOptions: {
96-
shouldExtractLiteralValuesFromEnum: true,
97-
propFilter: prop =>
98-
prop.parent ? !/node_modules/.test(prop.parent.fileName) : true,
99-
},
100-
},
101-
docs: {
102-
autodocs: false,
103-
source: { type: 'code' },
104-
},
105-
};
106-
107-
export default config;
1+
import main from '@lg-tools/storybook';
2+
export default main;

.storybook/manager.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { addons } from '@storybook/addons';
2-
import theme from './theme';
2+
3+
import theme from '@lg-tools/storybook/theme';
34

45
addons.setConfig({
56
name: 'LeafyGreen UI',

.storybook/preview.ts

+6-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
import ComponentPreview from './decorators/ComponentPreview';
2-
import ReactStrictMode from './decorators/ReactStrictMode';
3-
import PropCombinationsDecorator from './decorators/PropCombinations';
1+
import {
2+
ComponentPreview,
3+
ReactStrictMode,
4+
PropCombinations,
5+
} from '@lg-tools/storybook-decorators';
46

57
import {
68
storybookExcludedArgTypes,
@@ -60,11 +62,7 @@ const parameters = {
6062
},
6163
};
6264

63-
export const decorators = [
64-
PropCombinationsDecorator,
65-
ReactStrictMode,
66-
ComponentPreview,
67-
];
65+
export const decorators = [PropCombinations, ReactStrictMode, ComponentPreview];
6866

6967
const preview: Preview = {
7068
parameters,

package.json

+3-21
Original file line numberDiff line numberDiff line change
@@ -51,24 +51,9 @@
5151
"@leafygreen-ui/lib": "^10.1.0",
5252
"@leafygreen-ui/testing-lib": "*",
5353
"@lg-tools/build": "^0.0.1",
54+
"@lg-tools/storybook": "^0.0.1",
55+
"@lg-tools/storybook-decorators": "^0.0.1",
5456
"@slack/web-api": "^6.4.0",
55-
"@storybook/addon-a11y": "^7.0.11",
56-
"@storybook/addon-actions": "^7.0.11",
57-
"@storybook/addon-docs": "^7.0.11",
58-
"@storybook/addon-essentials": "^7.0.11",
59-
"@storybook/addon-interactions": "^7.0.20",
60-
"@storybook/addon-links": "^7.0.11",
61-
"@storybook/addon-mdx-gfm": "^7.0.11",
62-
"@storybook/addons": "^7.0.11",
63-
"@storybook/api": "^7.0.11",
64-
"@storybook/components": "^7.0.11",
65-
"@storybook/core-events": "^7.0.11",
66-
"@storybook/jest": "^0.1.0",
67-
"@storybook/react": "^7.0.11",
68-
"@storybook/react-webpack5": "^7.0.11",
69-
"@storybook/testing-library": "^0.1.0",
70-
"@storybook/theming": "^7.0.11",
71-
"@svgr/webpack": "^8.0.0",
7257
"@tanstack/react-table": "^8.7.3",
7358
"@types/facepaint": "^1.2.1",
7459
"@types/highlight.js": "^10.1.0",
@@ -100,7 +85,6 @@
10085
"eslint-plugin-react-hooks": "^4.2.0",
10186
"eslint-plugin-simple-import-sort": "^8.0.0",
10287
"eslint-plugin-storybook": "^0.6.12",
103-
"file-loader": "^6.0.0",
10488
"gh-pages": "^3.1.0",
10589
"highlight.js": "^11.0.0",
10690
"highlightjs-graphql": "^1.0.1",
@@ -120,12 +104,10 @@
120104
"regenerator-runtime": "^0.13.5",
121105
"source-map-loader": "^0.2.4",
122106
"storybook": "^7.0.11",
123-
"storybook-addon-performance": "^0.17.1",
124107
"stream-browserify": "^3.0.0",
125108
"ts-node": "^8.8.2",
126109
"turbo": "^1.10.3",
127-
"typescript": "^4.1.0",
128-
"url-loader": "4.1.0"
110+
"typescript": "^4.1.0"
129111
},
130112
"resolutions": {
131113
"caniuse-lite": "^1.0.30001135",

scripts/depcheck.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,12 @@ const ignoreFilePatterns: Array<RegExp> = [
4141
/.*\/dist\/.*/,
4242
];
4343

44-
// these dependencies will be ignored when imported or listed in a `package.json`
44+
// these dependencies will be ignored when listed in a package.json
4545
const ignoreMatches = [
4646
'@leafygreen-ui/mongo-nav',
4747
'prop-types',
48+
'@storybook/react',
49+
'@storybook/testing-library',
4850
'@testing-library/dom',
4951
'@testing-library/jest-dom',
5052
'@testing-library/react',
+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"name": "@lg-tools/storybook-decorators",
3+
"version": "0.0.1",
4+
"description": "Storybook decorators used in LeafyGreen repos",
5+
"main": "./dist/index.js",
6+
"module": "./dist/esm/index.js",
7+
"types": "./dist/index.d.ts",
8+
"license": "Apache-2.0",
9+
"scripts": {
10+
"build": "rollup --config rollup.config.mjs",
11+
"tsc": "tsc --build tsconfig.json"
12+
},
13+
"dependencies": {
14+
"@leafygreen-ui/banner": "^7.0.9",
15+
"@leafygreen-ui/emotion": "^4.0.4",
16+
"@leafygreen-ui/lib": "^10.3.0",
17+
"@leafygreen-ui/leafygreen-provider": "^3.1.3",
18+
"@leafygreen-ui/palette": "^4.0.4",
19+
"@leafygreen-ui/tokens": "^2.1.1",
20+
"@lg-tools/build": "^0.0.1",
21+
"@storybook/react": "^7.0.11",
22+
"lodash": "^4.17.21"
23+
}
24+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import config from '@lg-tools/build/config/rollup.config.mjs';
2+
export default config;

.storybook/decorators/ComponentPreview.tsx renamed to tools/storybook-decorators/src/decorators/ComponentPreview.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import React from 'react';
2+
import { Decorator, StoryContext, StoryFn } from '@storybook/react';
3+
24
import { css, cx } from '@leafygreen-ui/emotion';
35
import LeafyGreenProvider from '@leafygreen-ui/leafygreen-provider';
46
import { palette } from '@leafygreen-ui/palette';
5-
import { Decorator, StoryContext, StoryFn } from '@storybook/react';
7+
68
import { isGeneratedStory } from './PropCombinations';
79

810
const rootStyle = css`

.storybook/decorators/PropCombinations/PropCombinationsDecorator.tsx renamed to tools/storybook-decorators/src/decorators/PropCombinations/PropCombinationsDecorator.tsx

+5-4
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ import { Decorator, StoryContext, StoryFn } from '@storybook/react';
1414
import { entries, isUndefined } from 'lodash';
1515

1616
import {
17-
StoryType,
1817
type GeneratedStoryConfig,
1918
type StoryMetaType,
19+
StoryType,
2020
} from '@leafygreen-ui/lib';
2121

22-
import { generatedStoryWrapper } from './PropCombinations.styles';
2322
import { Err, PropCombinations } from './components';
24-
import { isGeneratedStory } from './utils';
2523
import { PARAM_NAME } from './constants';
24+
import { generatedStoryWrapper } from './PropCombinations.styles';
25+
import { isGeneratedStory } from './utils';
2626

2727
type ContextType<T extends React.ComponentType<any>> = StoryContext<T> &
2828
StoryMetaType<T>;
@@ -54,14 +54,15 @@ const PropCombinationsDecorator: Decorator = (
5454
args: generatedArgs,
5555
decorator,
5656
} = decoratorConfig;
57+
5758
if (isGeneratedStory(context)) {
5859
// Check for props
5960
if (!combineArgs || entries(combineArgs).length === 0) {
6061
return Err('`combineArgs` not found in story generation parameters.');
6162
}
6263

6364
// Remove from props any explicitly defined args
64-
for (let propName in { ...generatedArgs }) {
65+
for (const propName in { ...generatedArgs }) {
6566
if (combineArgs[propName]) {
6667
delete combineArgs[propName];
6768
}

.storybook/decorators/PropCombinations/components/Err.tsx renamed to tools/storybook-decorators/src/decorators/PropCombinations/components/Err.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React from 'react';
2+
23
import Banner from '@leafygreen-ui/banner';
34
import { css } from '@leafygreen-ui/emotion';
45

.storybook/decorators/PropCombinations/components/PropCombinations.tsx renamed to tools/storybook-decorators/src/decorators/PropCombinations/components/PropCombinations.tsx

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1+
/* eslint-disable no-console */
12
import React, { ReactElement } from 'react';
2-
import { entries } from 'lodash';
33
import { Args, StoryFn } from '@storybook/react';
4+
import { entries } from 'lodash';
45

56
import { cx } from '@leafygreen-ui/emotion';
67
import { GeneratedStoryConfig } from '@leafygreen-ui/lib';
78

8-
import { PropName } from '../utils/types';
9-
import { RecursiveCombinations } from '../utils/RecursiveCombinations';
10-
import { valStr, type PropCombination } from '../utils';
119
import {
1210
cellStyles,
1311
combinationDarkModeStyles,
@@ -16,6 +14,10 @@ import {
1614
instanceCellStyles,
1715
tableStyles,
1816
} from '../PropCombinations.styles';
17+
import { type PropCombination, valStr } from '../utils';
18+
import { RecursiveCombinations } from '../utils/RecursiveCombinations';
19+
import { PropName } from '../utils/types';
20+
1921
import { Instance } from './Instance';
2022

2123
/**

.storybook/decorators/PropCombinations/components/PropDetails.tsx renamed to tools/storybook-decorators/src/decorators/PropCombinations/components/PropDetails.tsx

-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
import React from 'react';
2-
import { cx } from '@leafygreen-ui/emotion';
32
import { PropsWithChildren } from 'react';
4-
import {
5-
combinationStyles,
6-
combinationStylesDarkModeProp,
7-
} from '../PropCombinations.styles';
83

94
export function PropDetailsComponent({
105
children,
@@ -18,7 +13,6 @@ export function PropDetailsComponent({
1813
const Wrapper = isDarkModeProp ? 'div' : React.Fragment;
1914
const wrapperProps = isDarkModeProp && {
2015
id: `${propName}-${val}`,
21-
className: cx(combinationStyles, combinationStylesDarkModeProp),
2216
};
2317

2418
return <Wrapper {...wrapperProps}>{children}</Wrapper>;
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
export { Err } from './Err';
2-
export { PropDetailsComponent } from './PropDetails';
32
export { PropCombinations } from './PropCombinations';
3+
export { PropDetailsComponent } from './PropDetails';
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1+
export { GENERATED_STORY_NAME, PARAM_NAME } from './constants';
12
export { default } from './PropCombinationsDecorator';
23
export { isGeneratedStory } from './utils';
3-
export { GENERATED_STORY_NAME, PARAM_NAME } from './constants';

.storybook/decorators/PropCombinations/utils/RecursiveCombinations.ts renamed to tools/storybook-decorators/src/decorators/PropCombinations/utils/RecursiveCombinations.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
import { GeneratedStoryConfig } from '@leafygreen-ui/lib';
21
import { keys } from 'lodash';
3-
import { shouldExcludePropCombo } from '.';
2+
3+
import { GeneratedStoryConfig } from '@leafygreen-ui/lib';
4+
45
import { PropCombination, PropName } from './types';
6+
import { shouldExcludePropCombo } from '.';
57

68
/**
79
* Recursively loop through all prop combinations defined in `vars`
@@ -15,6 +17,7 @@ export function RecursiveCombinations<T extends React.ComponentType<any>>(
1517
if (vars.length === 0 && keys(props).length > 0) {
1618
return [{ ...(props as PropCombination<T>) }];
1719
}
20+
1821
const [propName, propValues] = vars.pop()!;
1922

2023
if (propValues?.length) {
@@ -33,6 +36,7 @@ export function RecursiveCombinations<T extends React.ComponentType<any>>(
3336
exclude,
3437
);
3538
}
39+
3640
return [];
3741
});
3842
}
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
export { isGeneratedStory } from './isGeneratedStory';
22
export { shouldExcludePropCombo } from './shouldExcludePropCombo';
3+
export type { PropCombination, PropName } from './types';
34
export { valStr } from './valStr';
4-
export type { PropName, PropCombination } from './types';

0 commit comments

Comments
 (0)