@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
package/dist/html.js CHANGED
@@ -78,7 +78,7 @@ var components = Object.entries(rawComponents).reduce(function (acc, _ref) {
78
78
 
79
79
  return Object.assign({}, acc, _defineProperty({}, k.toLowerCase(), function (props) {
80
80
  return _react["default"].createElement(V, _extends({}, props, {
81
- className: "sbdocs-".concat(k.toLowerCase())
81
+ className: "sbdocs sbdocs-".concat(k.toLowerCase())
82
82
  }));
83
83
  }));
84
84
  }, {});
@@ -401,7 +401,8 @@ var codeCommon = function codeCommon(_ref15) {
401
401
  border: "1px solid ".concat(theme.color.mediumlight),
402
402
  backgroundColor: theme.color.lighter,
403
403
  borderRadius: '3px',
404
- fontSize: theme.typography.size.s2 - 1
404
+ fontSize: theme.typography.size.s2 - 1,
405
+ color: theme.base === 'dark' && theme.color.darkest
405
406
  };
406
407
  };
407
408
 
@@ -16,7 +16,7 @@ exports.DocumentWrapper = void 0;
16
16
  var _theming = require("@storybook/theming");
17
17
 
18
18
  function _templateObject() {
19
- var data = _taggedTemplateLiteral(["\n /* Custom styles atop GitHub base theme (see below) */\n font-size: ", "px;\n line-height: 1.6;\n\n h1 {\n font-size: ", "px;\n font-weight: ", ";\n }\n\n h2 {\n font-size: ", "px;\n border-bottom: 1px solid ", ";\n }\n\n h3 {\n font-size: ", "px;\n }\n\n h4 {\n font-size: ", "px;\n }\n\n h5 {\n font-size: ", "px;\n }\n\n h6 {\n font-size: ", "px;\n color: ", ";\n }\n\n /* Custom for SB SyntaxHighlighter */\n\n pre:not(.hljs) {\n background: transparent;\n border: none;\n border-radius: 0;\n padding: 0;\n margin: 0;\n }\n\n pre pre,\n pre.hljs {\n padding: 15px;\n margin: 0;\n\n white-space: pre-wrap;\n color: inherit;\n\n font-size: 13px;\n line-height: 19px;\n\n code {\n color: inherit;\n font-size: inherit;\n }\n }\n\n pre code {\n margin: 0;\n padding: 0;\n white-space: pre;\n border: none;\n background: transparent;\n }\n\n pre code,\n pre tt {\n background-color: transparent;\n border: none;\n }\n\n /* GitHub inspired Markdown styles loosely from https://gist.github.com/tuzz/3331384 */\n\n body > *:first-of-type {\n margin-top: 0 !important;\n }\n\n body > *:last-child {\n margin-bottom: 0 !important;\n }\n\n a {\n color: ", ";\n text-decoration: none;\n }\n\n a.absent {\n color: #cc0000;\n }\n\n a.anchor {\n display: block;\n padding-left: 30px;\n margin-left: -30px;\n cursor: pointer;\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n }\n\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n margin: 20px 0 10px;\n padding: 0;\n cursor: text;\n position: relative;\n }\n\n h2:first-of-type,\n h1:first-of-type,\n h1:first-of-type + h2,\n h3:first-of-type,\n h4:first-of-type,\n h5:first-of-type,\n h6:first-of-type {\n margin-top: 0;\n padding-top: 0;\n }\n\n h1:hover a.anchor,\n h2:hover a.anchor,\n h3:hover a.anchor,\n h4:hover a.anchor,\n h5:hover a.anchor,\n h6:hover a.anchor {\n text-decoration: none;\n }\n\n h1 tt,\n h1 code {\n font-size: inherit;\n }\n\n h2 tt,\n h2 code {\n font-size: inherit;\n }\n\n h3 tt,\n h3 code {\n font-size: inherit;\n }\n\n h4 tt,\n h4 code {\n font-size: inherit;\n }\n\n h5 tt,\n h5 code {\n font-size: inherit;\n }\n\n h6 tt,\n h6 code {\n font-size: inherit;\n }\n\n p,\n blockquote,\n ul,\n ol,\n dl,\n li,\n table,\n pre {\n margin: 15px 0;\n }\n\n hr {\n border: 0 none;\n color: ", ";\n height: 4px;\n padding: 0;\n }\n\n body > h2:first-of-type {\n margin-top: 0;\n padding-top: 0;\n }\n\n body > h1:first-of-type {\n margin-top: 0;\n padding-top: 0;\n }\n\n body > h1:first-of-type + h2 {\n margin-top: 0;\n padding-top: 0;\n }\n\n body > h3:first-of-type,\n body > h4:first-of-type,\n body > h5:first-of-type,\n body > h6:first-of-type {\n margin-top: 0;\n padding-top: 0;\n }\n\n a:first-of-type h1,\n a:first-of-type h2,\n a:first-of-type h3,\n a:first-of-type h4,\n a:first-of-type h5,\n a:first-of-type h6 {\n margin-top: 0;\n padding-top: 0;\n }\n\n h1 p,\n h2 p,\n h3 p,\n h4 p,\n h5 p,\n h6 p {\n margin-top: 0;\n }\n\n li p.first {\n display: inline-block;\n }\n\n ul,\n ol {\n padding-left: 30px;\n }\n\n ul :first-of-type,\n ol :first-of-type {\n margin-top: 0;\n }\n\n ul :last-child,\n ol :last-child {\n margin-bottom: 0;\n }\n\n dl {\n padding: 0;\n }\n\n dl dt {\n font-size: 14px;\n font-weight: bold;\n font-style: italic;\n padding: 0;\n margin: 15px 0 5px;\n }\n\n dl dt:first-of-type {\n padding: 0;\n }\n\n dl dt > :first-of-type {\n margin-top: 0;\n }\n\n dl dt > :last-child {\n margin-bottom: 0;\n }\n\n dl dd {\n margin: 0 0 15px;\n padding: 0 15px;\n }\n\n dl dd > :first-of-type {\n margin-top: 0;\n }\n\n dl dd > :last-child {\n margin-bottom: 0;\n }\n\n blockquote {\n border-left: 4px solid ", ";\n padding: 0 15px;\n color: ", ";\n }\n\n blockquote > :first-of-type {\n margin-top: 0;\n }\n\n blockquote > :last-child {\n margin-bottom: 0;\n }\n\n table {\n padding: 0;\n border-collapse: collapse;\n }\n table tr {\n border-top: 1px solid ", ";\n background-color: white;\n margin: 0;\n padding: 0;\n }\n\n table tr:nth-of-type(2n) {\n background-color: ", ";\n }\n\n table tr th {\n font-weight: bold;\n border: 1px solid ", ";\n text-align: left;\n margin: 0;\n padding: 6px 13px;\n }\n\n table tr td {\n border: 1px solid ", ";\n text-align: left;\n margin: 0;\n padding: 6px 13px;\n }\n\n table tr th :first-of-type,\n table tr td :first-of-type {\n margin-top: 0;\n }\n\n table tr th :last-child,\n table tr td :last-child {\n margin-bottom: 0;\n }\n\n img {\n max-width: 100%;\n }\n\n span.frame {\n display: block;\n overflow: hidden;\n }\n\n span.frame > span {\n border: 1px solid ", ";\n display: block;\n float: left;\n overflow: hidden;\n margin: 13px 0 0;\n padding: 7px;\n width: auto;\n }\n\n span.frame span img {\n display: block;\n float: left;\n }\n\n span.frame span span {\n clear: both;\n color: ", ";\n display: block;\n padding: 5px 0 0;\n }\n\n span.align-center {\n display: block;\n overflow: hidden;\n clear: both;\n }\n\n span.align-center > span {\n display: block;\n overflow: hidden;\n margin: 13px auto 0;\n text-align: center;\n }\n\n span.align-center span img {\n margin: 0 auto;\n text-align: center;\n }\n\n span.align-right {\n display: block;\n overflow: hidden;\n clear: both;\n }\n\n span.align-right > span {\n display: block;\n overflow: hidden;\n margin: 13px 0 0;\n text-align: right;\n }\n\n span.align-right span img {\n margin: 0;\n text-align: right;\n }\n\n span.float-left {\n display: block;\n margin-right: 13px;\n overflow: hidden;\n float: left;\n }\n\n span.float-left span {\n margin: 13px 0 0;\n }\n\n span.float-right {\n display: block;\n margin-left: 13px;\n overflow: hidden;\n float: right;\n }\n\n span.float-right > span {\n display: block;\n overflow: hidden;\n margin: 13px auto 0;\n text-align: right;\n }\n\n code,\n tt {\n margin: 0 2px;\n padding: 0 5px;\n white-space: nowrap;\n border: 1px solid ", ";\n background-color: ", ";\n border-radius: 3px;\n }\n "]);
19
+ var data = _taggedTemplateLiteral(["\n /* Custom styles atop GitHub base theme (see below) */\n font-size: ", "px;\n line-height: 1.6;\n\n h1 {\n font-size: ", "px;\n font-weight: ", ";\n }\n\n h2 {\n font-size: ", "px;\n border-bottom: 1px solid ", ";\n }\n\n h3 {\n font-size: ", "px;\n }\n\n h4 {\n font-size: ", "px;\n }\n\n h5 {\n font-size: ", "px;\n }\n\n h6 {\n font-size: ", "px;\n color: ", ";\n }\n\n /* Custom for SB SyntaxHighlighter */\n\n pre:not(.hljs) {\n background: transparent;\n border: none;\n border-radius: 0;\n padding: 0;\n margin: 0;\n }\n\n pre pre,\n pre.hljs {\n padding: 15px;\n margin: 0;\n\n white-space: pre-wrap;\n color: inherit;\n\n font-size: 13px;\n line-height: 19px;\n\n code {\n color: inherit;\n font-size: inherit;\n }\n }\n\n pre code {\n margin: 0;\n padding: 0;\n white-space: pre;\n border: none;\n background: transparent;\n }\n\n pre code,\n pre tt {\n background-color: transparent;\n border: none;\n }\n\n /* GitHub inspired Markdown styles loosely from https://gist.github.com/tuzz/3331384 */\n\n body > *:first-of-type {\n margin-top: 0 !important;\n }\n\n body > *:last-child {\n margin-bottom: 0 !important;\n }\n\n a {\n color: ", ";\n text-decoration: none;\n }\n\n a.absent {\n color: #cc0000;\n }\n\n a.anchor {\n display: block;\n padding-left: 30px;\n margin-left: -30px;\n cursor: pointer;\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n }\n\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n margin: 20px 0 10px;\n padding: 0;\n cursor: text;\n position: relative;\n }\n\n h2:first-of-type,\n h1:first-of-type,\n h1:first-of-type + h2,\n h3:first-of-type,\n h4:first-of-type,\n h5:first-of-type,\n h6:first-of-type {\n margin-top: 0;\n padding-top: 0;\n }\n\n h1:hover a.anchor,\n h2:hover a.anchor,\n h3:hover a.anchor,\n h4:hover a.anchor,\n h5:hover a.anchor,\n h6:hover a.anchor {\n text-decoration: none;\n }\n\n h1 tt,\n h1 code {\n font-size: inherit;\n }\n\n h2 tt,\n h2 code {\n font-size: inherit;\n }\n\n h3 tt,\n h3 code {\n font-size: inherit;\n }\n\n h4 tt,\n h4 code {\n font-size: inherit;\n }\n\n h5 tt,\n h5 code {\n font-size: inherit;\n }\n\n h6 tt,\n h6 code {\n font-size: inherit;\n }\n\n p,\n blockquote,\n ul,\n ol,\n dl,\n li,\n table,\n pre {\n margin: 15px 0;\n }\n\n hr {\n border: 0 none;\n color: ", ";\n height: 4px;\n padding: 0;\n }\n\n body > h2:first-of-type {\n margin-top: 0;\n padding-top: 0;\n }\n\n body > h1:first-of-type {\n margin-top: 0;\n padding-top: 0;\n }\n\n body > h1:first-of-type + h2 {\n margin-top: 0;\n padding-top: 0;\n }\n\n body > h3:first-of-type,\n body > h4:first-of-type,\n body > h5:first-of-type,\n body > h6:first-of-type {\n margin-top: 0;\n padding-top: 0;\n }\n\n a:first-of-type h1,\n a:first-of-type h2,\n a:first-of-type h3,\n a:first-of-type h4,\n a:first-of-type h5,\n a:first-of-type h6 {\n margin-top: 0;\n padding-top: 0;\n }\n\n h1 p,\n h2 p,\n h3 p,\n h4 p,\n h5 p,\n h6 p {\n margin-top: 0;\n }\n\n li p.first {\n display: inline-block;\n }\n\n ul,\n ol {\n padding-left: 30px;\n }\n\n ul :first-of-type,\n ol :first-of-type {\n margin-top: 0;\n }\n\n ul :last-child,\n ol :last-child {\n margin-bottom: 0;\n }\n\n dl {\n padding: 0;\n }\n\n dl dt {\n font-size: 14px;\n font-weight: bold;\n font-style: italic;\n padding: 0;\n margin: 15px 0 5px;\n }\n\n dl dt:first-of-type {\n padding: 0;\n }\n\n dl dt > :first-of-type {\n margin-top: 0;\n }\n\n dl dt > :last-child {\n margin-bottom: 0;\n }\n\n dl dd {\n margin: 0 0 15px;\n padding: 0 15px;\n }\n\n dl dd > :first-of-type {\n margin-top: 0;\n }\n\n dl dd > :last-child {\n margin-bottom: 0;\n }\n\n blockquote {\n border-left: 4px solid ", ";\n padding: 0 15px;\n color: ", ";\n }\n\n blockquote > :first-of-type {\n margin-top: 0;\n }\n\n blockquote > :last-child {\n margin-bottom: 0;\n }\n\n table {\n padding: 0;\n border-collapse: collapse;\n }\n table tr {\n border-top: 1px solid ", ";\n background-color: white;\n margin: 0;\n padding: 0;\n }\n\n table tr:nth-of-type(2n) {\n background-color: ", ";\n }\n\n table tr th {\n font-weight: bold;\n border: 1px solid ", ";\n text-align: left;\n margin: 0;\n padding: 6px 13px;\n }\n\n table tr td {\n border: 1px solid ", ";\n text-align: left;\n margin: 0;\n padding: 6px 13px;\n }\n\n table tr th :first-of-type,\n table tr td :first-of-type {\n margin-top: 0;\n }\n\n table tr th :last-child,\n table tr td :last-child {\n margin-bottom: 0;\n }\n\n img {\n max-width: 100%;\n }\n\n span.frame {\n display: block;\n overflow: hidden;\n }\n\n span.frame > span {\n border: 1px solid ", ";\n display: block;\n float: left;\n overflow: hidden;\n margin: 13px 0 0;\n padding: 7px;\n width: auto;\n }\n\n span.frame span img {\n display: block;\n float: left;\n }\n\n span.frame span span {\n clear: both;\n color: ", ";\n display: block;\n padding: 5px 0 0;\n }\n\n span.align-center {\n display: block;\n overflow: hidden;\n clear: both;\n }\n\n span.align-center > span {\n display: block;\n overflow: hidden;\n margin: 13px auto 0;\n text-align: center;\n }\n\n span.align-center span img {\n margin: 0 auto;\n text-align: center;\n }\n\n span.align-right {\n display: block;\n overflow: hidden;\n clear: both;\n }\n\n span.align-right > span {\n display: block;\n overflow: hidden;\n margin: 13px 0 0;\n text-align: right;\n }\n\n span.align-right span img {\n margin: 0;\n text-align: right;\n }\n\n span.float-left {\n display: block;\n margin-right: 13px;\n overflow: hidden;\n float: left;\n }\n\n span.float-left span {\n margin: 13px 0 0;\n }\n\n span.float-right {\n display: block;\n margin-left: 13px;\n overflow: hidden;\n float: right;\n }\n\n span.float-right > span {\n display: block;\n overflow: hidden;\n margin: 13px auto 0;\n text-align: right;\n }\n\n code,\n tt {\n margin: 0 2px;\n padding: 0 5px;\n white-space: nowrap;\n border: 1px solid ", ";\n background-color: ", ";\n border-radius: 3px;\n color: ", ";\n }\n "]);
20
20
 
21
21
  _templateObject = function _templateObject() {
22
22
  return data;
@@ -29,7 +29,7 @@ function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(
29
29
 
30
30
  var DocumentWrapper = _theming.styled.div(function (_ref) {
31
31
  var theme = _ref.theme;
32
- return (0, _theming.css)(_templateObject(), theme.typography.size.s2, theme.typography.size.l1, theme.typography.weight.black, theme.typography.size.m2, theme.appBorderColor, theme.typography.size.m1, theme.typography.size.s3, theme.typography.size.s2, theme.typography.size.s2, theme.color.dark, theme.color.secondary, theme.appBorderColor, theme.color.medium, theme.color.dark, theme.appBorderColor, theme.color.lighter, theme.appBorderColor, theme.appBorderColor, theme.color.medium, theme.color.darkest, theme.color.mediumlight, theme.color.lighter);
32
+ return (0, _theming.css)(_templateObject(), theme.typography.size.s2, theme.typography.size.l1, theme.typography.weight.black, theme.typography.size.m2, theme.appBorderColor, theme.typography.size.m1, theme.typography.size.s3, theme.typography.size.s2, theme.typography.size.s2, theme.color.dark, theme.color.secondary, theme.appBorderColor, theme.color.medium, theme.color.dark, theme.appBorderColor, theme.color.lighter, theme.appBorderColor, theme.appBorderColor, theme.color.medium, theme.color.darkest, theme.color.mediumlight, theme.color.lighter, theme.base === 'dark' && theme.color.darkest);
33
33
  });
34
34
 
35
35
  exports.DocumentWrapper = DocumentWrapper;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storybook/components",
3
- "version": "5.2.1",
3
+ "version": "5.2.5",
4
4
  "description": "Core Storybook Components",
5
5
  "keywords": [
6
6
  "storybook"
@@ -15,15 +15,22 @@
15
15
  "directory": "lib/components"
16
16
  },
17
17
  "license": "MIT",
18
+ "files": [
19
+ "dist/**/*",
20
+ "README.md",
21
+ "*.js",
22
+ "*.d.ts"
23
+ ],
18
24
  "main": "dist/index.js",
19
25
  "types": "dist/index.d.ts",
20
26
  "scripts": {
21
27
  "prepare": "node ../../scripts/prepare.js"
22
28
  },
23
29
  "dependencies": {
24
- "@storybook/client-logger": "5.2.1",
25
- "@storybook/theming": "5.2.1",
30
+ "@storybook/client-logger": "5.2.5",
31
+ "@storybook/theming": "5.2.5",
26
32
  "@types/react-syntax-highlighter": "10.1.0",
33
+ "@types/react-textarea-autosize": "^4.3.3",
27
34
  "core-js": "^3.0.1",
28
35
  "global": "^4.3.2",
29
36
  "markdown-to-jsx": "^6.9.1",
@@ -41,7 +48,6 @@
41
48
  "simplebar-react": "^1.0.0-alpha.6"
42
49
  },
43
50
  "devDependencies": {
44
- "@types/react-textarea-autosize": "^4.3.3",
45
51
  "enzyme": "^3.9.0",
46
52
  "jest": "^24.7.1",
47
53
  "jest-enzyme": "^7.0.2"
@@ -53,5 +59,5 @@
53
59
  "publishConfig": {
54
60
  "access": "public"
55
61
  },
56
- "gitHead": "5497d2ea8d47c4573d245126e6f3f45bc176c12d"
62
+ "gitHead": "6e80db697f865f833cf3e250573a7ce36e0ee02a"
57
63
  }
@@ -1,41 +0,0 @@
1
- import React, { ReactNode } from 'react';
2
- import { action } from '@storybook/addon-actions';
3
-
4
- import { ActionBar } from './ActionBar';
5
-
6
- const action1 = action('action1');
7
- const action2 = action('action2');
8
- const action3 = action('action3');
9
-
10
- export default {
11
- component: ActionBar,
12
- title: 'Basics|ActionBar',
13
- decorators: [
14
- (storyFn: () => ReactNode) => (
15
- <div
16
- style={{
17
- position: 'relative',
18
- width: '300px',
19
- height: '64px',
20
- margin: '1rem',
21
- background: 'papayawhip',
22
- border: '1px solid rgba(0,0,0,.05)',
23
- }}
24
- >
25
- {storyFn()}
26
- </div>
27
- ),
28
- ],
29
- };
30
-
31
- export const singleItem = () => <ActionBar actionItems={[{ title: 'Clear', onClick: action1 }]} />;
32
-
33
- export const manyItems = () => (
34
- <ActionBar
35
- actionItems={[
36
- { title: 'Action string', onClick: action1 },
37
- { title: <div>Action node</div>, onClick: action2 },
38
- { title: 'Long action string', onClick: action3 },
39
- ]}
40
- />
41
- );
@@ -1,75 +0,0 @@
1
- import React, { FunctionComponent } from 'react';
2
-
3
- import { styled } from '@storybook/theming';
4
-
5
- const Container = styled.div<{}>(({ theme }) => ({
6
- position: 'absolute',
7
- bottom: 0,
8
- right: 0,
9
- maxWidth: '100%',
10
- display: 'flex',
11
- background: theme.background.content,
12
- zIndex: 1,
13
- }));
14
-
15
- export const ActionButton = styled.button<{ disabled: boolean }>(
16
- ({ theme }) => ({
17
- border: '0 none',
18
- padding: '4px 10px',
19
- cursor: 'pointer',
20
- display: 'flex',
21
- alignItems: 'center',
22
-
23
- color: theme.color.defaultText,
24
- background: theme.background.content,
25
-
26
- fontSize: 12,
27
- lineHeight: '16px',
28
- fontFamily: theme.typography.fonts.base,
29
- fontWeight: theme.typography.weight.bold,
30
-
31
- borderTop: `1px solid ${theme.appBorderColor}`,
32
- borderLeft: `1px solid ${theme.appBorderColor}`,
33
- marginLeft: -1,
34
-
35
- borderRadius: `4px 0 0 0`,
36
-
37
- '&:not(:last-child)': { borderRight: `1px solid ${theme.appBorderColor}` },
38
- '& + *': {
39
- borderLeft: `1px solid ${theme.appBorderColor}`,
40
- borderRadius: 0,
41
- },
42
-
43
- '&:focus': {
44
- boxShadow: `${theme.color.secondary} 0 -3px 0 0 inset`,
45
- outline: '0 none',
46
- },
47
- }),
48
- ({ disabled }) =>
49
- disabled && {
50
- cursor: 'not-allowed',
51
- opacity: 0.5,
52
- }
53
- );
54
- ActionButton.displayName = 'ActionButton';
55
-
56
- export interface ActionItem {
57
- title: string | JSX.Element;
58
- onClick: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
59
- disabled?: boolean;
60
- }
61
-
62
- export interface ActionBarProps {
63
- actionItems: ActionItem[];
64
- }
65
-
66
- export const ActionBar: FunctionComponent<ActionBarProps> = ({ actionItems, ...props }) => (
67
- <Container {...props}>
68
- {actionItems.map(({ title, onClick, disabled }, index: number) => (
69
- // eslint-disable-next-line react/no-array-index-key
70
- <ActionButton key={index} onClick={onClick} disabled={disabled}>
71
- {title}
72
- </ActionButton>
73
- ))}
74
- </Container>
75
- );
@@ -1,11 +0,0 @@
1
- import React from 'react';
2
- import { storiesOf } from '@storybook/react';
3
- import { Badge } from './Badge';
4
-
5
- storiesOf('Basics|Badge', module).add('all badges', () => (
6
- <div>
7
- <Badge status="positive">Positive</Badge>
8
- <Badge status="negative">Negative</Badge>
9
- <Badge status="neutral">Neutral</Badge>
10
- </div>
11
- ));
@@ -1,68 +0,0 @@
1
- import React, { FunctionComponent } from 'react';
2
- import { styled, css } from '@storybook/theming';
3
-
4
- type BadgeWrapperProps = BadgeProps;
5
-
6
- const BadgeWrapper = styled.div<BadgeWrapperProps>`
7
- display: inline-block;
8
- font-size: 11px;
9
- line-height: 12px;
10
- align-self: center;
11
- padding: 4px 12px;
12
- border-radius: 3em;
13
- font-weight: ${props => props.theme.typography.weight.bold};
14
-
15
- svg {
16
- height: 12px;
17
- width: 12px;
18
- margin-right: 4px;
19
- margin-top: -2px;
20
-
21
- path {
22
- fill: currentColor;
23
- }
24
- }
25
-
26
- ${props =>
27
- props.status === 'critical' &&
28
- css`
29
- color: ${props.theme.color.critical};
30
- background: ${props.theme.background.critical};
31
- `};
32
-
33
- ${props =>
34
- props.status === 'negative' &&
35
- css`
36
- color: ${props.theme.color.negative};
37
- background: ${props.theme.background.negative};
38
- `};
39
-
40
- ${props =>
41
- props.status === 'warning' &&
42
- css`
43
- color: ${props.theme.color.warning};
44
- background: ${props.theme.background.warning};
45
- `};
46
-
47
- ${props =>
48
- props.status === 'neutral' &&
49
- css`
50
- color: ${props.theme.color.dark};
51
- background: ${props.theme.color.mediumlight};
52
- `};
53
-
54
- ${props =>
55
- props.status === 'positive' &&
56
- css`
57
- color: ${props.theme.color.positive};
58
- background: ${props.theme.background.positive};
59
- `};
60
- `;
61
-
62
- export interface BadgeProps {
63
- status: 'positive' | 'negative' | 'neutral' | 'warning' | 'critical';
64
- }
65
-
66
- export const Badge: FunctionComponent<BadgeProps> = ({ ...props }) => {
67
- return <BadgeWrapper {...props} />;
68
- };
@@ -1,53 +0,0 @@
1
- import React from 'react';
2
- import { storiesOf } from '@storybook/react';
3
- import { Button } from './Button';
4
- import { Icons } from '../icon/icon';
5
-
6
- import { Form } from '../form/index';
7
-
8
- const { Button: FormButton } = Form;
9
-
10
- storiesOf('Basics|Button', module).add('all buttons', () => (
11
- <div>
12
- <p>Button that is used for forms</p>
13
- <FormButton>Form.Button</FormButton>
14
- <br />
15
- <p>Buttons that are used for everything else</p>
16
- <Button primary>Primary</Button>
17
- <Button secondary>Secondary</Button>
18
- <Button outline containsIcon>
19
- <Icons icon="link" />
20
- </Button>
21
- <br />
22
- <Button outline>Outline</Button>
23
- <Button outline primary>
24
- Outline primary
25
- </Button>
26
- <Button outline secondary>
27
- Outline secondary
28
- </Button>
29
- <Button primary disabled>
30
- Disabled
31
- </Button>
32
- <br />
33
- <Button primary small>
34
- Primary
35
- </Button>
36
- <Button secondary small>
37
- Secondary
38
- </Button>
39
- <Button outline small>
40
- Outline
41
- </Button>
42
- <Button primary disabled small>
43
- Disabled
44
- </Button>
45
- <Button outline small containsIcon>
46
- <Icons icon="link" />
47
- </Button>
48
- <Button outline small>
49
- <Icons icon="link" />
50
- Link
51
- </Button>
52
- </div>
53
- ));
@@ -1,256 +0,0 @@
1
- import React, { FunctionComponent, forwardRef } from 'react';
2
- import { styled, css } from '@storybook/theming';
3
- import { darken, lighten, rgba, transparentize } from 'polished';
4
-
5
- type ButtonWrapperProps = ButtonProps;
6
-
7
- const ButtonWrapper = styled.button<ButtonWrapperProps>`
8
- border: 0;
9
- border-radius: 3em;
10
- cursor: pointer;
11
- display: inline-block;
12
- overflow: hidden;
13
- padding: ${props => (props.small ? '10px 16px' : '13px 20px')};
14
- position: relative;
15
- text-align: center;
16
- text-decoration: none;
17
- transition: all 150ms ease-out;
18
- transform: translate3d(0,0,0);
19
- vertical-align: top;
20
- white-space: nowrap;
21
- user-select: none;
22
- opacity: 1;
23
- margin: 0;
24
- background: transparent;
25
-
26
-
27
- font-size: ${props =>
28
- props.small ? props.theme.typography.size.s1 : props.theme.typography.size.s2 - 1}px;
29
- font-weight: ${props => props.theme.typography.weight.bold};
30
- line-height: 1;
31
-
32
-
33
- svg {
34
- display: inline-block;
35
- height: ${props => (props.small ? '14' : '16')}px;
36
- width: ${props => (props.small ? '14' : '16')}px;
37
- vertical-align: top;
38
- margin-right: ${props => (props.small ? '4' : '6')}px;
39
- margin-top: ${props => (props.small ? '-1' : '-2')}px;
40
- margin-bottom: ${props => (props.small ? '-1' : '-2')}px;
41
-
42
- /* Necessary for js mouse events to not glitch out when hovering on svgs */
43
- pointer-events: none;
44
-
45
- path { fill: currentColor; }
46
- }
47
-
48
- ${props =>
49
- props.disabled &&
50
- css`
51
- cursor: not-allowed !important;
52
- opacity: 0.5;
53
- &:hover {
54
- transform: none;
55
- }
56
- `}
57
-
58
- ${props =>
59
- props.containsIcon &&
60
- css`
61
- svg {
62
- display: block;
63
- margin: 0;
64
- }
65
-
66
- ${props.small &&
67
- css`
68
- padding: 9px;
69
- `}
70
-
71
- ${!props.small &&
72
- css`
73
- padding: 12px;
74
- `}
75
- `}
76
-
77
- /* Colored button for primary CTAs */
78
- ${props =>
79
- props.primary &&
80
- css`
81
- background: ${props.theme.color.primary};
82
- color: ${props.theme.color.lightest};
83
-
84
- &:hover {
85
- background: ${darken(0.05, props.theme.color.primary)};
86
- }
87
- &:active {
88
- box-shadow: rgba(0, 0, 0, 0.1) 0 0 0 3em inset;
89
- }
90
- &:focus {
91
- box-shadow: ${rgba(props.theme.color.primary, 0.4)} 0 1px 9px 2px;
92
- }
93
- &:focus:hover {
94
- box-shadow: ${rgba(props.theme.color.primary, 0.2)} 0 8px 18px 0px;
95
- }
96
- `}
97
-
98
-
99
- /* Colored button for secondary CTAs */
100
- ${props =>
101
- props.secondary &&
102
- css`
103
- background: ${props.theme.color.secondary};
104
- color: ${props.theme.color.lightest};
105
-
106
- &:hover {
107
- background: ${darken(0.05, props.theme.color.secondary)};
108
- }
109
- &:active {
110
- box-shadow: rgba(0, 0, 0, 0.1) 0 0 0 3em inset;
111
- }
112
- &:focus {
113
- box-shadow: ${rgba(props.theme.color.secondary, 0.4)} 0 1px 9px 2px;
114
- }
115
- &:focus:hover {
116
- box-shadow: ${rgba(props.theme.color.secondary, 0.2)} 0 8px 18px 0px;
117
- }
118
- `}
119
-
120
- /* Button for tertiary CTAs and forms that responds to theme */
121
- ${props =>
122
- props.tertiary &&
123
- css`
124
- background: ${props.theme.base === 'light'
125
- ? darken(0.02, props.theme.input.background)
126
- : lighten(0.02, props.theme.input.background)};
127
- color: ${props.theme.input.color};
128
- box-shadow: ${props.theme.input.border} 0 0 0 1px inset;
129
- border-radius: ${props.theme.input.borderRadius}px;
130
-
131
- &:hover {
132
- background: ${props.theme.base === 'light'
133
- ? darken(0.05, props.theme.input.background)
134
- : lighten(0.05, props.theme.input.background)};
135
- ${props.inForm
136
- ? ''
137
- : 'box-shadow: rgba(0,0,0,.2) 0 2px 6px 0, rgba(0,0,0,.1) 0 0 0 1px inset'}
138
- }
139
- &:active {
140
- background: ${props.theme.base === 'light'
141
- ? props.theme.input.background
142
- : props.theme.input.background};
143
- }
144
- &:focus {
145
- box-shadow: ${rgba(props.theme.color.secondary, 0.4)} 0 0 0 1px inset;
146
- }
147
- `}
148
-
149
- /* Button that's outlined */
150
- ${props =>
151
- props.outline &&
152
- css`
153
- box-shadow: ${transparentize(0.8, props.theme.color.defaultText)} 0 0 0 1px inset;
154
- color: ${transparentize(0.3, props.theme.color.defaultText)};
155
- background: transparent;
156
-
157
- &:hover {
158
- box-shadow: ${transparentize(0.5, props.theme.color.defaultText)} 0 0 0 1px inset;
159
- }
160
-
161
- &:active {
162
- box-shadow: ${transparentize(0.5, props.theme.color.defaultText)} 0 0 0 2px inset;
163
- color: ${transparentize(0, props.theme.color.defaultText)};
164
- }
165
-
166
- ${props.primary &&
167
- css`
168
- box-shadow: ${props.theme.color.primary} 0 0 0 1px inset;
169
- color: ${props.theme.color.primary};
170
-
171
- svg path {
172
- fill: ${props.theme.color.primary};
173
- }
174
-
175
- &:hover {
176
- box-shadow: ${props.theme.color.primary} 0 0 0 1px inset;
177
- background: transparent;
178
- }
179
-
180
- &:active {
181
- background: ${props.theme.color.primary};
182
- box-shadow: ${props.theme.color.primary} 0 0 0 1px inset;
183
- color: ${props.theme.color.lightest};
184
- }
185
- &:focus {
186
- box-shadow: ${props.theme.color.primary} 0 0 0 1px inset,
187
- ${rgba(props.theme.color.primary, 0.4)} 0 1px 9px 2px;
188
- }
189
- &:focus:hover {
190
- box-shadow: ${props.theme.color.primary} 0 0 0 1px inset,
191
- ${rgba(props.theme.color.primary, 0.2)} 0 8px 18px 0px;
192
- }
193
- `};
194
-
195
- ${props.secondary &&
196
- css`
197
- box-shadow: ${props.theme.color.secondary} 0 0 0 1px inset;
198
- color: ${props.theme.color.secondary};
199
-
200
- &:hover {
201
- box-shadow: ${props.theme.color.secondary} 0 0 0 1px inset;
202
- background: transparent;
203
- }
204
-
205
- &:active {
206
- background: ${props.theme.color.secondary};
207
- box-shadow: ${props.theme.color.secondary} 0 0 0 1px inset;
208
- color: ${props.theme.color.lightest};
209
- }
210
- &:focus {
211
- box-shadow: ${props.theme.color.secondary} 0 0 0 1px inset,
212
- ${rgba(props.theme.color.secondary, 0.4)} 0 1px 9px 2px;
213
- }
214
- &:focus:hover {
215
- box-shadow: ${props.theme.color.secondary} 0 0 0 1px inset,
216
- ${rgba(props.theme.color.secondary, 0.2)} 0 8px 18px 0px;
217
- }
218
- `};
219
- `}
220
- `;
221
-
222
- const ButtonLink = ButtonWrapper.withComponent('a');
223
-
224
- export interface ButtonProps {
225
- isLink?: boolean;
226
- primary?: boolean;
227
- secondary?: boolean;
228
- tertiary?: boolean;
229
- inForm?: boolean;
230
- disabled?: boolean;
231
- small?: boolean;
232
- outline?: boolean;
233
- containsIcon?: boolean;
234
- }
235
-
236
- export const Button = Object.assign(
237
- forwardRef<any, ButtonProps>(({ isLink, children, ...props }, ref) => {
238
- if (isLink) {
239
- return (
240
- <ButtonLink {...props} ref={ref}>
241
- {children}
242
- </ButtonLink>
243
- );
244
- }
245
- return (
246
- <ButtonWrapper {...props} ref={ref}>
247
- {children}
248
- </ButtonWrapper>
249
- );
250
- }),
251
- {
252
- defaultProps: {
253
- isLink: false,
254
- },
255
- }
256
- );