@storybook/components 6.4.0-beta.3 → 6.4.0-beta.33
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/cjs/ActionBar/ActionBar.stories.js +7 -7
- package/dist/cjs/ScrollArea/GlobalScrollAreaStyles.js +1 -1
- package/dist/cjs/ScrollArea/ScrollArea.stories.js +13 -13
- package/dist/cjs/Zoom/Zoom.stories.js +22 -22
- package/dist/cjs/bar/bar.js +5 -3
- package/dist/cjs/bar/button.js +64 -26
- package/dist/cjs/bar/button.stories.js +90 -0
- package/dist/cjs/bar/separator.js +4 -2
- package/dist/cjs/blocks/ArgsTable/ArgRow.js +18 -6
- package/dist/cjs/blocks/ArgsTable/ArgRow.stories.js +6 -1
- package/dist/cjs/blocks/ArgsTable/ArgsTable.js +125 -32
- package/dist/cjs/blocks/ArgsTable/ArgsTable.stories.js +6 -1
- package/dist/cjs/blocks/ColorPalette.stories.js +4 -4
- package/dist/cjs/blocks/DocsPage.stories.js +9 -2
- package/dist/cjs/blocks/EmptyBlock.stories.js +4 -4
- package/dist/cjs/blocks/IconGallery.stories.js +4 -4
- package/dist/cjs/blocks/Preview.js +13 -2
- package/dist/cjs/blocks/Preview.stories.js +8 -1
- package/dist/cjs/blocks/Source.js +57 -8
- package/dist/cjs/blocks/Source.stories.js +11 -1
- package/dist/cjs/blocks/Story.js +11 -2
- package/dist/cjs/blocks/Story.stories.js +11 -1
- package/dist/cjs/blocks/Typeset.stories.js +13 -13
- package/dist/cjs/brand/StorybookLogo.stories.js +4 -4
- package/dist/cjs/icon/icons.js +2 -0
- package/dist/cjs/placeholder/placeholder.stories.js +7 -7
- package/dist/cjs/tabs/tabs.js +1 -1
- package/dist/cjs/tooltip/TooltipNote.js +1 -1
- package/dist/cjs/typography/DocumentFormatting.js +15 -4
- package/dist/cjs/typography/DocumentWrapper.stories.js +7 -7
- package/dist/cjs/typography/link/link.js +2 -2
- package/dist/cjs/typography/typography.stories.mdx +75 -0
- package/dist/esm/ActionBar/ActionBar.stories.js +4 -4
- package/dist/esm/ScrollArea/GlobalScrollAreaStyles.js +1 -1
- package/dist/esm/ScrollArea/ScrollArea.stories.js +8 -8
- package/dist/esm/Zoom/Zoom.stories.js +15 -15
- package/dist/esm/bar/bar.js +5 -3
- package/dist/esm/bar/button.js +56 -25
- package/dist/esm/bar/button.stories.js +56 -0
- package/dist/esm/bar/separator.js +4 -2
- package/dist/esm/blocks/ArgsTable/ArgRow.js +15 -5
- package/dist/esm/blocks/ArgsTable/ArgRow.stories.js +4 -0
- package/dist/esm/blocks/ArgsTable/ArgsTable.js +123 -32
- package/dist/esm/blocks/ArgsTable/ArgsTable.stories.js +4 -0
- package/dist/esm/blocks/ColorPalette.stories.js +2 -2
- package/dist/esm/blocks/DocsPage.stories.js +5 -1
- package/dist/esm/blocks/EmptyBlock.stories.js +2 -2
- package/dist/esm/blocks/IconGallery.stories.js +2 -2
- package/dist/esm/blocks/Preview.js +8 -3
- package/dist/esm/blocks/Preview.stories.js +5 -1
- package/dist/esm/blocks/Source.js +56 -8
- package/dist/esm/blocks/Source.stories.js +7 -0
- package/dist/esm/blocks/Story.js +7 -1
- package/dist/esm/blocks/Story.stories.js +8 -1
- package/dist/esm/blocks/Typeset.stories.js +8 -8
- package/dist/esm/brand/StorybookLogo.stories.js +2 -2
- package/dist/esm/icon/icons.js +2 -0
- package/dist/esm/placeholder/placeholder.stories.js +4 -4
- package/dist/esm/tabs/tabs.js +1 -1
- package/dist/esm/tooltip/TooltipNote.js +1 -1
- package/dist/esm/typography/DocumentFormatting.js +12 -3
- package/dist/esm/typography/DocumentWrapper.stories.js +4 -4
- package/dist/esm/typography/link/link.js +2 -2
- package/dist/esm/typography/typography.stories.mdx +75 -0
- package/dist/modern/ActionBar/ActionBar.stories.js +4 -4
- package/dist/modern/ScrollArea/GlobalScrollAreaStyles.js +1 -1
- package/dist/modern/ScrollArea/ScrollArea.stories.js +8 -8
- package/dist/modern/Zoom/Zoom.stories.js +15 -15
- package/dist/modern/bar/bar.js +5 -3
- package/dist/modern/bar/button.js +48 -24
- package/dist/modern/bar/button.stories.js +42 -0
- package/dist/modern/bar/separator.js +4 -2
- package/dist/modern/blocks/ArgsTable/ArgRow.js +9 -1
- package/dist/modern/blocks/ArgsTable/ArgRow.stories.js +4 -0
- package/dist/modern/blocks/ArgsTable/ArgsTable.js +99 -12
- package/dist/modern/blocks/ArgsTable/ArgsTable.stories.js +4 -0
- package/dist/modern/blocks/ColorPalette.stories.js +2 -2
- package/dist/modern/blocks/DocsPage.stories.js +3 -1
- package/dist/modern/blocks/EmptyBlock.stories.js +2 -2
- package/dist/modern/blocks/IconGallery.stories.js +2 -2
- package/dist/modern/blocks/Preview.js +6 -3
- package/dist/modern/blocks/Preview.stories.js +3 -1
- package/dist/modern/blocks/Source.js +44 -0
- package/dist/modern/blocks/Source.stories.js +5 -0
- package/dist/modern/blocks/Story.js +5 -1
- package/dist/modern/blocks/Story.stories.js +6 -1
- package/dist/modern/blocks/Typeset.stories.js +8 -8
- package/dist/modern/brand/StorybookLogo.stories.js +2 -2
- package/dist/modern/icon/icons.js +2 -0
- package/dist/modern/placeholder/placeholder.stories.js +4 -4
- package/dist/modern/tabs/tabs.js +1 -1
- package/dist/modern/tooltip/TooltipNote.js +1 -1
- package/dist/modern/typography/DocumentFormatting.js +7 -2
- package/dist/modern/typography/DocumentWrapper.stories.js +4 -4
- package/dist/modern/typography/link/link.js +2 -2
- package/dist/modern/typography/typography.stories.mdx +75 -0
- package/dist/ts3.4/ScrollArea/GlobalScrollAreaStyles.d.ts +1 -0
- package/dist/ts3.4/bar/button.d.ts +2 -0
- package/dist/ts3.4/blocks/ArgsTable/ArgRow.d.ts +7 -1
- package/dist/ts3.4/blocks/ArgsTable/ArgsTable.d.ts +8 -2
- package/dist/ts3.4/blocks/ArgsTable/NoControlsWarning.d.ts +1 -0
- package/dist/ts3.4/blocks/EmptyBlock.d.ts +1 -0
- package/dist/ts3.4/blocks/Preview.d.ts +2 -2
- package/dist/ts3.4/blocks/Source.d.ts +1 -0
- package/dist/ts3.4/blocks/Story.d.ts +4 -3
- package/dist/ts3.4/icon/icons.d.ts +2 -0
- package/dist/ts3.9/ScrollArea/GlobalScrollAreaStyles.d.ts +1 -0
- package/dist/ts3.9/bar/button.d.ts +2 -0
- package/dist/ts3.9/blocks/ArgsTable/ArgRow.d.ts +7 -1
- package/dist/ts3.9/blocks/ArgsTable/ArgsTable.d.ts +8 -2
- package/dist/ts3.9/blocks/ArgsTable/NoControlsWarning.d.ts +1 -0
- package/dist/ts3.9/blocks/EmptyBlock.d.ts +1 -0
- package/dist/ts3.9/blocks/Preview.d.ts +2 -2
- package/dist/ts3.9/blocks/Source.d.ts +1 -0
- package/dist/ts3.9/blocks/Story.d.ts +4 -3
- package/dist/ts3.9/icon/icons.d.ts +2 -0
- package/package.json +5 -5
- package/dist/cjs/typography/typography.stories.js +0 -130
- package/dist/esm/typography/typography.stories.js +0 -106
- package/dist/modern/typography/typography.stories.js +0 -91
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IconButton, IconButtonSkeleton } from './button';
|
|
3
|
+
import { Icons } from '../icon/icon';
|
|
4
|
+
export default {
|
|
5
|
+
component: IconButton,
|
|
6
|
+
title: 'Basics/IconButton'
|
|
7
|
+
};
|
|
8
|
+
export var Loading = function Loading() {
|
|
9
|
+
return /*#__PURE__*/React.createElement(IconButtonSkeleton, null);
|
|
10
|
+
};
|
|
11
|
+
Loading.displayName = "Loading";
|
|
12
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
13
|
+
export var _IconButton = function _IconButton() {
|
|
14
|
+
return /*#__PURE__*/React.createElement(IconButton, null, /*#__PURE__*/React.createElement(Icons, {
|
|
15
|
+
icon: "bookmark"
|
|
16
|
+
}));
|
|
17
|
+
};
|
|
18
|
+
_IconButton.displayName = "_IconButton";
|
|
19
|
+
export var Active = function Active() {
|
|
20
|
+
return /*#__PURE__*/React.createElement(IconButton, {
|
|
21
|
+
active: true
|
|
22
|
+
}, /*#__PURE__*/React.createElement(Icons, {
|
|
23
|
+
icon: "beaker"
|
|
24
|
+
}));
|
|
25
|
+
};
|
|
26
|
+
Active.displayName = "Active";
|
|
27
|
+
export var Disabled = function Disabled() {
|
|
28
|
+
return /*#__PURE__*/React.createElement(IconButton, {
|
|
29
|
+
disabled: true
|
|
30
|
+
}, /*#__PURE__*/React.createElement(Icons, {
|
|
31
|
+
icon: "beaker"
|
|
32
|
+
}));
|
|
33
|
+
};
|
|
34
|
+
Disabled.displayName = "Disabled";
|
|
35
|
+
export var WithText = function WithText() {
|
|
36
|
+
return /*#__PURE__*/React.createElement(IconButton, null, /*#__PURE__*/React.createElement(Icons, {
|
|
37
|
+
icon: "circlehollow"
|
|
38
|
+
}), "\xA0Howdy!");
|
|
39
|
+
};
|
|
40
|
+
WithText.displayName = "WithText";
|
|
41
|
+
export var WithTextActive = function WithTextActive() {
|
|
42
|
+
return /*#__PURE__*/React.createElement(IconButton, {
|
|
43
|
+
active: true
|
|
44
|
+
}, /*#__PURE__*/React.createElement(Icons, {
|
|
45
|
+
icon: "circlehollow"
|
|
46
|
+
}), "\xA0Howdy!");
|
|
47
|
+
};
|
|
48
|
+
WithTextActive.displayName = "WithTextActive";
|
|
49
|
+
export var WithTextDisabled = function WithTextDisabled() {
|
|
50
|
+
return /*#__PURE__*/React.createElement(IconButton, {
|
|
51
|
+
disabled: true
|
|
52
|
+
}, /*#__PURE__*/React.createElement(Icons, {
|
|
53
|
+
icon: "circlehollow"
|
|
54
|
+
}), "\xA0Howdy!");
|
|
55
|
+
};
|
|
56
|
+
WithTextDisabled.displayName = "WithTextDisabled";
|
|
@@ -4,9 +4,11 @@ export var Separator = styled.span(function (_ref) {
|
|
|
4
4
|
var theme = _ref.theme;
|
|
5
5
|
return {
|
|
6
6
|
width: 1,
|
|
7
|
-
height:
|
|
7
|
+
height: 20,
|
|
8
8
|
background: theme.appBorderColor,
|
|
9
|
-
marginTop:
|
|
9
|
+
marginTop: 10,
|
|
10
|
+
marginLeft: 6,
|
|
11
|
+
marginRight: 2
|
|
10
12
|
};
|
|
11
13
|
}, function (_ref2) {
|
|
12
14
|
var force = _ref2.force;
|
|
@@ -10,6 +10,13 @@ import { ArgJsDoc } from './ArgJsDoc';
|
|
|
10
10
|
import { ArgValue } from './ArgValue';
|
|
11
11
|
import { ArgControl } from './ArgControl';
|
|
12
12
|
import { codeCommon } from '../../typography/shared';
|
|
13
|
+
export var argRowLoadingData = {
|
|
14
|
+
row: {
|
|
15
|
+
name: 'loading',
|
|
16
|
+
description: 'loading'
|
|
17
|
+
},
|
|
18
|
+
arg: 0
|
|
19
|
+
};
|
|
13
20
|
var Name = styled.span({
|
|
14
21
|
fontWeight: 'bold'
|
|
15
22
|
});
|
|
@@ -74,11 +81,14 @@ var StyledTd = styled.td(function (_ref5) {
|
|
|
74
81
|
export var ArgRow = function ArgRow(props) {
|
|
75
82
|
var _row$type;
|
|
76
83
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
84
|
+
// const isLoading = 'isLoading' in props;
|
|
85
|
+
var _ref6 = 'row' in props ? props : argRowLoadingData,
|
|
86
|
+
row = _ref6.row,
|
|
87
|
+
updateArgs = _ref6.updateArgs,
|
|
88
|
+
compact = _ref6.compact,
|
|
89
|
+
expandable = _ref6.expandable,
|
|
90
|
+
initialExpandedArgs = _ref6.initialExpandedArgs;
|
|
91
|
+
|
|
82
92
|
var name = row.name,
|
|
83
93
|
description = row.description;
|
|
84
94
|
var table = row.table || {};
|
|
@@ -20,6 +20,10 @@ Template.displayName = "Template";
|
|
|
20
20
|
var baseArgs = {
|
|
21
21
|
updateArgs: action('updateArgs')
|
|
22
22
|
};
|
|
23
|
+
export var Loading = Template.bind({});
|
|
24
|
+
Loading.args = {
|
|
25
|
+
isLoading: true
|
|
26
|
+
};
|
|
23
27
|
export var String = Template.bind({});
|
|
24
28
|
String.args = Object.assign({}, baseArgs, {
|
|
25
29
|
row: {
|
|
@@ -36,7 +36,7 @@ import pickBy from 'lodash/pickBy';
|
|
|
36
36
|
import { styled, ignoreSsrWarning } from '@storybook/theming';
|
|
37
37
|
import { opacify, transparentize, darken, lighten } from 'polished';
|
|
38
38
|
import { Icons } from '../../icon/icon';
|
|
39
|
-
import { ArgRow } from './ArgRow';
|
|
39
|
+
import { ArgRow, argRowLoadingData } from './ArgRow';
|
|
40
40
|
import { SectionRow } from './SectionRow';
|
|
41
41
|
import { EmptyBlock } from '../EmptyBlock';
|
|
42
42
|
import { Link } from '../../typography/link/link';
|
|
@@ -206,6 +206,13 @@ var sortFns = {
|
|
|
206
206
|
},
|
|
207
207
|
none: undefined
|
|
208
208
|
};
|
|
209
|
+
export var argTableLoadingData = {
|
|
210
|
+
rows: {
|
|
211
|
+
row1: argRowLoadingData.row,
|
|
212
|
+
row2: argRowLoadingData.row,
|
|
213
|
+
row3: argRowLoadingData.row
|
|
214
|
+
}
|
|
215
|
+
};
|
|
209
216
|
|
|
210
217
|
var groupRows = function groupRows(rows, sort) {
|
|
211
218
|
var sections = {
|
|
@@ -278,34 +285,118 @@ var groupRows = function groupRows(rows, sort) {
|
|
|
278
285
|
};
|
|
279
286
|
return sorted;
|
|
280
287
|
};
|
|
288
|
+
|
|
289
|
+
var SkeletonHeader = styled.div(function (_ref7) {
|
|
290
|
+
var theme = _ref7.theme;
|
|
291
|
+
return {
|
|
292
|
+
alignContent: 'stretch',
|
|
293
|
+
display: 'flex',
|
|
294
|
+
gap: 16,
|
|
295
|
+
marginTop: 25,
|
|
296
|
+
padding: '10px 20px',
|
|
297
|
+
div: {
|
|
298
|
+
animation: "".concat(theme.animation.glow, " 1.5s ease-in-out infinite"),
|
|
299
|
+
background: theme.appBorderColor,
|
|
300
|
+
flexShrink: 0,
|
|
301
|
+
height: 20,
|
|
302
|
+
'&:first-child, &:nth-child(4)': {
|
|
303
|
+
width: '20%'
|
|
304
|
+
},
|
|
305
|
+
'&:nth-child(2)': {
|
|
306
|
+
width: '30%'
|
|
307
|
+
},
|
|
308
|
+
'&:nth-child(3)': {
|
|
309
|
+
flexGrow: 1
|
|
310
|
+
},
|
|
311
|
+
'&:last-child': {
|
|
312
|
+
width: 30
|
|
313
|
+
},
|
|
314
|
+
'@media ( max-width: 500px )': {
|
|
315
|
+
'&:nth-child( n + 4 )': {
|
|
316
|
+
display: 'none'
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
};
|
|
321
|
+
});
|
|
322
|
+
var SkeletonBody = styled.div(function (_ref8) {
|
|
323
|
+
var theme = _ref8.theme;
|
|
324
|
+
return {
|
|
325
|
+
background: theme.background.content,
|
|
326
|
+
boxShadow: theme.base === 'light' ? "rgba(0, 0, 0, 0.10) 0 1px 3px 1px,\n ".concat(transparentize(0.035, theme.appBorderColor), " 0 0 0 1px") : "rgba(0, 0, 0, 0.20) 0 2px 5px 1px,\n ".concat(opacify(0.05, theme.appBorderColor), " 0 0 0 1px"),
|
|
327
|
+
borderRadius: theme.appBorderRadius,
|
|
328
|
+
'> div': {
|
|
329
|
+
alignContent: 'stretch',
|
|
330
|
+
borderTopColor: theme.base === 'light' ? darken(0.1, theme.background.content) : lighten(0.05, theme.background.content),
|
|
331
|
+
borderTopStyle: 'solid',
|
|
332
|
+
borderTopWidth: 1,
|
|
333
|
+
display: 'flex',
|
|
334
|
+
gap: 16,
|
|
335
|
+
padding: 20,
|
|
336
|
+
'&:first-child': {
|
|
337
|
+
borderTop: 0
|
|
338
|
+
}
|
|
339
|
+
},
|
|
340
|
+
'> div div': {
|
|
341
|
+
animation: "".concat(theme.animation.glow, " 1.5s ease-in-out infinite"),
|
|
342
|
+
background: theme.appBorderColor,
|
|
343
|
+
flexShrink: 0,
|
|
344
|
+
height: 20,
|
|
345
|
+
'&:first-child': {
|
|
346
|
+
width: '20%'
|
|
347
|
+
},
|
|
348
|
+
'&:nth-child(2)': {
|
|
349
|
+
width: '30%'
|
|
350
|
+
},
|
|
351
|
+
'&:nth-child(3)': {
|
|
352
|
+
flexGrow: 1
|
|
353
|
+
},
|
|
354
|
+
'&:last-child': {
|
|
355
|
+
width: 'calc(20% + 47px)',
|
|
356
|
+
'@media ( max-width: 500px )': {
|
|
357
|
+
display: 'none'
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
};
|
|
362
|
+
});
|
|
363
|
+
|
|
364
|
+
var Skeleton = function Skeleton() {
|
|
365
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(SkeletonHeader, null, /*#__PURE__*/React.createElement("div", null), /*#__PURE__*/React.createElement("div", null), /*#__PURE__*/React.createElement("div", null), /*#__PURE__*/React.createElement("div", null), /*#__PURE__*/React.createElement("div", null)), /*#__PURE__*/React.createElement(SkeletonBody, null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", null), /*#__PURE__*/React.createElement("div", null), /*#__PURE__*/React.createElement("div", null), /*#__PURE__*/React.createElement("div", null)), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", null), /*#__PURE__*/React.createElement("div", null), /*#__PURE__*/React.createElement("div", null), /*#__PURE__*/React.createElement("div", null)), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", null), /*#__PURE__*/React.createElement("div", null), /*#__PURE__*/React.createElement("div", null), /*#__PURE__*/React.createElement("div", null))));
|
|
366
|
+
};
|
|
367
|
+
|
|
368
|
+
Skeleton.displayName = "Skeleton";
|
|
369
|
+
|
|
281
370
|
/**
|
|
282
371
|
* Display the props for a component as a props table. Each row is a collection of
|
|
283
372
|
* ArgDefs, usually derived from docgen info for the component.
|
|
284
373
|
*/
|
|
285
|
-
|
|
286
|
-
|
|
287
374
|
export var ArgsTable = function ArgsTable(props) {
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
if (error) {
|
|
292
|
-
return /*#__PURE__*/React.createElement(EmptyBlock, null, error, "\xA0", /*#__PURE__*/React.createElement(Link, {
|
|
375
|
+
if ('error' in props) {
|
|
376
|
+
return /*#__PURE__*/React.createElement(EmptyBlock, null, props.error, "\xA0", /*#__PURE__*/React.createElement(Link, {
|
|
293
377
|
href: "http://storybook.js.org/docs/",
|
|
294
378
|
target: "_blank",
|
|
295
379
|
withArrow: true
|
|
296
380
|
}, "Read the docs"));
|
|
297
381
|
}
|
|
298
382
|
|
|
299
|
-
var
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
383
|
+
var isLoading = ('isLoading' in props);
|
|
384
|
+
|
|
385
|
+
var _ref9 = 'rows' in props ? props : argTableLoadingData,
|
|
386
|
+
rows = _ref9.rows,
|
|
387
|
+
args = _ref9.args,
|
|
388
|
+
updateArgs = _ref9.updateArgs,
|
|
389
|
+
resetArgs = _ref9.resetArgs,
|
|
390
|
+
compact = _ref9.compact,
|
|
391
|
+
inAddonPanel = _ref9.inAddonPanel,
|
|
392
|
+
initialExpandedArgs = _ref9.initialExpandedArgs,
|
|
393
|
+
_ref9$sort = _ref9.sort,
|
|
394
|
+
sort = _ref9$sort === void 0 ? 'none' : _ref9$sort;
|
|
395
|
+
|
|
396
|
+
if (isLoading) {
|
|
397
|
+
return /*#__PURE__*/React.createElement(Skeleton, null);
|
|
398
|
+
}
|
|
399
|
+
|
|
309
400
|
var groups = groupRows(pickBy(rows, function (row) {
|
|
310
401
|
var _row$table;
|
|
311
402
|
|
|
@@ -336,7 +427,7 @@ export var ArgsTable = function ArgsTable(props) {
|
|
|
336
427
|
className: "docblock-argstable"
|
|
337
428
|
}, /*#__PURE__*/React.createElement("thead", {
|
|
338
429
|
className: "docblock-argstable-head"
|
|
339
|
-
}, /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("th", null, "Name"), compact
|
|
430
|
+
}, /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("th", null, "Name"), compact || /*#__PURE__*/React.createElement("th", null, "Description"), compact || /*#__PURE__*/React.createElement("th", null, "Default"), updateArgs && /*#__PURE__*/React.createElement("th", null, /*#__PURE__*/React.createElement(ControlHeadingWrapper, null, "Control", ' ', resetArgs && /*#__PURE__*/React.createElement(ResetButton, {
|
|
340
431
|
onClick: function onClick() {
|
|
341
432
|
return resetArgs();
|
|
342
433
|
},
|
|
@@ -344,7 +435,7 @@ export var ArgsTable = function ArgsTable(props) {
|
|
|
344
435
|
}, /*#__PURE__*/React.createElement(Icons, {
|
|
345
436
|
icon: "undo",
|
|
346
437
|
"aria-hidden": true
|
|
347
|
-
}))))
|
|
438
|
+
})))), null)), /*#__PURE__*/React.createElement("tbody", {
|
|
348
439
|
className: "docblock-argstable-body"
|
|
349
440
|
}, groups.ungrouped.map(function (row) {
|
|
350
441
|
return /*#__PURE__*/React.createElement(ArgRow, _extends({
|
|
@@ -352,10 +443,10 @@ export var ArgsTable = function ArgsTable(props) {
|
|
|
352
443
|
row: row,
|
|
353
444
|
arg: args && args[row.key]
|
|
354
445
|
}, common));
|
|
355
|
-
}), Object.entries(groups.ungroupedSubsections).map(function (
|
|
356
|
-
var
|
|
357
|
-
subcategory =
|
|
358
|
-
subsection =
|
|
446
|
+
}), Object.entries(groups.ungroupedSubsections).map(function (_ref10) {
|
|
447
|
+
var _ref11 = _slicedToArray(_ref10, 2),
|
|
448
|
+
subcategory = _ref11[0],
|
|
449
|
+
subsection = _ref11[1];
|
|
359
450
|
|
|
360
451
|
return /*#__PURE__*/React.createElement(SectionRow, {
|
|
361
452
|
key: subcategory,
|
|
@@ -370,10 +461,10 @@ export var ArgsTable = function ArgsTable(props) {
|
|
|
370
461
|
expandable: expandable
|
|
371
462
|
}, common));
|
|
372
463
|
}));
|
|
373
|
-
}), Object.entries(groups.sections).map(function (
|
|
374
|
-
var
|
|
375
|
-
category =
|
|
376
|
-
section =
|
|
464
|
+
}), Object.entries(groups.sections).map(function (_ref12) {
|
|
465
|
+
var _ref13 = _slicedToArray(_ref12, 2),
|
|
466
|
+
category = _ref13[0],
|
|
467
|
+
section = _ref13[1];
|
|
377
468
|
|
|
378
469
|
return /*#__PURE__*/React.createElement(SectionRow, {
|
|
379
470
|
key: category,
|
|
@@ -386,10 +477,10 @@ export var ArgsTable = function ArgsTable(props) {
|
|
|
386
477
|
row: row,
|
|
387
478
|
arg: args && args[row.key]
|
|
388
479
|
}, common));
|
|
389
|
-
}), Object.entries(section.subsections).map(function (
|
|
390
|
-
var
|
|
391
|
-
subcategory =
|
|
392
|
-
subsection =
|
|
480
|
+
}), Object.entries(section.subsections).map(function (_ref14) {
|
|
481
|
+
var _ref15 = _slicedToArray(_ref14, 2),
|
|
482
|
+
subcategory = _ref15[0],
|
|
483
|
+
subsection = _ref15[1];
|
|
393
484
|
|
|
394
485
|
return /*#__PURE__*/React.createElement(SectionRow, {
|
|
395
486
|
key: subcategory,
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
title: 'Docs/ColorPalette',
|
|
5
5
|
component: ColorPalette
|
|
6
6
|
};
|
|
7
|
-
export var
|
|
7
|
+
export var DefaultStyle = function DefaultStyle() {
|
|
8
8
|
return /*#__PURE__*/React.createElement(ColorPalette, null, /*#__PURE__*/React.createElement(ColorItem, {
|
|
9
9
|
title: "theme.color.greyscale",
|
|
10
10
|
subtitle: "Some of the greys",
|
|
@@ -27,7 +27,7 @@ export var defaultStyle = function defaultStyle() {
|
|
|
27
27
|
colors: ['linear-gradient(to right,white,black)']
|
|
28
28
|
}));
|
|
29
29
|
};
|
|
30
|
-
|
|
30
|
+
DefaultStyle.displayName = "DefaultStyle";
|
|
31
31
|
export var NamedColors = function NamedColors() {
|
|
32
32
|
return /*#__PURE__*/React.createElement(ColorPalette, null, /*#__PURE__*/React.createElement(ColorItem, {
|
|
33
33
|
title: "theme.color.greyscale",
|
|
@@ -16,7 +16,7 @@ var _ref = process.env.NODE_ENV === "production" ? {
|
|
|
16
16
|
} : {
|
|
17
17
|
name: "11oe0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35
|
}
|
|
36
36
|
};
|
|
37
|
+
export var Loading = function Loading() {
|
|
38
|
+
return /*#__PURE__*/React.createElement(DocsPageWrapper, null, /*#__PURE__*/React.createElement(Title, null, "DocsPage"), /*#__PURE__*/React.createElement(Subtitle, null, "What the DocsPage looks like. Meant to be QAed in Canvas tab not in Docs tab."), /*#__PURE__*/React.createElement(Description, description.Text.args), /*#__PURE__*/React.createElement(Preview.Loading, null), /*#__PURE__*/React.createElement(argsTable.Loading, null), /*#__PURE__*/React.createElement(Source, source.Loading.args));
|
|
39
|
+
};
|
|
40
|
+
Loading.displayName = "Loading";
|
|
37
41
|
export var WithSubtitle = function WithSubtitle() {
|
|
38
42
|
return /*#__PURE__*/React.createElement(DocsPageWrapper, null, /*#__PURE__*/React.createElement(Title, null, "DocsPage"), /*#__PURE__*/React.createElement(Subtitle, null, "What the DocsPage looks like. Meant to be QAed in Canvas tab not in Docs tab."), /*#__PURE__*/React.createElement(Description, description.Text.args), /*#__PURE__*/React.createElement(Preview.Single, null), /*#__PURE__*/React.createElement(ArgsTable, argsTable.Normal.args), /*#__PURE__*/React.createElement(Source, source.JSX.args));
|
|
39
43
|
};
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
title: 'Docs/EmptyBlock',
|
|
5
5
|
component: EmptyBlock
|
|
6
6
|
};
|
|
7
|
-
export var
|
|
7
|
+
export var Error = function Error() {
|
|
8
8
|
return /*#__PURE__*/React.createElement(EmptyBlock, null, "Generic error message");
|
|
9
9
|
};
|
|
10
|
-
|
|
10
|
+
Error.displayName = "Error";
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
title: 'Docs/IconGallery',
|
|
6
6
|
component: IconGallery
|
|
7
7
|
};
|
|
8
|
-
export var
|
|
8
|
+
export var DefaultStyle = function DefaultStyle() {
|
|
9
9
|
return /*#__PURE__*/React.createElement(IconGallery, null, /*#__PURE__*/React.createElement(IconItem, {
|
|
10
10
|
name: "add"
|
|
11
11
|
}, /*#__PURE__*/React.createElement(ExampleIcon, {
|
|
@@ -34,4 +34,4 @@ export var defaultStyle = function defaultStyle() {
|
|
|
34
34
|
alt: "example"
|
|
35
35
|
})));
|
|
36
36
|
};
|
|
37
|
-
|
|
37
|
+
DefaultStyle.displayName = "DefaultStyle";
|
|
@@ -57,6 +57,7 @@ import { ActionBar } from '../ActionBar/ActionBar';
|
|
|
57
57
|
import { Toolbar } from './Toolbar';
|
|
58
58
|
import { ZoomContext } from './ZoomContext';
|
|
59
59
|
import { Zoom } from '../Zoom/Zoom';
|
|
60
|
+
import { StorySkeleton } from '.';
|
|
60
61
|
var ChildrenContainer = styled.div(function (_ref) {
|
|
61
62
|
var isColumn = _ref.isColumn,
|
|
62
63
|
columns = _ref.columns,
|
|
@@ -235,7 +236,7 @@ var getLayout = function getLayout(children) {
|
|
|
235
236
|
*/
|
|
236
237
|
|
|
237
238
|
|
|
238
|
-
var Preview = function Preview(_ref8) {
|
|
239
|
+
export var Preview = function Preview(_ref8) {
|
|
239
240
|
var isColumn = _ref8.isColumn,
|
|
240
241
|
columns = _ref8.columns,
|
|
241
242
|
children = _ref8.children,
|
|
@@ -360,6 +361,10 @@ var Preview = function Preview(_ref8) {
|
|
|
360
361
|
actionItems: actionItems
|
|
361
362
|
}))), withSource && expanded && source);
|
|
362
363
|
};
|
|
363
|
-
|
|
364
364
|
Preview.displayName = "Preview";
|
|
365
|
-
export
|
|
365
|
+
export var PreviewSkeleton = function PreviewSkeleton() {
|
|
366
|
+
return /*#__PURE__*/React.createElement(Preview, {
|
|
367
|
+
withToolbar: true
|
|
368
|
+
}, /*#__PURE__*/React.createElement(StorySkeleton, null));
|
|
369
|
+
};
|
|
370
|
+
PreviewSkeleton.displayName = "PreviewSkeleton";
|
|
@@ -6,7 +6,7 @@ import React from 'react';
|
|
|
6
6
|
import { styled } from '@storybook/theming';
|
|
7
7
|
import global from 'global';
|
|
8
8
|
import { Spaced } from '../spaced/Spaced';
|
|
9
|
-
import { Preview } from './Preview';
|
|
9
|
+
import { Preview, PreviewSkeleton } from './Preview';
|
|
10
10
|
import { Story } from './Story';
|
|
11
11
|
import { Button } from '../Button/Button';
|
|
12
12
|
import * as Source from './Source.stories';
|
|
@@ -15,6 +15,10 @@ export default {
|
|
|
15
15
|
title: 'Docs/Preview',
|
|
16
16
|
component: Preview
|
|
17
17
|
};
|
|
18
|
+
export var Loading = function Loading() {
|
|
19
|
+
return /*#__PURE__*/React.createElement(PreviewSkeleton, null);
|
|
20
|
+
};
|
|
21
|
+
Loading.displayName = "Loading";
|
|
18
22
|
export var CodeCollapsed = function CodeCollapsed() {
|
|
19
23
|
return /*#__PURE__*/React.createElement(Preview, {
|
|
20
24
|
isExpanded: false,
|
|
@@ -34,23 +34,71 @@ export var SourceError;
|
|
|
34
34
|
SourceError["SOURCE_UNAVAILABLE"] = "Oh no! The source is not available.";
|
|
35
35
|
})(SourceError || (SourceError = {}));
|
|
36
36
|
|
|
37
|
+
var SourceSkeletonWrapper = styled.div(function (_ref2) {
|
|
38
|
+
var theme = _ref2.theme;
|
|
39
|
+
return {
|
|
40
|
+
background: theme.background.content,
|
|
41
|
+
borderRadius: theme.appBorderRadius,
|
|
42
|
+
border: "1px solid ".concat(theme.appBorderColor),
|
|
43
|
+
boxShadow: theme.base === 'light' ? 'rgba(0, 0, 0, 0.10) 0 1px 3px 0' : 'rgba(0, 0, 0, 0.20) 0 2px 5px 0',
|
|
44
|
+
margin: '25px 0 40px',
|
|
45
|
+
padding: '20px 20px 20px 22px'
|
|
46
|
+
};
|
|
47
|
+
});
|
|
48
|
+
var SourceSkeletonPlaceholder = styled.div(function (_ref3) {
|
|
49
|
+
var theme = _ref3.theme;
|
|
50
|
+
return {
|
|
51
|
+
animation: "".concat(theme.animation.glow, " 1.5s ease-in-out infinite"),
|
|
52
|
+
background: theme.appBorderColor,
|
|
53
|
+
height: 17,
|
|
54
|
+
marginTop: 1,
|
|
55
|
+
width: '60%',
|
|
56
|
+
'&:first-child': {
|
|
57
|
+
margin: 0
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
var SourceSkeleton = function SourceSkeleton() {
|
|
63
|
+
return /*#__PURE__*/React.createElement(SourceSkeletonWrapper, null, /*#__PURE__*/React.createElement(SourceSkeletonPlaceholder, null), /*#__PURE__*/React.createElement(SourceSkeletonPlaceholder, {
|
|
64
|
+
style: {
|
|
65
|
+
width: '80%'
|
|
66
|
+
}
|
|
67
|
+
}), /*#__PURE__*/React.createElement(SourceSkeletonPlaceholder, {
|
|
68
|
+
style: {
|
|
69
|
+
width: '30%'
|
|
70
|
+
}
|
|
71
|
+
}), /*#__PURE__*/React.createElement(SourceSkeletonPlaceholder, {
|
|
72
|
+
style: {
|
|
73
|
+
width: '80%'
|
|
74
|
+
}
|
|
75
|
+
}));
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
SourceSkeleton.displayName = "SourceSkeleton";
|
|
79
|
+
|
|
37
80
|
/**
|
|
38
81
|
* Syntax-highlighted source code for a component (or anything!)
|
|
39
82
|
*/
|
|
40
83
|
var Source = function Source(props) {
|
|
41
|
-
var
|
|
42
|
-
|
|
84
|
+
var _ref4 = props,
|
|
85
|
+
isLoading = _ref4.isLoading,
|
|
86
|
+
error = _ref4.error;
|
|
87
|
+
|
|
88
|
+
if (isLoading) {
|
|
89
|
+
return /*#__PURE__*/React.createElement(SourceSkeleton, null);
|
|
90
|
+
}
|
|
43
91
|
|
|
44
92
|
if (error) {
|
|
45
93
|
return /*#__PURE__*/React.createElement(EmptyBlock, null, error);
|
|
46
94
|
}
|
|
47
95
|
|
|
48
|
-
var
|
|
49
|
-
language =
|
|
50
|
-
code =
|
|
51
|
-
dark =
|
|
52
|
-
format =
|
|
53
|
-
rest = _objectWithoutProperties(
|
|
96
|
+
var _ref5 = props,
|
|
97
|
+
language = _ref5.language,
|
|
98
|
+
code = _ref5.code,
|
|
99
|
+
dark = _ref5.dark,
|
|
100
|
+
format = _ref5.format,
|
|
101
|
+
rest = _objectWithoutProperties(_ref5, ["language", "code", "dark", "format"]);
|
|
54
102
|
|
|
55
103
|
var syntaxHighlighter = /*#__PURE__*/React.createElement(StyledSyntaxHighlighter, _extends({
|
|
56
104
|
bordered: true,
|
|
@@ -4,6 +4,13 @@ export default {
|
|
|
4
4
|
title: 'Docs/Source',
|
|
5
5
|
component: Source
|
|
6
6
|
};
|
|
7
|
+
export var Loading = function Loading(args) {
|
|
8
|
+
return /*#__PURE__*/React.createElement(Source, args);
|
|
9
|
+
};
|
|
10
|
+
Loading.displayName = "Loading";
|
|
11
|
+
Loading.args = {
|
|
12
|
+
isLoading: true
|
|
13
|
+
};
|
|
7
14
|
var jsxCode = "\n<MyComponent boolProp scalarProp={1} complexProp={{ foo: 1, bar: '2' }}>\n <SomeOtherComponent funcProp={(a) => a.id} />\n</MyComponent>\n";
|
|
8
15
|
export var JSX = function JSX(args) {
|
|
9
16
|
return /*#__PURE__*/React.createElement(Source, args);
|
package/dist/esm/blocks/Story.js
CHANGED
|
@@ -9,6 +9,7 @@ import React, { createElement, Fragment } from 'react';
|
|
|
9
9
|
import { IFrame } from './IFrame';
|
|
10
10
|
import { EmptyBlock } from './EmptyBlock';
|
|
11
11
|
import { ZoomContext } from './ZoomContext';
|
|
12
|
+
import { Loader } from '..';
|
|
12
13
|
var BASE_URL = 'iframe.html';
|
|
13
14
|
export var StoryError;
|
|
14
15
|
/** error message for Story with null storyFn
|
|
@@ -88,4 +89,9 @@ var Story = function Story(_ref4) {
|
|
|
88
89
|
});
|
|
89
90
|
};
|
|
90
91
|
|
|
91
|
-
|
|
92
|
+
var StorySkeleton = function StorySkeleton() {
|
|
93
|
+
return /*#__PURE__*/React.createElement(Loader, null);
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
StorySkeleton.displayName = "StorySkeleton";
|
|
97
|
+
export { Story, StorySkeleton };
|
|
@@ -22,7 +22,7 @@ function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(
|
|
|
22
22
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
23
23
|
|
|
24
24
|
import React, { useState } from 'react';
|
|
25
|
-
import { Story, StoryError } from './Story';
|
|
25
|
+
import { Story, StorySkeleton, StoryError } from './Story';
|
|
26
26
|
import { Button } from '../Button/Button';
|
|
27
27
|
export default {
|
|
28
28
|
title: 'Docs/Story',
|
|
@@ -52,8 +52,13 @@ var buttonHookFn = function buttonHookFn() {
|
|
|
52
52
|
};
|
|
53
53
|
|
|
54
54
|
buttonHookFn.displayName = "buttonHookFn";
|
|
55
|
+
export var Loading = function Loading() {
|
|
56
|
+
return /*#__PURE__*/React.createElement(StorySkeleton, null);
|
|
57
|
+
};
|
|
58
|
+
Loading.displayName = "Loading";
|
|
55
59
|
export var Inline = function Inline() {
|
|
56
60
|
return /*#__PURE__*/React.createElement(Story, {
|
|
61
|
+
id: "id",
|
|
57
62
|
inline: true,
|
|
58
63
|
storyFn: buttonFn,
|
|
59
64
|
title: "hello button"
|
|
@@ -62,12 +67,14 @@ export var Inline = function Inline() {
|
|
|
62
67
|
Inline.displayName = "Inline";
|
|
63
68
|
export var Error = function Error() {
|
|
64
69
|
return /*#__PURE__*/React.createElement(Story, {
|
|
70
|
+
id: "id",
|
|
65
71
|
error: StoryError.NO_STORY
|
|
66
72
|
});
|
|
67
73
|
};
|
|
68
74
|
Error.displayName = "Error";
|
|
69
75
|
export var ReactHook = function ReactHook() {
|
|
70
76
|
return /*#__PURE__*/React.createElement(Story, {
|
|
77
|
+
id: "id",
|
|
71
78
|
inline: true,
|
|
72
79
|
storyFn: buttonHookFn,
|
|
73
80
|
title: "hello button"
|