@storybook/components 6.0.17 → 6.0.21

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.
@@ -7,7 +7,7 @@ require("core-js/modules/es.object.assign");
7
7
  Object.defineProperty(exports, "__esModule", {
8
8
  value: true
9
9
  });
10
- exports.StringNoControlsCompact = exports.StringNoControls = exports.StringCompact = exports.Markdown = exports.LongEnum = exports.Enum = exports.Func = exports.ComplexObject = exports.ArrayOf = exports.ObjectOf = exports.MultiSelect = exports.Select = exports.InlineCheck = exports.Check = exports.InlineRadio = exports.Radio = exports.Range = exports.Number = exports.Date = exports.Color = exports.Boolean = exports.LongDesc = exports.LongName = exports.String = exports["default"] = void 0;
10
+ exports.StringNoControlsCompact = exports.StringNoControls = exports.StringCompact = exports.Markdown = exports.ComplexUnion = exports.complexUnion = exports.LongEnum = exports.Enum = exports.Func = exports.ComplexObject = exports.ArrayOf = exports.ObjectOf = exports.MultiSelect = exports.Select = exports.InlineCheck = exports.Check = exports.InlineRadio = exports.Radio = exports.Range = exports.Number = exports.Date = exports.Color = exports.Boolean = exports.LongDesc = exports.LongName = exports.String = exports["default"] = void 0;
11
11
 
12
12
  var _react = _interopRequireDefault(require("react"));
13
13
 
@@ -349,6 +349,24 @@ LongEnum.args = Object.assign(Object.assign({}, baseArgs), {}, {
349
349
  }
350
350
  }
351
351
  });
352
+ var complexUnion = '((a: string | SVGSVGElement) => void) | RefObject<SVGSVGElement | number> | [a|b] | {a|b}';
353
+ exports.complexUnion = complexUnion;
354
+ var ComplexUnion = Template.bind({});
355
+ exports.ComplexUnion = ComplexUnion;
356
+ ComplexUnion.args = Object.assign(Object.assign({}, baseArgs), {}, {
357
+ row: {
358
+ key: 'complexUnion',
359
+ name: 'Complex',
360
+ type: {
361
+ required: true
362
+ },
363
+ table: {
364
+ type: {
365
+ summary: complexUnion
366
+ }
367
+ }
368
+ }
369
+ });
352
370
  var Markdown = Template.bind({});
353
371
  exports.Markdown = Markdown;
