@pingux/astro 2.109.0 → 2.110.0-alpha.0
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/lib/cjs/components/Tabs/Tabs.stories.d.ts +3 -4
- package/lib/cjs/components/Tabs/Tabs.stories.js +34 -47
- package/lib/cjs/components/Tabs/Tabs.style.d.ts +1 -1
- package/lib/cjs/components/Tabs/Tabs.style.js +3 -1
- package/lib/components/Tabs/Tabs.stories.js +29 -41
- package/lib/components/Tabs/Tabs.style.js +4 -2
- package/package.json +1 -1
@@ -2,13 +2,12 @@ import { StoryFn } from '@storybook/react';
|
|
2
2
|
import { TabsProps } from '../../types';
|
3
3
|
declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0a347bb9").R, import("@storybook/types").Args>;
|
4
4
|
export default _default;
|
5
|
-
export declare const
|
5
|
+
export declare const Default: StoryFn<TabsProps>;
|
6
6
|
export declare const Controlled: StoryFn;
|
7
|
-
export declare const WithTooltips: StoryFn;
|
8
7
|
export declare const Centered: StoryFn;
|
9
8
|
export declare const DisabledSingleTab: StoryFn;
|
10
9
|
export declare const DisabledAllTabs: StoryFn;
|
11
|
-
export declare const CustomTabLine: StoryFn;
|
12
|
-
export declare const TabPanelProps: StoryFn;
|
13
10
|
export declare const ContentSlots: StoryFn;
|
14
11
|
export declare const WithList: StoryFn;
|
12
|
+
export declare const CustomTabLine: StoryFn;
|
13
|
+
export declare const CustomPanelProps: StoryFn;
|
@@ -8,7 +8,7 @@ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequ
|
|
8
8
|
_Object$defineProperty(exports, "__esModule", {
|
9
9
|
value: true
|
10
10
|
});
|
11
|
-
exports["default"] = exports.
|
11
|
+
exports["default"] = exports.WithList = exports.DisabledSingleTab = exports.DisabledAllTabs = exports.Default = exports.CustomTabLine = exports.CustomPanelProps = exports.Controlled = exports.ContentSlots = exports.Centered = void 0;
|
12
12
|
var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/concat"));
|
13
13
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/slicedToArray"));
|
14
14
|
var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
|
@@ -71,7 +71,7 @@ var tabs = [{
|
|
71
71
|
name: 'Tab 3',
|
72
72
|
children: (0, _react2.jsx)(_index.Text, null, "Tab 3 body")
|
73
73
|
}];
|
74
|
-
var
|
74
|
+
var Default = function Default(args) {
|
75
75
|
return (0, _react2.jsx)(_index.Tabs, (0, _extends2["default"])({
|
76
76
|
items: tabs
|
77
77
|
}, args), (0, _react2.jsx)(_index.Tab, {
|
@@ -82,7 +82,7 @@ var Uncontrolled = function Uncontrolled(args) {
|
|
82
82
|
title: "Tab 2"
|
83
83
|
}, (0, _react2.jsx)(_index.Text, null, "This is content for Tab 2")));
|
84
84
|
};
|
85
|
-
exports.
|
85
|
+
exports.Default = Default;
|
86
86
|
var Controlled = function Controlled() {
|
87
87
|
var _useState = (0, _react.useState)(tabs[0].name),
|
88
88
|
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
@@ -101,19 +101,6 @@ var Controlled = function Controlled() {
|
|
101
101
|
});
|
102
102
|
};
|
103
103
|
exports.Controlled = Controlled;
|
104
|
-
var WithTooltips = function WithTooltips() {
|
105
|
-
return (0, _react2.jsx)(_index.Tabs, {
|
106
|
-
mode: "tooltip",
|
107
|
-
items: tabs
|
108
|
-
}, function (item) {
|
109
|
-
return (0, _react2.jsx)(_index.Tab, {
|
110
|
-
key: item.name,
|
111
|
-
title: item.name,
|
112
|
-
textValue: item.name
|
113
|
-
}, item.children);
|
114
|
-
});
|
115
|
-
};
|
116
|
-
exports.WithTooltips = WithTooltips;
|
117
104
|
var Centered = function Centered() {
|
118
105
|
return (0, _react2.jsx)(_index.Tabs, {
|
119
106
|
tabListProps: {
|
@@ -152,35 +139,6 @@ var DisabledAllTabs = function DisabledAllTabs() {
|
|
152
139
|
});
|
153
140
|
};
|
154
141
|
exports.DisabledAllTabs = DisabledAllTabs;
|
155
|
-
var CustomTabLine = function CustomTabLine() {
|
156
|
-
return (0, _react2.jsx)(_index.Tabs, {
|
157
|
-
items: tabs
|
158
|
-
}, function (item) {
|
159
|
-
return (0, _react2.jsx)(_index.Tab, {
|
160
|
-
key: item.name,
|
161
|
-
title: item.name,
|
162
|
-
tabLineProps: {
|
163
|
-
bg: 'red'
|
164
|
-
}
|
165
|
-
}, item.children);
|
166
|
-
});
|
167
|
-
};
|
168
|
-
exports.CustomTabLine = CustomTabLine;
|
169
|
-
var TabPanelProps = function TabPanelProps() {
|
170
|
-
return (0, _react2.jsx)(_index.Tabs, {
|
171
|
-
tabPanelProps: {
|
172
|
-
color: 'green',
|
173
|
-
fontWeight: 500
|
174
|
-
},
|
175
|
-
items: tabs
|
176
|
-
}, function (item) {
|
177
|
-
return (0, _react2.jsx)(_index.Tab, {
|
178
|
-
key: item.name,
|
179
|
-
title: item.name
|
180
|
-
}, item.children);
|
181
|
-
});
|
182
|
-
};
|
183
|
-
exports.TabPanelProps = TabPanelProps;
|
184
142
|
var ContentSlots = function ContentSlots() {
|
185
143
|
var beforeTabNode = (0, _react2.jsx)(_index.Icon, {
|
186
144
|
icon: _LockIcon["default"],
|
@@ -193,7 +151,7 @@ var ContentSlots = function ContentSlots() {
|
|
193
151
|
}
|
194
152
|
});
|
195
153
|
var nodeSx = {
|
196
|
-
marginLeft:
|
154
|
+
marginLeft: 5,
|
197
155
|
marginTop: 10
|
198
156
|
};
|
199
157
|
var afterTabNode = (0, _react2.jsx)(_index.Box, null, (0, _react2.jsx)(_index.Badge, {
|
@@ -255,4 +213,33 @@ var WithList = function WithList() {
|
|
255
213
|
}, item), item.children);
|
256
214
|
});
|
257
215
|
};
|
258
|
-
exports.WithList = WithList;
|
216
|
+
exports.WithList = WithList;
|
217
|
+
var CustomTabLine = function CustomTabLine() {
|
218
|
+
return (0, _react2.jsx)(_index.Tabs, {
|
219
|
+
items: tabs
|
220
|
+
}, function (item) {
|
221
|
+
return (0, _react2.jsx)(_index.Tab, {
|
222
|
+
key: item.name,
|
223
|
+
title: item.name,
|
224
|
+
tabLineProps: {
|
225
|
+
bg: 'red'
|
226
|
+
}
|
227
|
+
}, item.children);
|
228
|
+
});
|
229
|
+
};
|
230
|
+
exports.CustomTabLine = CustomTabLine;
|
231
|
+
var CustomPanelProps = function CustomPanelProps() {
|
232
|
+
return (0, _react2.jsx)(_index.Tabs, {
|
233
|
+
tabPanelProps: {
|
234
|
+
color: 'green',
|
235
|
+
fontWeight: 500
|
236
|
+
},
|
237
|
+
items: tabs
|
238
|
+
}, function (item) {
|
239
|
+
return (0, _react2.jsx)(_index.Tab, {
|
240
|
+
key: item.name,
|
241
|
+
title: item.name
|
242
|
+
}, item.children);
|
243
|
+
});
|
244
|
+
};
|
245
|
+
exports.CustomPanelProps = CustomPanelProps;
|
@@ -25,7 +25,9 @@ var tab = {
|
|
25
25
|
outline: 'none',
|
26
26
|
transform: 'translateY(1px)',
|
27
27
|
'&.is-focused': {
|
28
|
-
'& > span': _objectSpread({}, _Buttons.
|
28
|
+
'& > span': _objectSpread(_objectSpread({}, _Buttons.defaultFocus), {}, {
|
29
|
+
borderRadius: '4px'
|
30
|
+
})
|
29
31
|
},
|
30
32
|
'&.is-disabled': {
|
31
33
|
cursor: 'default'
|
@@ -57,7 +57,7 @@ var tabs = [{
|
|
57
57
|
name: 'Tab 3',
|
58
58
|
children: ___EmotionJSX(Text, null, "Tab 3 body")
|
59
59
|
}];
|
60
|
-
export var
|
60
|
+
export var Default = function Default(args) {
|
61
61
|
return ___EmotionJSX(Tabs, _extends({
|
62
62
|
items: tabs
|
63
63
|
}, args), ___EmotionJSX(Tab, {
|
@@ -85,18 +85,6 @@ export var Controlled = function Controlled() {
|
|
85
85
|
}, item.children);
|
86
86
|
});
|
87
87
|
};
|
88
|
-
export var WithTooltips = function WithTooltips() {
|
89
|
-
return ___EmotionJSX(Tabs, {
|
90
|
-
mode: "tooltip",
|
91
|
-
items: tabs
|
92
|
-
}, function (item) {
|
93
|
-
return ___EmotionJSX(Tab, {
|
94
|
-
key: item.name,
|
95
|
-
title: item.name,
|
96
|
-
textValue: item.name
|
97
|
-
}, item.children);
|
98
|
-
});
|
99
|
-
};
|
100
88
|
export var Centered = function Centered() {
|
101
89
|
return ___EmotionJSX(Tabs, {
|
102
90
|
tabListProps: {
|
@@ -132,33 +120,6 @@ export var DisabledAllTabs = function DisabledAllTabs() {
|
|
132
120
|
}, item.children);
|
133
121
|
});
|
134
122
|
};
|
135
|
-
export var CustomTabLine = function CustomTabLine() {
|
136
|
-
return ___EmotionJSX(Tabs, {
|
137
|
-
items: tabs
|
138
|
-
}, function (item) {
|
139
|
-
return ___EmotionJSX(Tab, {
|
140
|
-
key: item.name,
|
141
|
-
title: item.name,
|
142
|
-
tabLineProps: {
|
143
|
-
bg: 'red'
|
144
|
-
}
|
145
|
-
}, item.children);
|
146
|
-
});
|
147
|
-
};
|
148
|
-
export var TabPanelProps = function TabPanelProps() {
|
149
|
-
return ___EmotionJSX(Tabs, {
|
150
|
-
tabPanelProps: {
|
151
|
-
color: 'green',
|
152
|
-
fontWeight: 500
|
153
|
-
},
|
154
|
-
items: tabs
|
155
|
-
}, function (item) {
|
156
|
-
return ___EmotionJSX(Tab, {
|
157
|
-
key: item.name,
|
158
|
-
title: item.name
|
159
|
-
}, item.children);
|
160
|
-
});
|
161
|
-
};
|
162
123
|
export var ContentSlots = function ContentSlots() {
|
163
124
|
var beforeTabNode = ___EmotionJSX(Icon, {
|
164
125
|
icon: LockIcon,
|
@@ -171,7 +132,7 @@ export var ContentSlots = function ContentSlots() {
|
|
171
132
|
}
|
172
133
|
});
|
173
134
|
var nodeSx = {
|
174
|
-
marginLeft:
|
135
|
+
marginLeft: 5,
|
175
136
|
marginTop: 10
|
176
137
|
};
|
177
138
|
var afterTabNode = ___EmotionJSX(Box, null, ___EmotionJSX(Badge, {
|
@@ -231,4 +192,31 @@ export var WithList = function WithList() {
|
|
231
192
|
title: item.name
|
232
193
|
}, item), item.children);
|
233
194
|
});
|
195
|
+
};
|
196
|
+
export var CustomTabLine = function CustomTabLine() {
|
197
|
+
return ___EmotionJSX(Tabs, {
|
198
|
+
items: tabs
|
199
|
+
}, function (item) {
|
200
|
+
return ___EmotionJSX(Tab, {
|
201
|
+
key: item.name,
|
202
|
+
title: item.name,
|
203
|
+
tabLineProps: {
|
204
|
+
bg: 'red'
|
205
|
+
}
|
206
|
+
}, item.children);
|
207
|
+
});
|
208
|
+
};
|
209
|
+
export var CustomPanelProps = function CustomPanelProps() {
|
210
|
+
return ___EmotionJSX(Tabs, {
|
211
|
+
tabPanelProps: {
|
212
|
+
color: 'green',
|
213
|
+
fontWeight: 500
|
214
|
+
},
|
215
|
+
items: tabs
|
216
|
+
}, function (item) {
|
217
|
+
return ___EmotionJSX(Tab, {
|
218
|
+
key: item.name,
|
219
|
+
title: item.name
|
220
|
+
}, item.children);
|
221
|
+
});
|
234
222
|
};
|
@@ -9,7 +9,7 @@ import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object
|
|
9
9
|
import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
|
10
10
|
function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
11
11
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
12
|
-
import {
|
12
|
+
import { defaultFocus, quiet } from '../Button/Buttons.styles';
|
13
13
|
export var tab = {
|
14
14
|
pt: 10,
|
15
15
|
cursor: 'pointer',
|
@@ -18,7 +18,9 @@ export var tab = {
|
|
18
18
|
outline: 'none',
|
19
19
|
transform: 'translateY(1px)',
|
20
20
|
'&.is-focused': {
|
21
|
-
'& > span': _objectSpread({},
|
21
|
+
'& > span': _objectSpread(_objectSpread({}, defaultFocus), {}, {
|
22
|
+
borderRadius: '4px'
|
23
|
+
})
|
22
24
|
},
|
23
25
|
'&.is-disabled': {
|
24
26
|
cursor: 'default'
|