@iress-oss/ids-storybook-config 0.1.3 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{IressStorybookContext-BUCfE_N-.js → IressStorybookContext-3jj2oZMh.js} +3 -1
- package/dist/components/CodeSandbox.d.ts +11 -0
- package/dist/helpers/withCustomSource.d.ts +8 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +565 -544
- package/dist/main.js +1 -1
- package/dist/preview.d.ts +6 -1
- package/dist/preview.js +97 -50
- package/package.json +4 -3
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { GetSandboxProps } from '@iress-oss/ids-storybook-sandbox';
|
|
2
|
+
export interface CodeSandboxProps extends GetSandboxProps {
|
|
3
|
+
/**
|
|
4
|
+
* The title to show on the redirect panel
|
|
5
|
+
*/
|
|
6
|
+
title?: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Component to redirect the user to a CodeSandbox URL within Storybook.
|
|
10
|
+
*/
|
|
11
|
+
export declare const CodeSandbox: ({ files, title }: CodeSandboxProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Uses the string as the custom source for the story, when the generated story source is not sufficient.
|
|
3
|
+
*
|
|
4
|
+
* @param code Code to use as the custom source, usually imported as a raw string from a file: import { code } from './file.tsx?raw';
|
|
5
|
+
* @param language Language of the code to ensure it is highlighted correctly when shown to the user
|
|
6
|
+
* @returns {Record<string, any>} the parameters with the custom source added, usually passed to the story
|
|
7
|
+
*/
|
|
8
|
+
export declare const withCustomSource: (code: string, language?: string) => Record<string, unknown>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export * from './components/CodeSandbox';
|
|
1
2
|
export * from './components/ComponentApi';
|
|
2
3
|
export * from './components/ComponentApiExpander';
|
|
3
4
|
export * from './components/ComponentExample';
|
|
@@ -12,6 +13,7 @@ export * from './helpers/disableArgTypes';
|
|
|
12
13
|
export * from './helpers/mergeStorybookConfig';
|
|
13
14
|
export * from './helpers/removeArgTypes';
|
|
14
15
|
export * from './helpers/stringifyStorybookArgs';
|
|
16
|
+
export * from './helpers/withCustomSource';
|
|
15
17
|
export * from './helpers/withJsxTransformer';
|
|
16
18
|
export * from './helpers/withTransformedSource';
|
|
17
19
|
export * from './constants';
|