@storybook/components 6.4.0-beta.22 → 6.4.0-beta.23

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.
@@ -63,12 +63,14 @@ var Side = _theming.styled.div({
63
63
  display: 'flex',
64
64
  whiteSpace: 'nowrap',
65
65
  flexBasis: 'auto',
66
- flexShrink: 0
66
+ flexShrink: 0,
67
+ marginLeft: 3,
68
+ marginRight: 3
67
69
  }, function (_ref) {
68
70
  var left = _ref.left;
69
71
  return left ? {
70
72
  '& > *': {
71
- marginLeft: 15
73
+ marginLeft: 4
72
74
  }
73
75
  } : {};
74
76
  }, function (_ref2) {
@@ -76,7 +78,7 @@ var Side = _theming.styled.div({
76
78
  return right ? {
77
79
  marginLeft: 30,
78
80
  '& > *': {
79
- marginRight: 15
81
+ marginRight: 4
80
82
  }
81
83
  } : {};
82
84
  });
@@ -15,6 +15,10 @@ var _react = _interopRequireDefault(require("react"));
15
15
 
16
16
  var _theming = require("@storybook/theming");
17
17
 
18
+ var _polished = require("polished");
19
+
20
+ var _core = require("@popperjs/core");
21
+
18
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
23
 
20
24
  function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
@@ -84,36 +88,40 @@ var IconButton = (0, _theming.styled)(ButtonOrLink, {
84
88
  })(function (_ref4) {
85
89
  var theme = _ref4.theme;
86
90
  return {
87
- display: 'inline-flex',
88
- justifyContent: 'center',
89
91
  alignItems: 'center',
90
- height: 40,
91
- background: 'none',
92
+ background: 'transparent',
93
+ border: 'none',
94
+ borderRadius: 4,
92
95
  color: 'inherit',
93
- padding: 0,
94
96
  cursor: 'pointer',
95
- // Icon Buttons may have text depending on user preferences.
96
- // While we don't recommend having text for IconButtons, this style ensures that the text is the correct size.
97
- fontWeight: 'bold',
97
+ display: 'inline-flex',
98
98
  fontSize: 13,
99
- border: '0 solid transparent',
100
- borderTop: '3px solid transparent',
101
- borderBottom: '3px solid transparent',
102
- transition: 'color 0.2s linear, border-bottom-color 0.2s linear',
103
- '&:hover, &:focus': {
104
- outline: '0 none',
99
+ fontWeight: 'bold',
100
+ height: 28,
101
+ justifyContent: 'center',
102
+ marginTop: 6,
103
+ padding: '8px 7px',
104
+ '&:hover, &:focus-visible': {
105
+ background: (0, _polished.transparentize)(0.88, theme.color.secondary),
105
106
  color: theme.color.secondary
106
107
  },
108
+ '&:focus-visible': {
109
+ outline: _core.auto // Ensures links have the same focus style
110
+
111
+ },
112
+ '&:focus:not(:focus-visible)': {
113
+ outline: 'none'
114
+ },
107
115
  '& > svg': {
108
- width: 15
116
+ width: 14
109
117
  }
110
118
  };
111
119
  }, function (_ref5) {
112
120
  var active = _ref5.active,
113
121
  theme = _ref5.theme;
114
122
  return active ? {
115
- outline: '0 none',
116
- borderBottomColor: theme.color.secondary
123
+ backgroundColor: theme.background.hoverable,
124
+ color: theme.color.secondary
117
125
  } : {};
118
126
  });
119
127
  exports.IconButton = IconButton;
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.WithTextActive = exports.WithText = exports.Active = exports._IconButton = exports.default = void 0;
7
+
8
+ var _react = _interopRequireDefault(require("react"));
9
+
10
+ var _button = require("./button");
11
+
12
+ var _icon = require("../icon/icon");
13
+
14
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
+
16
+ var _default = {
17
+ component: _button.IconButton,
18
+ title: 'Basics/IconButton'
19
+ };
20
+ exports.default = _default;
21
+
22
+ var _IconButton = function _IconButton() {
23
+ return /*#__PURE__*/_react.default.createElement(_button.IconButton, null, /*#__PURE__*/_react.default.createElement(_icon.Icons, {
24
+ icon: "bookmark"
25
+ }));
26
+ };
27
+
28
+ exports._IconButton = _IconButton;
29
+ _IconButton.displayName = "_IconButton";
30
+
31
+ var Active = function Active() {
32
+ return /*#__PURE__*/_react.default.createElement(_button.IconButton, {
33
+ active: true
34
+ }, /*#__PURE__*/_react.default.createElement(_icon.Icons, {
35
+ icon: "beaker"
36
+ }));
37
+ };
38
+
39
+ exports.Active = Active;
40
+ Active.displayName = "Active";
41
+
42
+ var WithText = function WithText() {
43
+ return /*#__PURE__*/_react.default.createElement(_button.IconButton, null, /*#__PURE__*/_react.default.createElement(_icon.Icons, {
44
+ icon: "circlehollow"
45
+ }), "\xA0Howdy!");
46
+ };
47
+
48
+ exports.WithText = WithText;
49
+ WithText.displayName = "WithText";
50
+
51
+ var WithTextActive = function WithTextActive() {
52
+ return /*#__PURE__*/_react.default.createElement(_button.IconButton, {
53
+ active: true
54
+ }, /*#__PURE__*/_react.default.createElement(_icon.Icons, {
55
+ icon: "circlehollow"
56
+ }), "\xA0Howdy!");
57
+ };
58
+
59
+ exports.WithTextActive = WithTextActive;
60
+ WithTextActive.displayName = "WithTextActive";
@@ -37,9 +37,11 @@ var Separator = _theming.styled.span(function (_ref) {
37
37
  var theme = _ref.theme;
38
38
  return {
39
39
  width: 1,
40
- height: 24,
40
+ height: 20,
41
41
  background: theme.appBorderColor,
42
- marginTop: 8
42
+ marginTop: 10,
43
+ marginLeft: 6,
44
+ marginRight: 2
43
45
  };
44
46
  }, function (_ref2) {
45
47
  var force = _ref2.force;
@@ -99,7 +99,7 @@ var Wrapper = _theming.styled.div(function (_ref) {
99
99
  var TabBar = _theming.styled.div({
100
100
  overflow: 'hidden',
101
101
  '&:first-of-type': {
102
- marginLeft: 0
102
+ marginLeft: -3
103
103
  }
104
104
  });
105
105
 
@@ -34,7 +34,7 @@ var Note = _theming.styled.div(function (_ref) {
34
34
  whiteSpace: 'nowrap',
35
35
  pointerEvents: 'none',
36
36
  zIndex: -1,
37
- background: 'rgba(0, 0, 0, 0.4)',
37
+ background: theme.base === 'light' ? 'rgba(60, 60, 60, 0.9)' : 'rgba(20, 20, 20, 0.85)',
38
38
  margin: 6
39
39
  };
40
40
  });
@@ -33,12 +33,14 @@ var Side = styled.div({
33
33
  display: 'flex',
34
34
  whiteSpace: 'nowrap',
35
35
  flexBasis: 'auto',
36
- flexShrink: 0
36
+ flexShrink: 0,
37
+ marginLeft: 3,
38
+ marginRight: 3
37
39
  }, function (_ref) {
38
40
  var left = _ref.left;
39
41
  return left ? {
40
42
  '& > *': {
41
- marginLeft: 15
43
+ marginLeft: 4
42
44
  }
43
45
  } : {};
44
46
  }, function (_ref2) {
@@ -46,7 +48,7 @@ var Side = styled.div({
46
48
  return right ? {
47
49
  marginLeft: 30,
48
50
  '& > *': {
49
- marginRight: 15
51
+ marginRight: 4
50
52
  }
51
53
  } : {};
52
54
  });
@@ -10,6 +10,8 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
10
10
 
11
11
  import React from 'react';
12
12
  import { styled, isPropValid } from '@storybook/theming';
13
+ import { transparentize } from 'polished';
14
+ import { auto } from '@popperjs/core';
13
15
 
14
16
  var ButtonOrLink = function ButtonOrLink(_ref) {
15
17
  var children = _ref.children,
@@ -71,36 +73,40 @@ export var IconButton = styled(ButtonOrLink, {
71
73
  })(function (_ref4) {
72
74
  var theme = _ref4.theme;
73
75
  return {
74
- display: 'inline-flex',
75
- justifyContent: 'center',
76
76
  alignItems: 'center',
77
- height: 40,
78
- background: 'none',
77
+ background: 'transparent',
78
+ border: 'none',
79
+ borderRadius: 4,
79
80
  color: 'inherit',
80
- padding: 0,
81
81
  cursor: 'pointer',
82
- // Icon Buttons may have text depending on user preferences.
83
- // While we don't recommend having text for IconButtons, this style ensures that the text is the correct size.
84
- fontWeight: 'bold',
82
+ display: 'inline-flex',
85
83
  fontSize: 13,
86
- border: '0 solid transparent',
87
- borderTop: '3px solid transparent',
88
- borderBottom: '3px solid transparent',
89
- transition: 'color 0.2s linear, border-bottom-color 0.2s linear',
90
- '&:hover, &:focus': {
91
- outline: '0 none',
84
+ fontWeight: 'bold',
85
+ height: 28,
86
+ justifyContent: 'center',
87
+ marginTop: 6,
88
+ padding: '8px 7px',
89
+ '&:hover, &:focus-visible': {
90
+ background: transparentize(0.88, theme.color.secondary),
92
91
  color: theme.color.secondary
93
92
  },
93
+ '&:focus-visible': {
94
+ outline: auto // Ensures links have the same focus style
95
+
96
+ },
97
+ '&:focus:not(:focus-visible)': {
98
+ outline: 'none'
99
+ },
94
100
  '& > svg': {
95
- width: 15
101
+ width: 14
96
102
  }
97
103
  };
98
104
  }, function (_ref5) {
99
105
  var active = _ref5.active,
100
106
  theme = _ref5.theme;
101
107
  return active ? {
102
- outline: '0 none',
103
- borderBottomColor: theme.color.secondary
108
+ backgroundColor: theme.background.hoverable,
109
+ color: theme.color.secondary
104
110
  } : {};
105
111
  });
106
112
  IconButton.displayName = 'IconButton';
@@ -0,0 +1,35 @@
1
+ import React from 'react';
2
+ import { IconButton } from './button';
3
+ import { Icons } from '../icon/icon';
4
+ export default {
5
+ component: IconButton,
6
+ title: 'Basics/IconButton'
7
+ };
8
+ export var _IconButton = function _IconButton() {
9
+ return /*#__PURE__*/React.createElement(IconButton, null, /*#__PURE__*/React.createElement(Icons, {
10
+ icon: "bookmark"
11
+ }));
12
+ };
13
+ _IconButton.displayName = "_IconButton";
14
+ export var Active = function Active() {
15
+ return /*#__PURE__*/React.createElement(IconButton, {
16
+ active: true
17
+ }, /*#__PURE__*/React.createElement(Icons, {
18
+ icon: "beaker"
19
+ }));
20
+ };
21
+ Active.displayName = "Active";
22
+ export var WithText = function WithText() {
23
+ return /*#__PURE__*/React.createElement(IconButton, null, /*#__PURE__*/React.createElement(Icons, {
24
+ icon: "circlehollow"
25
+ }), "\xA0Howdy!");
26
+ };
27
+ WithText.displayName = "WithText";
28
+ export var WithTextActive = function WithTextActive() {
29
+ return /*#__PURE__*/React.createElement(IconButton, {
30
+ active: true
31
+ }, /*#__PURE__*/React.createElement(Icons, {
32
+ icon: "circlehollow"
33
+ }), "\xA0Howdy!");
34
+ };
35
+ WithTextActive.displayName = "WithTextActive";
@@ -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: 24,
7
+ height: 20,
8
8
  background: theme.appBorderColor,
9
- marginTop: 8
9
+ marginTop: 10,
10
+ marginLeft: 6,
11
+ marginRight: 2
10
12
  };
11
13
  }, function (_ref2) {
12
14
  var force = _ref2.force;
@@ -65,7 +65,7 @@ var Wrapper = styled.div(function (_ref) {
65
65
  export var TabBar = styled.div({
66
66
  overflow: 'hidden',
67
67
  '&:first-of-type': {
68
- marginLeft: 0
68
+ marginLeft: -3
69
69
  }
70
70
  });
71
71
  var Content = styled.div({
@@ -20,7 +20,7 @@ var Note = styled.div(function (_ref) {
20
20
  whiteSpace: 'nowrap',
21
21
  pointerEvents: 'none',
22
22
  zIndex: -1,
23
- background: 'rgba(0, 0, 0, 0.4)',
23
+ background: theme.base === 'light' ? 'rgba(60, 60, 60, 0.9)' : 'rgba(20, 20, 20, 0.85)',
24
24
  margin: 6
25
25
  };
26
26
  });
@@ -7,19 +7,21 @@ const Side = styled.div({
7
7
  display: 'flex',
8
8
  whiteSpace: 'nowrap',
9
9
  flexBasis: 'auto',
10
- flexShrink: 0
10
+ flexShrink: 0,
11
+ marginLeft: 3,
12
+ marginRight: 3
11
13
  }, ({
12
14
  left
13
15
  }) => left ? {
14
16
  '& > *': {
15
- marginLeft: 15
17
+ marginLeft: 4
16
18
  }
17
19
  } : {}, ({
18
20
  right
19
21
  }) => right ? {
20
22
  marginLeft: 30,
21
23
  '& > *': {
22
- marginRight: 15
24
+ marginRight: 4
23
25
  }
24
26
  } : {});
25
27
  Side.displayName = 'Side';
@@ -4,6 +4,8 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
4
4
 
5
5
  import React from 'react';
6
6
  import { styled, isPropValid } from '@storybook/theming';
7
+ import { transparentize } from 'polished';
8
+ import { auto } from '@popperjs/core';
7
9
 
8
10
  const ButtonOrLink = (_ref) => {
9
11
  let {
@@ -65,34 +67,38 @@ export const IconButton = styled(ButtonOrLink, {
65
67
  })(({
66
68
  theme
67
69
  }) => ({
68
- display: 'inline-flex',
69
- justifyContent: 'center',
70
70
  alignItems: 'center',
71
- height: 40,
72
- background: 'none',
71
+ background: 'transparent',
72
+ border: 'none',
73
+ borderRadius: 4,
73
74
  color: 'inherit',
74
- padding: 0,
75
75
  cursor: 'pointer',
76
- // Icon Buttons may have text depending on user preferences.
77
- // While we don't recommend having text for IconButtons, this style ensures that the text is the correct size.
78
- fontWeight: 'bold',
76
+ display: 'inline-flex',
79
77
  fontSize: 13,
80
- border: '0 solid transparent',
81
- borderTop: '3px solid transparent',
82
- borderBottom: '3px solid transparent',
83
- transition: 'color 0.2s linear, border-bottom-color 0.2s linear',
84
- '&:hover, &:focus': {
85
- outline: '0 none',
78
+ fontWeight: 'bold',
79
+ height: 28,
80
+ justifyContent: 'center',
81
+ marginTop: 6,
82
+ padding: '8px 7px',
83
+ '&:hover, &:focus-visible': {
84
+ background: transparentize(0.88, theme.color.secondary),
86
85
  color: theme.color.secondary
87
86
  },
87
+ '&:focus-visible': {
88
+ outline: auto // Ensures links have the same focus style
89
+
90
+ },
91
+ '&:focus:not(:focus-visible)': {
92
+ outline: 'none'
93
+ },
88
94
  '& > svg': {
89
- width: 15
95
+ width: 14
90
96
  }
91
97
  }), ({
92
98
  active,
93
99
  theme
94
100
  }) => active ? {
95
- outline: '0 none',
96
- borderBottomColor: theme.color.secondary
101
+ backgroundColor: theme.background.hoverable,
102
+ color: theme.color.secondary
97
103
  } : {});
98
104
  IconButton.displayName = 'IconButton';
@@ -0,0 +1,27 @@
1
+ import React from 'react';
2
+ import { IconButton } from './button';
3
+ import { Icons } from '../icon/icon';
4
+ export default {
5
+ component: IconButton,
6
+ title: 'Basics/IconButton'
7
+ };
8
+ export const _IconButton = () => /*#__PURE__*/React.createElement(IconButton, null, /*#__PURE__*/React.createElement(Icons, {
9
+ icon: "bookmark"
10
+ }));
11
+ _IconButton.displayName = "_IconButton";
12
+ export const Active = () => /*#__PURE__*/React.createElement(IconButton, {
13
+ active: true
14
+ }, /*#__PURE__*/React.createElement(Icons, {
15
+ icon: "beaker"
16
+ }));
17
+ Active.displayName = "Active";
18
+ export const WithText = () => /*#__PURE__*/React.createElement(IconButton, null, /*#__PURE__*/React.createElement(Icons, {
19
+ icon: "circlehollow"
20
+ }), "\xA0Howdy!");
21
+ WithText.displayName = "WithText";
22
+ export const WithTextActive = () => /*#__PURE__*/React.createElement(IconButton, {
23
+ active: true
24
+ }, /*#__PURE__*/React.createElement(Icons, {
25
+ icon: "circlehollow"
26
+ }), "\xA0Howdy!");
27
+ WithTextActive.displayName = "WithTextActive";
@@ -5,9 +5,11 @@ export const Separator = styled.span(({
5
5
  theme
6
6
  }) => ({
7
7
  width: 1,
8
- height: 24,
8
+ height: 20,
9
9
  background: theme.appBorderColor,
10
- marginTop: 8
10
+ marginTop: 10,
11
+ marginLeft: 6,
12
+ marginRight: 2
11
13
  }), ({
12
14
  force
13
15
  }) => force ? {} : {
@@ -28,7 +28,7 @@ const Wrapper = styled.div(({
28
28
  export const TabBar = styled.div({
29
29
  overflow: 'hidden',
30
30
  '&:first-of-type': {
31
- marginLeft: 0
31
+ marginLeft: -3
32
32
  }
33
33
  });
34
34
  const Content = styled.div({
@@ -15,7 +15,7 @@ const Note = styled.div(({
15
15
  whiteSpace: 'nowrap',
16
16
  pointerEvents: 'none',
17
17
  zIndex: -1,
18
- background: 'rgba(0, 0, 0, 0.4)',
18
+ background: theme.base === 'light' ? 'rgba(60, 60, 60, 0.9)' : 'rgba(20, 20, 20, 0.85)',
19
19
  margin: 6
20
20
  }));
21
21
  export const TooltipNote = (_ref) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storybook/components",
3
- "version": "6.4.0-beta.22",
3
+ "version": "6.4.0-beta.23",
4
4
  "description": "Core Storybook Components",
5
5
  "keywords": [
6
6
  "storybook"
@@ -41,9 +41,9 @@
41
41
  },
42
42
  "dependencies": {
43
43
  "@popperjs/core": "^2.6.0",
44
- "@storybook/client-logger": "6.4.0-beta.22",
44
+ "@storybook/client-logger": "6.4.0-beta.23",
45
45
  "@storybook/csf": "0.0.2--canary.87bc651.0",
46
- "@storybook/theming": "6.4.0-beta.22",
46
+ "@storybook/theming": "6.4.0-beta.23",
47
47
  "@types/color-convert": "^2.0.0",
48
48
  "@types/overlayscrollbars": "^1.12.0",
49
49
  "@types/react-syntax-highlighter": "11.0.5",
@@ -76,6 +76,6 @@
76
76
  "publishConfig": {
77
77
  "access": "public"
78
78
  },
79
- "gitHead": "680a207c0b7d5daee89633349c7320a3ac29b3c6",
79
+ "gitHead": "34dd760d275faabff6855b84bb64bb69adc1ec1a",
80
80
  "sbmodern": "dist/modern/index.js"
81
81
  }