354
372
  Markdown.args = Object.assign(Object.assign({}, baseArgs), {}, {
@@ -10,6 +10,8 @@ require("core-js/modules/es.symbol.iterator");
10
10
 
11
11
  require("core-js/modules/es.array.from");
12
12
 
13
+ require("core-js/modules/es.array.includes");
14
+
13
15
  require("core-js/modules/es.array.is-array");
14
16
 
15
17
  require("core-js/modules/es.array.iterator");
@@ -22,12 +24,16 @@ require("core-js/modules/es.date.to-string");
22
24
 
23
25
  require("core-js/modules/es.function.name");
24
26
 
27
+ require("core-js/modules/es.object.assign");
28
+
25
29
  require("core-js/modules/es.object.to-string");
26
30
 
27
31
  require("core-js/modules/es.regexp.exec");
28
32
 
29
33
  require("core-js/modules/es.regexp.to-string");
30
34
 
35
+ require("core-js/modules/es.string.includes");
36
+
31
37
  require("core-js/modules/es.string.iterator");
32
38
 
33
39
  require("core-js/modules/es.string.split");
@@ -98,21 +104,27 @@ var Summary = _theming.styled.div(function (_ref) {
98
104
  });
99
105
 
100
106
  var Text = _theming.styled.span(_shared.codeCommon, function (_ref2) {
101
- var theme = _ref2.theme;
102
- return {
107
+ var theme = _ref2.theme,
108
+ _ref2$simple = _ref2.simple,
109
+ simple = _ref2$simple === void 0 ? false : _ref2$simple;
110
+ return Object.assign({
103
111
  flex: '0 0 auto',
104
112
  fontFamily: theme.typography.fonts.mono,
105
113
  fontSize: theme.typography.size.s1,
106
114
  wordBreak: 'break-word',
115
+ whiteSpace: 'normal',
116
+ maxWidth: '100%',
107
117
  margin: 0,
108
118
  marginRight: '4px',
109
119
  marginBottom: '4px',
110
120
  paddingTop: '2px',
111
121
  paddingBottom: '2px',
112
- lineHeight: '13px',
113
- whiteSpace: 'normal',
114
- maxWidth: '100%'
115
- };
122
+ lineHeight: '13px'
123
+ }, simple && {
124
+ background: 'transparent',
125
+ border: '0 none',
126
+ paddingLeft: 0
127
+ });
116
128
  });
117
129
 
118
130
  var ExpandButton = _theming.styled.button(function (_ref3) {
@@ -173,8 +185,11 @@ var EmptyArg = function EmptyArg() {
173
185
  EmptyArg.displayName = "EmptyArg";
174
186
 
175
187
  var ArgText = function ArgText(_ref6) {
176
- var text = _ref6.text;
177
- return /*#__PURE__*/_react["default"].createElement(Text, null, text);
188
+ var text = _ref6.text,
189
+ simple = _ref6.simple;
190
+ return /*#__PURE__*/_react["default"].createElement(Text, {
191
+ simple: simple
192
+ }, text);
178
193
  };
179
194
 
180
195
  ArgText.displayName = "ArgText";
@@ -232,6 +247,15 @@ var ArgSummary = function ArgSummary(_ref7) {
232
247
  var summaryAsString = typeof summary.toString === 'function' ? summary.toString() : summary;
233
248
 
234
249
  if (detail == null) {
250
+ var cannotBeSafelySplitted = /[(){}[\]<>]/.test(summaryAsString);
251
+
252
+ if (cannotBeSafelySplitted) {
253
+ return /*#__PURE__*/_react["default"].createElement(ArgText, {
254
+ text: summaryAsString,
255
+ simple: summaryAsString.includes('|')
256
+ });
257
+ }
258
+
235
259
  var summaryItems = getSummaryItems(summaryAsString);
236
260
  var itemsCount = summaryItems.length;
237
261
  var hasManyItems = itemsCount > ITEMS_BEFORE_EXPANSION;
@@ -110,7 +110,7 @@ var BooleanControl = function BooleanControl(_ref2) {
110
110
  onChange: function onChange(e) {
111
111
  return _onChange(e.target.checked);
112
112
  },
113
- checked: value
113
+ checked: value || false
114
114
  }, {
115
115
  name: name,
116
116
  onBlur: onBlur,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storybook/components",
3
- "version": "6.0.17",
3
+ "version": "6.0.21",
4
4
  "description": "Core Storybook Components",
5
5
  "keywords": [
6
6
  "storybook"
@@ -28,9 +28,9 @@
28
28
  "prepare": "node ../../scripts/prepare.js"
29
29
  },
30
30
  "dependencies": {
31
- "@storybook/client-logger": "6.0.17",
31
+ "@storybook/client-logger": "6.0.21",
32
32
  "@storybook/csf": "0.0.1",
33
- "@storybook/theming": "6.0.17",
33
+ "@storybook/theming": "6.0.21",
34
34
  "@types/overlayscrollbars": "^1.9.0",
35
35
  "@types/react-color": "^3.0.1",
36
36
  "@types/react-syntax-highlighter": "11.0.4",
@@ -64,7 +64,7 @@
64
64
  "publishConfig": {
65
65
  "access": "public"
66
66
  },
67
- "gitHead": "cfe34ef01268e3b1607c34da04efd3ed290f381c",
67
+ "gitHead": "fb14a86c1cbf5eb21023bf2021eecdea9c6df83d",
68
68
  "typesVersions": {
69
69
  "<=3.5": {
70
70
  "*": [