@storybook/components 5.2.1 → 5.2.5

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.
Files changed (94) hide show
  1. package/dist/html.js +1 -1
  2. package/dist/typography/DocumentFormatting.js +2 -1
  3. package/dist/typography/DocumentWrapper.js +2 -2
  4. package/package.json +11 -5
  5. package/src/ActionBar/ActionBar.stories.tsx +0 -41
  6. package/src/ActionBar/ActionBar.tsx +0 -75
  7. package/src/Badge/Badge.stories.tsx +0 -11
  8. package/src/Badge/Badge.tsx +0 -68
  9. package/src/Button/Button.stories.tsx +0 -53
  10. package/src/Button/Button.tsx +0 -256
  11. package/src/ScrollArea/ScrollArea.stories.tsx +0 -85
  12. package/src/ScrollArea/ScrollArea.tsx +0 -62
  13. package/src/ScrollArea/ScrollAreaStyles.tsx +0 -166
  14. package/src/addon-panel/addon-panel.tsx +0 -33
  15. package/src/bar/bar.tsx +0 -93
  16. package/src/bar/button.ts +0 -89
  17. package/src/bar/separator.tsx +0 -39
  18. package/src/blocks/BlockBackgroundStyles.tsx +0 -9
  19. package/src/blocks/ColorPalette.stories.tsx +0 -29
  20. package/src/blocks/ColorPalette.tsx +0 -168
  21. package/src/blocks/Description.stories.tsx +0 -15
  22. package/src/blocks/Description.tsx +0 -18
  23. package/src/blocks/DocsPage.stories.tsx +0 -67
  24. package/src/blocks/DocsPage.tsx +0 -81
  25. package/src/blocks/DocsPageExampleCaption.md +0 -93
  26. package/src/blocks/DocsPageExampleCaption.mdx +0 -93
  27. package/src/blocks/EmptyBlock.stories.tsx +0 -9
  28. package/src/blocks/EmptyBlock.tsx +0 -23
  29. package/src/blocks/IFrame.tsx +0 -60
  30. package/src/blocks/IconGallery.stories.tsx +0 -32
  31. package/src/blocks/IconGallery.tsx +0 -72
  32. package/src/blocks/Preview.stories.tsx +0 -96
  33. package/src/blocks/Preview.tsx +0 -162
  34. package/src/blocks/PropsTable/PropDef.ts +0 -7
  35. package/src/blocks/PropsTable/PropRow.stories.tsx +0 -113
  36. package/src/blocks/PropsTable/PropRow.tsx +0 -102
  37. package/src/blocks/PropsTable/PropsTable.stories.tsx +0 -14
  38. package/src/blocks/PropsTable/PropsTable.tsx +0 -169
  39. package/src/blocks/Source.stories.tsx +0 -36
  40. package/src/blocks/Source.tsx +0 -72
  41. package/src/blocks/Story.stories.tsx +0 -25
  42. package/src/blocks/Story.tsx +0 -115
  43. package/src/blocks/Toolbar.tsx +0 -85
  44. package/src/blocks/Typeset.stories.tsx +0 -16
  45. package/src/blocks/Typeset.tsx +0 -68
  46. package/src/blocks/ZoomContext.tsx +0 -5
  47. package/src/blocks/index.ts +0 -10
  48. package/src/brand/StorybookIcon.stories.tsx +0 -6
  49. package/src/brand/StorybookIcon.tsx +0 -26
  50. package/src/brand/StorybookLogo.stories.tsx +0 -10
  51. package/src/brand/StorybookLogo.tsx +0 -33
  52. package/src/form/field/field.tsx +0 -42
  53. package/src/form/form.stories.tsx +0 -133
  54. package/src/form/index.tsx +0 -18
  55. package/src/form/input/input.tsx +0 -178
  56. package/src/html.tsx +0 -12
  57. package/src/icon/icon.stories.tsx +0 -77
  58. package/src/icon/icon.tsx +0 -22
  59. package/src/icon/icons.tsx +0 -310
  60. package/src/icon/svg.tsx +0 -24
  61. package/src/index.ts +0 -37
  62. package/src/placeholder/placeholder.stories.tsx +0 -24
  63. package/src/placeholder/placeholder.tsx +0 -25
  64. package/src/spaced/Spaced.stories.tsx +0 -72
  65. package/src/spaced/Spaced.tsx +0 -69
  66. package/src/syntaxhighlighter/formatter.test.js +0 -90
  67. package/src/syntaxhighlighter/formatter.ts +0 -26
  68. package/src/syntaxhighlighter/syntaxhighlighter.stories.tsx +0 -136
  69. package/src/syntaxhighlighter/syntaxhighlighter.tsx +0 -165
  70. package/src/tabs/tabs.stories.tsx +0 -207
  71. package/src/tabs/tabs.tsx +0 -252
  72. package/src/tooltip/ListItem.stories.tsx +0 -35
  73. package/src/tooltip/ListItem.tsx +0 -245
  74. package/src/tooltip/Tooltip.stories.tsx +0 -42
  75. package/src/tooltip/Tooltip.tsx +0 -146
  76. package/src/tooltip/TooltipLinkList.stories.tsx +0 -52
  77. package/src/tooltip/TooltipLinkList.tsx +0 -49
  78. package/src/tooltip/TooltipMessage.stories.tsx +0 -37
  79. package/src/tooltip/TooltipMessage.tsx +0 -67
  80. package/src/tooltip/TooltipNote.stories.tsx +0 -15
  81. package/src/tooltip/TooltipNote.tsx +0 -25
  82. package/src/tooltip/WithTooltip.stories.tsx +0 -85
  83. package/src/tooltip/WithTooltip.tsx +0 -159
  84. package/src/typings.d.ts +0 -4
  85. package/src/typography/DocumentFormatting.tsx +0 -355
  86. package/src/typography/DocumentFormattingSample.md +0 -127
  87. package/src/typography/DocumentWrapper.stories.tsx +0 -190
  88. package/src/typography/DocumentWrapper.tsx +0 -441
  89. package/src/typography/link/link.stories.tsx +0 -67
  90. package/src/typography/link/link.test.tsx +0 -108
  91. package/src/typography/link/link.tsx +0 -223
  92. package/src/typography/typography.stories.tsx +0 -111
  93. package/src/typography/withReset.tsx +0 -12
  94. package/tsconfig.json +0 -18
