@storybook/components 6.5.7-alpha.0 → 7.0.0-alpha.1
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/Color-GC2EERLU.mjs +1 -0
- package/dist/GlobalScrollAreaStyles-SBQA32UJ.mjs +1 -0
- package/dist/OverlayScrollbars-XXHHIFRP.mjs +6 -0
- package/dist/WithTooltip-2JKU54KI.mjs +9 -0
- package/dist/chunk-4HFE7HIP.mjs +6 -0
- package/dist/chunk-B5E6VV27.mjs +1 -0
- package/dist/chunk-HK5F4PFQ.mjs +1 -0
- package/dist/chunk-IE3SZHMD.mjs +1 -0
- package/dist/chunk-MGIUKE7Y.mjs +149 -0
- package/dist/chunk-SEEBCDLS.mjs +5 -0
- package/dist/chunk-X32VMURG.mjs +73 -0
- package/dist/chunk-XFP3TTPB.mjs +1 -0
- package/dist/chunk-YLDU3KBJ.mjs +1 -0
- package/dist/formatter-5ZDRIBVE.mjs +184 -0
- package/dist/html.d.ts +6 -0
- package/dist/html.js +352 -0
- package/dist/html.mjs +5 -0
- package/dist/index.d.ts +1144 -0
- package/dist/index.js +432 -0
- package/dist/index.mjs +1 -0
- package/dist/syntaxhighlighter-RDO7V73N.mjs +7 -0
- package/html.d.ts +1 -1
- package/html.js +1 -2
- package/package.json +31 -22
- package/dist/cjs/Color-90d9da2c.js +0 -2459
- package/dist/cjs/GlobalScrollAreaStyles-ff4bd929.js +0 -463
- package/dist/cjs/OverlayScrollbars-82979310.js +0 -6620
- package/dist/cjs/WithTooltip-60d59c62.js +0 -3166
- package/dist/cjs/formatter-adb74648.js +0 -128
- package/dist/cjs/index-97a2a5a9.js +0 -2060
- package/dist/cjs/index.js +0 -131
- package/dist/cjs/syntaxhighlighter-bc65a250.js +0 -211
- package/dist/esm/Color-01c31ae2.js +0 -2575
- package/dist/esm/GlobalScrollAreaStyles-8793ce4a.js +0 -461
- package/dist/esm/OverlayScrollbars-9b821cbe.js +0 -6709
- package/dist/esm/WithTooltip-2fc4c925.js +0 -3194
- package/dist/esm/formatter-9bb0ae57.js +0 -128
- package/dist/esm/index-3ae04fda.js +0 -2003
- package/dist/esm/index.js +0 -6
- package/dist/esm/syntaxhighlighter-b09267a2.js +0 -229
- package/dist/modern/Color-adcd690c.js +0 -2443
- package/dist/modern/GlobalScrollAreaStyles-8793ce4a.js +0 -450
- package/dist/modern/OverlayScrollbars-2dbee1e7.js +0 -6603
- package/dist/modern/WithTooltip-e676f2b3.js +0 -3125
- package/dist/modern/formatter-409edac5.js +0 -128
- package/dist/modern/index-377367fa.js +0 -2060
- package/dist/modern/index.js +0 -6
- package/dist/modern/syntaxhighlighter-a425409f.js +0 -157
- package/dist/ts-tmp/index.d.ts +0 -928
- package/dist/ts3.4/_modules/@popperjs-core-index.d.ts +0 -1
- package/dist/ts3.4/_modules/@popperjs-core-lib-createPopper.d.ts +0 -9
- package/dist/ts3.4/_modules/@popperjs-core-lib-enums.d.ts +0 -34
- package/dist/ts3.4/_modules/@popperjs-core-lib-index.d.ts +0 -6
- package/dist/ts3.4/_modules/@popperjs-core-lib-modifiers-applyStyles.d.ts +0 -4
- package/dist/ts3.4/_modules/@popperjs-core-lib-modifiers-arrow.d.ts +0 -13
- package/dist/ts3.4/_modules/@popperjs-core-lib-modifiers-computeStyles.d.ts +0 -38
- package/dist/ts3.4/_modules/@popperjs-core-lib-modifiers-eventListeners.d.ts +0 -8
- package/dist/ts3.4/_modules/@popperjs-core-lib-modifiers-flip.d.ts +0 -16
- package/dist/ts3.4/_modules/@popperjs-core-lib-modifiers-hide.d.ts +0 -4
- package/dist/ts3.4/_modules/@popperjs-core-lib-modifiers-index.d.ts +0 -9
- package/dist/ts3.4/_modules/@popperjs-core-lib-modifiers-offset.d.ts +0 -24
- package/dist/ts3.4/_modules/@popperjs-core-lib-modifiers-popperOffsets.d.ts +0 -4
- package/dist/ts3.4/_modules/@popperjs-core-lib-modifiers-preventOverflow.d.ts +0 -30
- package/dist/ts3.4/_modules/@popperjs-core-lib-popper-lite.d.ts +0 -5
- package/dist/ts3.4/_modules/@popperjs-core-lib-popper.d.ts +0 -7
- package/dist/ts3.4/_modules/@popperjs-core-lib-types.d.ts +0 -167
- package/dist/ts3.4/_modules/@popperjs-core-lib-utils-detectOverflow.d.ts +0 -11
- package/dist/ts3.4/_modules/@types-prettier-index.d.ts +0 -641
- package/dist/ts3.4/_modules/react-textarea-autosize-dist-declarations-src-index.d.ts +0 -17
- package/dist/ts3.4/_modules/react-textarea-autosize-dist-react-textarea-autosize.cjs.d.ts +0 -2
- package/dist/ts3.4/index.d.ts +0 -926
- package/dist/ts3.9/_modules/@popperjs-core-index.d.ts +0 -1
- package/dist/ts3.9/_modules/@popperjs-core-lib-createPopper.d.ts +0 -9
- package/dist/ts3.9/_modules/@popperjs-core-lib-enums.d.ts +0 -34
- package/dist/ts3.9/_modules/@popperjs-core-lib-index.d.ts +0 -6
- package/dist/ts3.9/_modules/@popperjs-core-lib-modifiers-applyStyles.d.ts +0 -4
- package/dist/ts3.9/_modules/@popperjs-core-lib-modifiers-arrow.d.ts +0 -13
- package/dist/ts3.9/_modules/@popperjs-core-lib-modifiers-computeStyles.d.ts +0 -38
- package/dist/ts3.9/_modules/@popperjs-core-lib-modifiers-eventListeners.d.ts +0 -8
- package/dist/ts3.9/_modules/@popperjs-core-lib-modifiers-flip.d.ts +0 -16
- package/dist/ts3.9/_modules/@popperjs-core-lib-modifiers-hide.d.ts +0 -4
- package/dist/ts3.9/_modules/@popperjs-core-lib-modifiers-index.d.ts +0 -9
- package/dist/ts3.9/_modules/@popperjs-core-lib-modifiers-offset.d.ts +0 -18
- package/dist/ts3.9/_modules/@popperjs-core-lib-modifiers-popperOffsets.d.ts +0 -4
- package/dist/ts3.9/_modules/@popperjs-core-lib-modifiers-preventOverflow.d.ts +0 -30
- package/dist/ts3.9/_modules/@popperjs-core-lib-popper-lite.d.ts +0 -5
- package/dist/ts3.9/_modules/@popperjs-core-lib-popper.d.ts +0 -7
- package/dist/ts3.9/_modules/@popperjs-core-lib-types.d.ts +0 -167
- package/dist/ts3.9/_modules/@popperjs-core-lib-utils-detectOverflow.d.ts +0 -11
- package/dist/ts3.9/_modules/@types-prettier-index.d.ts +0 -641
- package/dist/ts3.9/_modules/react-textarea-autosize-dist-declarations-src-index.d.ts +0 -17
- package/dist/ts3.9/_modules/react-textarea-autosize-dist-react-textarea-autosize.cjs.d.ts +0 -2
- package/dist/ts3.9/index.d.ts +0 -926
package/dist/modern/index.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import 'react';
|
|
2
|
-
export { E as A, A as ActionBar, ao as AddonPanel, aF as ArgsTable, aD as ArgsTableError, a3 as Badge, am as Bar, G as Blockquote, aV as BooleanControl, aa as Button, H as Code, aU as ColorControl, aQ as ColorItem, aR as ColorPalette, K as DL, a_ as DateControl, au as Description, J as Div, ax as DocsContent, az as DocsPageWrapper, ay as DocsWrapper, a5 as DocumentWrapper, b6 as FilesControl, an as FlexBar, F as Form, L as H1, M as H2, N as H3, O as H4, P as H5, Q as H6, R as HR, aO as IFrame, ai as IconButton, aT as IconGallery, aS as IconItem, I as Icons, U as Img, V as LI, a4 as Link, as as Loader, aH as NoControlsWarning, b1 as NumberControl, X as OL, b3 as ObjectControl, b2 as OptionsControl, Y as P, a8 as Placeholder, Z as Pre, aA as Preview, aB as PreviewSkeleton, b4 as RangeControl, S as ScrollArea, ak as Separator, aJ as Source, aI as SourceError, a7 as Spaced, $ as Span, aM as Story, aL as StoryError, aN as StorySkeleton, ar as StorybookIcon, aq as StorybookLogo, aK as StyledSyntaxHighlighter, aw as Subtitle, ap as Symbols, a6 as SyntaxHighlighter, a1 as TT, ag as TabBar, aj as TabButton, ah as TabWrapper, aG as TabbedArgsTable, a0 as Table, aC as TableWrapper, ae as Tabs, af as TabsState, b5 as TextControl, av as Title, ad as TooltipLinkList, ac as TooltipMessage, T as TooltipNote, aP as Typeset, a2 as UL, W as WithTooltip, ab as WithTooltipPure, a9 as Zoom, aE as argsTableLoadingData, C as components, b0 as format, aY as formatDate, aZ as formatTime, at as getStoryHref, al as interleaveSeparators, b7 as nameSpaceClassNames, a$ as parse, aW as parseDate, aX as parseTime, D as resetComponents } from './index-377367fa.js';
|
|
3
|
-
import '@storybook/theming';
|
|
4
|
-
import '@storybook/csf';
|
|
5
|
-
import 'qs';
|
|
6
|
-
import '@storybook/client-logger';
|
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
import { m as memoizerific, _ as __awaiter, S as ScrollArea, a as __rest, A as ActionBar, w as window_1 } from './index-377367fa.js';
|
|
2
|
-
import React__default, { useState, useCallback } from 'react';
|
|
3
|
-
import { logger } from '@storybook/client-logger';
|
|
4
|
-
import { styled } from '@storybook/theming';
|
|
5
|
-
import jsx from 'react-syntax-highlighter/dist/esm/languages/prism/jsx';
|
|
6
|
-
import bash from 'react-syntax-highlighter/dist/esm/languages/prism/bash';
|
|
7
|
-
import css from 'react-syntax-highlighter/dist/esm/languages/prism/css';
|
|
8
|
-
import jsExtras from 'react-syntax-highlighter/dist/esm/languages/prism/js-extras';
|
|
9
|
-
import json from 'react-syntax-highlighter/dist/esm/languages/prism/json';
|
|
10
|
-
import graphql from 'react-syntax-highlighter/dist/esm/languages/prism/graphql';
|
|
11
|
-
import html from 'react-syntax-highlighter/dist/esm/languages/prism/markup';
|
|
12
|
-
import md from 'react-syntax-highlighter/dist/esm/languages/prism/markdown';
|
|
13
|
-
import yml from 'react-syntax-highlighter/dist/esm/languages/prism/yaml';
|
|
14
|
-
import tsx from 'react-syntax-highlighter/dist/esm/languages/prism/tsx';
|
|
15
|
-
import typescript from 'react-syntax-highlighter/dist/esm/languages/prism/typescript';
|
|
16
|
-
import ReactSyntaxHighlighter from 'react-syntax-highlighter/dist/esm/prism-light';
|
|
17
|
-
import '@storybook/csf';
|
|
18
|
-
import 'qs';
|
|
19
|
-
const {
|
|
20
|
-
navigator,
|
|
21
|
-
document,
|
|
22
|
-
window: globalWindow
|
|
23
|
-
} = window_1;
|
|
24
|
-
ReactSyntaxHighlighter.registerLanguage('jsextra', jsExtras);
|
|
25
|
-
ReactSyntaxHighlighter.registerLanguage('jsx', jsx);
|
|
26
|
-
ReactSyntaxHighlighter.registerLanguage('json', json);
|
|
27
|
-
ReactSyntaxHighlighter.registerLanguage('yml', yml);
|
|
28
|
-
ReactSyntaxHighlighter.registerLanguage('md', md);
|
|
29
|
-
ReactSyntaxHighlighter.registerLanguage('bash', bash);
|
|
30
|
-
ReactSyntaxHighlighter.registerLanguage('css', css);
|
|
31
|
-
ReactSyntaxHighlighter.registerLanguage('html', html);
|
|
32
|
-
ReactSyntaxHighlighter.registerLanguage('tsx', tsx);
|
|
33
|
-
ReactSyntaxHighlighter.registerLanguage('typescript', typescript);
|
|
34
|
-
ReactSyntaxHighlighter.registerLanguage('graphql', graphql);
|
|
35
|
-
const themedSyntax = memoizerific(2)(theme => Object.entries(theme.code || {}).reduce((acc, [key, val]) => Object.assign(Object.assign({}, acc), {
|
|
36
|
-
[`* .${key}`]: val
|
|
37
|
-
}), {}));
|
|
38
|
-
const copyToClipboard = createCopyToClipboardFunction();
|
|
39
|
-
|
|
40
|
-
function createCopyToClipboardFunction() {
|
|
41
|
-
if (navigator === null || navigator === void 0 ? void 0 : navigator.clipboard) {
|
|
42
|
-
return text => navigator.clipboard.writeText(text);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
return text => __awaiter(this, void 0, void 0, function* () {
|
|
46
|
-
const tmp = document.createElement('TEXTAREA');
|
|
47
|
-
const focus = document.activeElement;
|
|
48
|
-
tmp.value = text;
|
|
49
|
-
document.body.appendChild(tmp);
|
|
50
|
-
tmp.select();
|
|
51
|
-
document.execCommand('copy');
|
|
52
|
-
document.body.removeChild(tmp);
|
|
53
|
-
focus.focus();
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
const Wrapper = styled.div(({
|
|
58
|
-
theme
|
|
59
|
-
}) => ({
|
|
60
|
-
position: 'relative',
|
|
61
|
-
overflow: 'hidden',
|
|
62
|
-
color: theme.color.defaultText
|
|
63
|
-
}), ({
|
|
64
|
-
theme,
|
|
65
|
-
bordered
|
|
66
|
-
}) => bordered ? {
|
|
67
|
-
border: `1px solid ${theme.appBorderColor}`,
|
|
68
|
-
borderRadius: theme.borderRadius,
|
|
69
|
-
background: theme.background.content
|
|
70
|
-
} : {});
|
|
71
|
-
const Scroller = styled(({
|
|
72
|
-
children,
|
|
73
|
-
className
|
|
74
|
-
}) => React__default.createElement(ScrollArea, {
|
|
75
|
-
horizontal: true,
|
|
76
|
-
vertical: true,
|
|
77
|
-
className: className
|
|
78
|
-
}, children))({
|
|
79
|
-
position: 'relative'
|
|
80
|
-
}, ({
|
|
81
|
-
theme
|
|
82
|
-
}) => themedSyntax(theme));
|
|
83
|
-
const Pre = styled.pre(({
|
|
84
|
-
theme,
|
|
85
|
-
padded
|
|
86
|
-
}) => ({
|
|
87
|
-
display: 'flex',
|
|
88
|
-
justifyContent: 'flex-start',
|
|
89
|
-
margin: 0,
|
|
90
|
-
padding: padded ? theme.layoutMargin : 0
|
|
91
|
-
}));
|
|
92
|
-
/*
|
|
93
|
-
We can't use `code` since PrismJS races for it.
|
|
94
|
-
See https://github.com/storybookjs/storybook/issues/18090
|
|
95
|
-
*/
|
|
96
|
-
|
|
97
|
-
const Code = styled.div(({
|
|
98
|
-
theme
|
|
99
|
-
}) => ({
|
|
100
|
-
flex: 1,
|
|
101
|
-
paddingLeft: 2,
|
|
102
|
-
paddingRight: theme.layoutMargin,
|
|
103
|
-
opacity: 1
|
|
104
|
-
})); // copied from @types/react-syntax-highlighter/index.d.ts
|
|
105
|
-
|
|
106
|
-
const SyntaxHighlighter = _a => {
|
|
107
|
-
var {
|
|
108
|
-
children,
|
|
109
|
-
language = 'jsx',
|
|
110
|
-
copyable = false,
|
|
111
|
-
bordered = false,
|
|
112
|
-
padded = false,
|
|
113
|
-
format = true,
|
|
114
|
-
formatter = null,
|
|
115
|
-
className = null,
|
|
116
|
-
showLineNumbers = false
|
|
117
|
-
} = _a,
|
|
118
|
-
rest = __rest(_a, ["children", "language", "copyable", "bordered", "padded", "format", "formatter", "className", "showLineNumbers"]);
|
|
119
|
-
|
|
120
|
-
if (typeof children !== 'string' || !children.trim()) {
|
|
121
|
-
return null;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
const highlightableCode = formatter ? formatter(format, children) : children.trim();
|
|
125
|
-
const [copied, setCopied] = useState(false);
|
|
126
|
-
const onClick = useCallback(e => {
|
|
127
|
-
e.preventDefault();
|
|
128
|
-
const selectedText = globalWindow.getSelection().toString();
|
|
129
|
-
const textToCopy = e.type !== 'click' && selectedText ? selectedText : highlightableCode;
|
|
130
|
-
copyToClipboard(textToCopy).then(() => {
|
|
131
|
-
setCopied(true);
|
|
132
|
-
globalWindow.setTimeout(() => setCopied(false), 1500);
|
|
133
|
-
}).catch(logger.error);
|
|
134
|
-
}, []);
|
|
135
|
-
return React__default.createElement(Wrapper, {
|
|
136
|
-
bordered: bordered,
|
|
137
|
-
padded: padded,
|
|
138
|
-
className: className,
|
|
139
|
-
onCopyCapture: onClick
|
|
140
|
-
}, React__default.createElement(Scroller, null, React__default.createElement(ReactSyntaxHighlighter, Object.assign({
|
|
141
|
-
padded: padded || bordered,
|
|
142
|
-
language: language,
|
|
143
|
-
showLineNumbers: showLineNumbers,
|
|
144
|
-
showInlineLineNumbers: showLineNumbers,
|
|
145
|
-
useInlineStyles: false,
|
|
146
|
-
PreTag: Pre,
|
|
147
|
-
CodeTag: Code,
|
|
148
|
-
lineNumberContainerStyle: {}
|
|
149
|
-
}, rest), highlightableCode)), copyable ? React__default.createElement(ActionBar, {
|
|
150
|
-
actionItems: [{
|
|
151
|
-
title: copied ? 'Copied' : 'Copy',
|
|
152
|
-
onClick
|
|
153
|
-
}]
|
|
154
|
-
}) : null);
|
|
155
|
-
};
|
|
156
|
-
|
|
157
|
-
export { SyntaxHighlighter, createCopyToClipboardFunction, SyntaxHighlighter as default };
|