@@ -1,441 +0,0 @@
1
- import { styled, css } from '@storybook/theming';
2
-
3
- export const DocumentWrapper = styled.div(
4
- ({ theme }) => css`
5
- /* Custom styles atop GitHub base theme (see below) */
6
- font-size: ${theme.typography.size.s2}px;
7
- line-height: 1.6;
8
-
9
- h1 {
10
- font-size: ${theme.typography.size.l1}px;
11
- font-weight: ${theme.typography.weight.black};
12
- }
13
-
14
- h2 {
15
- font-size: ${theme.typography.size.m2}px;
16
- border-bottom: 1px solid ${theme.appBorderColor};
17
- }
18
-
19
- h3 {
20
- font-size: ${theme.typography.size.m1}px;
21
- }
22
-
23
- h4 {
24
- font-size: ${theme.typography.size.s3}px;
25
- }
26
-
27
- h5 {
28
- font-size: ${theme.typography.size.s2}px;
29
- }
30
-
31
- h6 {
32
- font-size: ${theme.typography.size.s2}px;
33
- color: ${theme.color.dark};
34
- }
35
-
36
- /* Custom for SB SyntaxHighlighter */
37
-
38
- pre:not(.hljs) {
39
- background: transparent;
40
- border: none;
41
- border-radius: 0;
42
- padding: 0;
43
- margin: 0;
44
- }
45
-
46
- pre pre,
47
- pre.hljs {
48
- padding: 15px;
49
- margin: 0;
50
-
51
- white-space: pre-wrap;
52
- color: inherit;
53
-
54
- font-size: 13px;
55
- line-height: 19px;
56
-
57
- code {
58
- color: inherit;
59
- font-size: inherit;
60
- }
61
- }
62
-
63
- pre code {
64
- margin: 0;
65
- padding: 0;
66
- white-space: pre;
67
- border: none;
68
- background: transparent;
69
- }
70
-
71
- pre code,
72
- pre tt {
73
- background-color: transparent;
74
- border: none;
75
- }
76
-
77
- /* GitHub inspired Markdown styles loosely from https://gist.github.com/tuzz/3331384 */
78
-
79
- body > *:first-of-type {
80
- margin-top: 0 !important;
81
- }
82
-
83
- body > *:last-child {
84
- margin-bottom: 0 !important;
85
- }
86
-
87
- a {
88
- color: ${theme.color.secondary};
89
- text-decoration: none;
90
- }
91
-
92
- a.absent {
93
- color: #cc0000;
94
- }
95
-
96
- a.anchor {
97
- display: block;
98
- padding-left: 30px;
99
- margin-left: -30px;
100
- cursor: pointer;
101
- position: absolute;
102
- top: 0;
103
- left: 0;
104
- bottom: 0;
105
- }
106
-
107
- h1,
108
- h2,
109
- h3,
110
- h4,
111
- h5,
112
- h6 {
113
- margin: 20px 0 10px;
114
- padding: 0;
115
- cursor: text;
116
- position: relative;
117
- }
118
-
119
- h2:first-of-type,
120
- h1:first-of-type,
121
- h1:first-of-type + h2,
122
- h3:first-of-type,
123
- h4:first-of-type,
124
- h5:first-of-type,
125
- h6:first-of-type {
126
- margin-top: 0;
127
- padding-top: 0;
128
- }
129
-
130
- h1:hover a.anchor,
131
- h2:hover a.anchor,
132
- h3:hover a.anchor,
133
- h4:hover a.anchor,
134
- h5:hover a.anchor,
135
- h6:hover a.anchor {
136
- text-decoration: none;
137
- }
138
-
139
- h1 tt,
140
- h1 code {
141
- font-size: inherit;
142
- }
143
-
144
- h2 tt,
145
- h2 code {
146
- font-size: inherit;
147
- }
148
-
149
- h3 tt,
150
- h3 code {
151
- font-size: inherit;
152
- }
153
-
154
- h4 tt,
155
- h4 code {
156
- font-size: inherit;
157
- }
158
-
159
- h5 tt,
160
- h5 code {
161
- font-size: inherit;
162
- }
163
-
164
- h6 tt,
165
- h6 code {
166
- font-size: inherit;
167
- }
168
-
169
- p,
170
- blockquote,
171
- ul,
172
- ol,
173
- dl,
174
- li,
175
- table,
176
- pre {
177
- margin: 15px 0;
178
- }
179
-
180
- hr {
181
- border: 0 none;
182
- color: ${theme.appBorderColor};
183
- height: 4px;
184
- padding: 0;
185
- }
186
-
187
- body > h2:first-of-type {
188
- margin-top: 0;
189
- padding-top: 0;
190
- }
191
-
192
- body > h1:first-of-type {
193
- margin-top: 0;
194
- padding-top: 0;
195
- }
196
-
197
- body > h1:first-of-type + h2 {
198
- margin-top: 0;
199
- padding-top: 0;
200
- }
201
-
202
- body > h3:first-of-type,
203
- body > h4:first-of-type,
204
- body > h5:first-of-type,
205
- body > h6:first-of-type {
206
- margin-top: 0;
207
- padding-top: 0;
208
- }
209
-
210
- a:first-of-type h1,
211
- a:first-of-type h2,
212
- a:first-of-type h3,
213
- a:first-of-type h4,
214
- a:first-of-type h5,
215
- a:first-of-type h6 {
216
- margin-top: 0;
217
- padding-top: 0;
218
- }
219
-
220
- h1 p,
221
- h2 p,
222
- h3 p,
223
- h4 p,
224
- h5 p,
225
- h6 p {
226
- margin-top: 0;
227
- }
228
-
229
- li p.first {
230
- display: inline-block;
231
- }
232
-
233
- ul,
234
- ol {
235
- padding-left: 30px;
236
- }
237
-
238
- ul :first-of-type,
239
- ol :first-of-type {
240
- margin-top: 0;
241
- }
242
-
243
- ul :last-child,
244
- ol :last-child {
245
- margin-bottom: 0;
246
- }
247
-
248
- dl {
249
- padding: 0;
250
- }
251
-
252
- dl dt {
253
- font-size: 14px;
254
- font-weight: bold;
255
- font-style: italic;
256
- padding: 0;
257
- margin: 15px 0 5px;
258
- }
259
-
260
- dl dt:first-of-type {
261
- padding: 0;
262
- }
263
-
264
- dl dt > :first-of-type {
265
- margin-top: 0;
266
- }
267
-
268
- dl dt > :last-child {
269
- margin-bottom: 0;
270
- }
271
-
272
- dl dd {
273
- margin: 0 0 15px;
274
- padding: 0 15px;
275
- }
276
-
277
- dl dd > :first-of-type {
278
- margin-top: 0;
279
- }
280
-
281
- dl dd > :last-child {
282
- margin-bottom: 0;
283
- }
284
-
285
- blockquote {
286
- border-left: 4px solid ${theme.color.medium};
287
- padding: 0 15px;
288
- color: ${theme.color.dark};
289
- }
290
-
291
- blockquote > :first-of-type {
292
- margin-top: 0;
293
- }
294
-
295
- blockquote > :last-child {
296
- margin-bottom: 0;
297
- }
298
-
299
- table {
300
- padding: 0;
301
- border-collapse: collapse;
302
- }
303
- table tr {
304
- border-top: 1px solid ${theme.appBorderColor};
305
- background-color: white;
306
- margin: 0;
307
- padding: 0;
308
- }
309
-
310
- table tr:nth-of-type(2n) {
311
- background-color: ${theme.color.lighter};
312
- }
313
-
314
- table tr th {
315
- font-weight: bold;
316
- border: 1px solid ${theme.appBorderColor};
317
- text-align: left;
318
- margin: 0;
319
- padding: 6px 13px;
320
- }
321
-
322
- table tr td {
323
- border: 1px solid ${theme.appBorderColor};
324
- text-align: left;
325
- margin: 0;
326
- padding: 6px 13px;
327
- }
328
-
329
- table tr th :first-of-type,
330
- table tr td :first-of-type {
331
- margin-top: 0;
332
- }
333
-
334
- table tr th :last-child,
335
- table tr td :last-child {
336
- margin-bottom: 0;
337
- }
338
-
339
- img {
340
- max-width: 100%;
341
- }
342
-
343
- span.frame {
344
- display: block;
345
- overflow: hidden;
346
- }
347
-
348
- span.frame > span {
349
- border: 1px solid ${theme.color.medium};
350
- display: block;
351
- float: left;
352
- overflow: hidden;
353
- margin: 13px 0 0;
354
- padding: 7px;
355
- width: auto;
356
- }
357
-
358
- span.frame span img {
359
- display: block;
360
- float: left;
361
- }
362
-
363
- span.frame span span {
364
- clear: both;
365
- color: ${theme.color.darkest};
366
- display: block;
367
- padding: 5px 0 0;
368
- }
369
-
370
- span.align-center {
371
- display: block;
372
- overflow: hidden;
373
- clear: both;
374
- }
375
-
376
- span.align-center > span {
377
- display: block;
378
- overflow: hidden;
379
- margin: 13px auto 0;
380
- text-align: center;
381
- }
382
-
383
- span.align-center span img {
384
- margin: 0 auto;
385
- text-align: center;
386
- }
387
-
388
- span.align-right {
389
- display: block;
390
- overflow: hidden;
391
- clear: both;
392
- }
393
-
394
- span.align-right > span {
395
- display: block;
396
- overflow: hidden;
397
- margin: 13px 0 0;
398
- text-align: right;
399
- }
400
-
401
- span.align-right span img {
402
- margin: 0;
403
- text-align: right;
404
- }
405
-
406
- span.float-left {
407
- display: block;
408
- margin-right: 13px;
409
- overflow: hidden;
410
- float: left;
411
- }
412
-
413
- span.float-left span {
414
- margin: 13px 0 0;
415
- }
416
-
417
- span.float-right {
418
- display: block;
419
- margin-left: 13px;
420
- overflow: hidden;
421
- float: right;
422
- }
423
-
424
- span.float-right > span {
425
- display: block;
426
- overflow: hidden;
427
- margin: 13px auto 0;
428
- text-align: right;
429
- }
430
-
431
- code,
432
- tt {
433
- margin: 0 2px;
434
- padding: 0 5px;
435
- white-space: nowrap;
436
- border: 1px solid ${theme.color.mediumlight};
437
- background-color: ${theme.color.lighter};
438
- border-radius: 3px;
439
- }
440
- `
441
- );
@@ -1,67 +0,0 @@
1
- import React from 'react';
2
- import { storiesOf } from '@storybook/react';
3
- import { action } from '@storybook/addon-actions';
4
-
5
- import { Link } from './link';
6
- import { Icons } from '../../icon/icon';
7
-
8
- const onClick = action('onClick');
9
- storiesOf('Basics|Link', module)
10
- .add('cancel w/ onClick', () => (
11
- <Link cancel href="/" onClick={onClick}>
12
- Try clicking with different mouse buttons and modifier keys (shift/ctrl/alt/cmd)
13
- </Link>
14
- ))
15
- .add('cancel w/ href', () => (
16
- <Link cancel href="http://example.com">
17
- Link
18
- </Link>
19
- ))
20
- .add('no-cancel w/ onClick', () => (
21
- <Link href="/" onClick={onClick}>
22
- any click will go through
23
- </Link>
24
- ))
25
- .add('no-cancel w/ href', () => (
26
- <Link cancel href="http://example.com">
27
- Link
28
- </Link>
29
- ))
30
- .add('styled links', () => (
31
- <div>
32
- <Link href="http://google.com">Default</Link>
33
- <br />
34
- <Link secondary href="http://google.com">
35
- Secondary
36
- </Link>
37
- <br />
38
- <Link tertiary href="http://google.com">
39
- tertiary
40
- </Link>
41
- <br />
42
- <Link nochrome href="http://google.com">
43
- nochrome
44
- </Link>
45
- <br />
46
- <Link href="http://google.com">
47
- <Icons icon="discord" />
48
- With icon in front
49
- </Link>
50
- <br />
51
- <Link containsIcon href="http://google.com">
52
- {/* A linked icon by itself */}
53
- <Icons icon="sidebar" />
54
- </Link>
55
- <br />
56
- <Link containsIcon withArrow href="http://google.com">
57
- With arrow behind
58
- </Link>
59
- <br />
60
- <span style={{ background: '#333' }}>
61
- <Link inverse href="http://google.com">
62
- Inverted colors
63
- </Link>
64
- </span>
65
- <br />
66
- </div>
67
- ));
@@ -1,108 +0,0 @@
1
- import { shallow } from 'enzyme';
2
- import React from 'react';
3
- import { Link } from './link';
4
-
5
- const LEFT_BUTTON = 0;
6
- const MIDDLE_BUTTON = 1;
7
- const RIGHT_BUTTON = 2;
8
-
9
- const createEvent = (options: any) => ({
10
- button: LEFT_BUTTON,
11
- preventDefault: jest.fn(),
12
- ...options,
13
- });
14
- const renderLink = (props: any) => shallow(<Link {...{ children: 'Content', ...props }} />);
15
-
16
- const setup = ({ props, event }: any) => ({
17
- e: createEvent(event),
18
- result: renderLink(props),
19
- onClick: props.onClick || jest.fn(),
20
- });
21
-
22
- describe('Link', () => {
23
- describe('events', () => {
24
- it('should call onClick on a plain left click', () => {
25
- const { result, onClick, e } = setup({
26
- props: { onClick: jest.fn() },
27
- event: { button: LEFT_BUTTON },
28
- });
29
-
30
- result.simulate('click', e);
31
-
32
- expect(onClick).toHaveBeenCalledWith(e);
33
- expect(e.preventDefault).toHaveBeenCalled();
34
- });
35
-
36
- it("shouldn't call onClick on a middle click", () => {
37
- const { result, onClick, e } = setup({
38
- props: { onClick: jest.fn() },
39
- event: { button: MIDDLE_BUTTON },
40
- });
41
-
42
- result.simulate('click', e);
43
-
44
- expect(onClick).not.toHaveBeenCalled();
45
- expect(e.preventDefault).not.toHaveBeenCalled();
46
- });
47
-
48
- it("shouldn't call onClick on a right click", () => {
49
- const { result, onClick, e } = setup({
50
- props: { onClick: jest.fn() },
51
- event: { button: RIGHT_BUTTON },
52
- });
53
-
54
- result.simulate('click', e);
55
-
56
- expect(onClick).not.toHaveBeenCalled();
57
- expect(e.preventDefault).not.toHaveBeenCalled();
58
- });
59
-
60
- it("shouldn't call onClick on alt+click", () => {
61
- const { result, onClick, e } = setup({
62
- props: { onClick: jest.fn() },
63
- event: { altKey: true },
64
- });
65
-
66
- result.simulate('click', e);
67
-
68
- expect(onClick).not.toHaveBeenCalled();
69
- expect(e.preventDefault).not.toHaveBeenCalled();
70
- });
71
-
72
- it("shouldn't call onClick on ctrl+click", () => {
73
- const { result, onClick, e } = setup({
74
- props: { onClick: jest.fn() },
75
- event: { ctrlKey: true },
76
- });
77
-
78
- result.simulate('click', e);
79
-
80
- expect(onClick).not.toHaveBeenCalled();
81
- expect(e.preventDefault).not.toHaveBeenCalled();
82
- });
83
-
84
- it("shouldn't call onClick on cmd+click / win+click", () => {
85
- const { result, onClick, e } = setup({
86
- props: { onClick: jest.fn() },
87
- event: { metaKey: true },
88
- });
89
-
90
- result.simulate('click', e);
91
-
92
- expect(onClick).not.toHaveBeenCalled();
93
- expect(e.preventDefault).not.toHaveBeenCalled();
94
- });
95
-
96
- it("shouldn't call onClick on shift+click", () => {
97
- const { result, onClick, e } = setup({
98
- props: { onClick: jest.fn() },
99
- event: { shiftKey: true },
100
- });
101
-
102
- result.simulate('click', e);
103
-
104
- expect(onClick).not.toHaveBeenCalled();
105
- expect(e.preventDefault).not.toHaveBeenCalled();
106
- });
107
- });
108
- });