@popmenu/common-ui 0.22.0 → 0.25.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/build/components/TabPanel/TabPanel.d.ts +3 -0
- package/build/components/TabPanel/TabPanelProps.d.ts +3 -0
- package/build/components/TabPanel/index.d.ts +2 -0
- package/build/components/Typography/Typography.d.ts +2 -2
- package/build/components/Typography/TypographyProps.d.ts +4 -0
- package/build/components/Typography/TypographyStyles.d.ts +2 -2
- package/build/components/Typography/index.d.ts +1 -1
- package/build/components/index.d.ts +1 -0
- package/build/hooks/index.d.ts +1 -0
- package/build/hooks/useTabs/index.d.ts +1 -0
- package/build/hooks/useTabs/useTabs.d.ts +3 -0
- package/build/hooks/useTabs/useTabsOptions.d.ts +3 -0
- package/build/hooks/useTabs/useTabsResult.d.ts +21 -0
- package/build/index.es.js +93 -59
- package/build/index.es.js.map +1 -1
- package/build/index.js +93 -58
- package/build/index.js.map +1 -1
- package/package.json +2 -2
package/build/index.js
CHANGED
|
@@ -7,7 +7,6 @@ var core = require('@material-ui/core');
|
|
|
7
7
|
var AppBar = require('@material-ui/core/AppBar');
|
|
8
8
|
var React = require('react');
|
|
9
9
|
var MuiIconButton = require('@material-ui/core/IconButton');
|
|
10
|
-
var MuiTypography = require('@material-ui/core/Typography');
|
|
11
10
|
var styles = require('@material-ui/core/styles');
|
|
12
11
|
var MuiAvatar = require('@material-ui/core/Avatar');
|
|
13
12
|
var Badge = require('@material-ui/core/Badge');
|
|
@@ -77,7 +76,6 @@ var AppBar__default = /*#__PURE__*/_interopDefaultLegacy(AppBar);
|
|
|
77
76
|
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
78
77
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
79
78
|
var MuiIconButton__default = /*#__PURE__*/_interopDefaultLegacy(MuiIconButton);
|
|
80
|
-
var MuiTypography__default = /*#__PURE__*/_interopDefaultLegacy(MuiTypography);
|
|
81
79
|
var MuiAvatar__default = /*#__PURE__*/_interopDefaultLegacy(MuiAvatar);
|
|
82
80
|
var Badge__default = /*#__PURE__*/_interopDefaultLegacy(Badge);
|
|
83
81
|
var MuiButton__default = /*#__PURE__*/_interopDefaultLegacy(MuiButton);
|
|
@@ -157,12 +155,12 @@ function __rest(s, e) {
|
|
|
157
155
|
return t;
|
|
158
156
|
}
|
|
159
157
|
|
|
160
|
-
var _path$
|
|
158
|
+
var _path$3N;
|
|
161
159
|
|
|
162
|
-
function _extends$
|
|
160
|
+
function _extends$42() { _extends$42 = 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$42.apply(this, arguments); }
|
|
163
161
|
|
|
164
162
|
function SvgMinusCircle(props) {
|
|
165
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
163
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$42({
|
|
166
164
|
viewBox: "0 0 16 16",
|
|
167
165
|
strokeLinecap: "round",
|
|
168
166
|
strokeLinejoin: "round",
|
|
@@ -170,17 +168,17 @@ function SvgMinusCircle(props) {
|
|
|
170
168
|
width: "1em",
|
|
171
169
|
height: "1em",
|
|
172
170
|
fill: "none"
|
|
173
|
-
}, props), _path$
|
|
171
|
+
}, props), _path$3N || (_path$3N = /*#__PURE__*/React__namespace.createElement("path", {
|
|
174
172
|
d: "M8 14.667A6.667 6.667 0 108 1.333a6.667 6.667 0 000 13.334zM5.333 8h5.334"
|
|
175
173
|
})));
|
|
176
174
|
}
|
|
177
175
|
|
|
178
|
-
var _path$
|
|
176
|
+
var _path$3F;
|
|
179
177
|
|
|
180
|
-
function _extends$
|
|
178
|
+
function _extends$3W() { _extends$3W = 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$3W.apply(this, arguments); }
|
|
181
179
|
|
|
182
180
|
function SvgPlusCircle(props) {
|
|
183
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
181
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$3W({
|
|
184
182
|
viewBox: "0 0 16 16",
|
|
185
183
|
strokeLinecap: "round",
|
|
186
184
|
strokeLinejoin: "round",
|
|
@@ -188,17 +186,17 @@ function SvgPlusCircle(props) {
|
|
|
188
186
|
width: "1em",
|
|
189
187
|
height: "1em",
|
|
190
188
|
fill: "none"
|
|
191
|
-
}, props), _path$
|
|
189
|
+
}, props), _path$3F || (_path$3F = /*#__PURE__*/React__namespace.createElement("path", {
|
|
192
190
|
d: "M8 14.667A6.667 6.667 0 108 1.333a6.667 6.667 0 000 13.334zm0-9.334v5.334M5.333 8h5.334"
|
|
193
191
|
})));
|
|
194
192
|
}
|
|
195
193
|
|
|
196
|
-
var _path$
|
|
194
|
+
var _path$3l;
|
|
197
195
|
|
|
198
|
-
function _extends$
|
|
196
|
+
function _extends$3C() { _extends$3C = 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$3C.apply(this, arguments); }
|
|
199
197
|
|
|
200
198
|
function SvgUser(props) {
|
|
201
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
199
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$3C({
|
|
202
200
|
viewBox: "0 0 16 16",
|
|
203
201
|
strokeLinecap: "round",
|
|
204
202
|
strokeLinejoin: "round",
|
|
@@ -206,17 +204,17 @@ function SvgUser(props) {
|
|
|
206
204
|
width: "1em",
|
|
207
205
|
height: "1em",
|
|
208
206
|
fill: "none"
|
|
209
|
-
}, props), _path$
|
|
207
|
+
}, props), _path$3l || (_path$3l = /*#__PURE__*/React__namespace.createElement("path", {
|
|
210
208
|
d: "M13.333 14v-1.333A2.667 2.667 0 0010.667 10H5.333a2.667 2.667 0 00-2.666 2.667V14M8 7.333A2.667 2.667 0 108 2a2.667 2.667 0 000 5.333z"
|
|
211
209
|
})));
|
|
212
210
|
}
|
|
213
211
|
|
|
214
|
-
var _path$
|
|
212
|
+
var _path$1g;
|
|
215
213
|
|
|
216
|
-
function _extends$
|
|
214
|
+
function _extends$1q() { _extends$1q = 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$1q.apply(this, arguments); }
|
|
217
215
|
|
|
218
216
|
function SvgPause(props) {
|
|
219
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
217
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$1q({
|
|
220
218
|
viewBox: "0 0 16 16",
|
|
221
219
|
strokeLinecap: "round",
|
|
222
220
|
strokeLinejoin: "round",
|
|
@@ -224,17 +222,17 @@ function SvgPause(props) {
|
|
|
224
222
|
width: "1em",
|
|
225
223
|
height: "1em",
|
|
226
224
|
fill: "none"
|
|
227
|
-
}, props), _path$
|
|
225
|
+
}, props), _path$1g || (_path$1g = /*#__PURE__*/React__namespace.createElement("path", {
|
|
228
226
|
d: "M6.667 2.667H4v10.666h2.667V2.667zm5.333 0H9.333v10.666H12V2.667z"
|
|
229
227
|
})));
|
|
230
228
|
}
|
|
231
229
|
|
|
232
|
-
var _path$
|
|
230
|
+
var _path$1e;
|
|
233
231
|
|
|
234
|
-
function _extends$
|
|
232
|
+
function _extends$1o() { _extends$1o = 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$1o.apply(this, arguments); }
|
|
235
233
|
|
|
236
234
|
function SvgPlay(props) {
|
|
237
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
235
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$1o({
|
|
238
236
|
viewBox: "0 0 16 16",
|
|
239
237
|
strokeLinecap: "round",
|
|
240
238
|
strokeLinejoin: "round",
|
|
@@ -242,17 +240,17 @@ function SvgPlay(props) {
|
|
|
242
240
|
width: "1em",
|
|
243
241
|
height: "1em",
|
|
244
242
|
fill: "none"
|
|
245
|
-
}, props), _path$
|
|
243
|
+
}, props), _path$1e || (_path$1e = /*#__PURE__*/React__namespace.createElement("path", {
|
|
246
244
|
d: "M3.333 2l9.334 6-9.334 6V2z"
|
|
247
245
|
})));
|
|
248
246
|
}
|
|
249
247
|
|
|
250
|
-
var _path$
|
|
248
|
+
var _path$11;
|
|
251
249
|
|
|
252
|
-
function _extends$
|
|
250
|
+
function _extends$1b() { _extends$1b = 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$1b.apply(this, arguments); }
|
|
253
251
|
|
|
254
252
|
function SvgVolumeDown(props) {
|
|
255
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
253
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$1b({
|
|
256
254
|
viewBox: "0 0 16 16",
|
|
257
255
|
strokeLinecap: "round",
|
|
258
256
|
strokeLinejoin: "round",
|
|
@@ -260,17 +258,17 @@ function SvgVolumeDown(props) {
|
|
|
260
258
|
width: "1em",
|
|
261
259
|
height: "1em",
|
|
262
260
|
fill: "none"
|
|
263
|
-
}, props), _path$
|
|
261
|
+
}, props), _path$11 || (_path$11 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
264
262
|
d: "M8.999 3.333L5.665 6H3v4h2.666L9 12.667V3.333zm3.026 2.307a3.333 3.333 0 010 4.713"
|
|
265
263
|
})));
|
|
266
264
|
}
|
|
267
265
|
|
|
268
|
-
var _path
|
|
266
|
+
var _path$10;
|
|
269
267
|
|
|
270
|
-
function _extends$
|
|
268
|
+
function _extends$1a() { _extends$1a = 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$1a.apply(this, arguments); }
|
|
271
269
|
|
|
272
270
|
function SvgVolumeMute(props) {
|
|
273
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
271
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$1a({
|
|
274
272
|
viewBox: "0 0 16 16",
|
|
275
273
|
strokeLinecap: "round",
|
|
276
274
|
strokeLinejoin: "round",
|
|
@@ -278,17 +276,17 @@ function SvgVolumeMute(props) {
|
|
|
278
276
|
width: "1em",
|
|
279
277
|
height: "1em",
|
|
280
278
|
fill: "none"
|
|
281
|
-
}, props), _path
|
|
279
|
+
}, props), _path$10 || (_path$10 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
282
280
|
d: "M7.333 3.333L4 6H1.333v4H4l3.333 2.667V3.333z"
|
|
283
281
|
})));
|
|
284
282
|
}
|
|
285
283
|
|
|
286
|
-
var _path
|
|
284
|
+
var _path$$;
|
|
287
285
|
|
|
288
|
-
function _extends$
|
|
286
|
+
function _extends$19() { _extends$19 = 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$19.apply(this, arguments); }
|
|
289
287
|
|
|
290
288
|
function SvgVolumeOff(props) {
|
|
291
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
289
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$19({
|
|
292
290
|
viewBox: "0 0 16 16",
|
|
293
291
|
strokeLinecap: "round",
|
|
294
292
|
strokeLinejoin: "round",
|
|
@@ -296,17 +294,17 @@ function SvgVolumeOff(props) {
|
|
|
296
294
|
width: "1em",
|
|
297
295
|
height: "1em",
|
|
298
296
|
fill: "none"
|
|
299
|
-
}, props), _path
|
|
297
|
+
}, props), _path$$ || (_path$$ = /*#__PURE__*/React__namespace.createElement("path", {
|
|
300
298
|
d: "M7.333 3.333L4 6H1.333v4H4l3.333 2.667V3.333zm8 2.667l-4 4m0-4l4 4"
|
|
301
299
|
})));
|
|
302
300
|
}
|
|
303
301
|
|
|
304
|
-
var _path$
|
|
302
|
+
var _path$_;
|
|
305
303
|
|
|
306
|
-
function _extends$
|
|
304
|
+
function _extends$18() { _extends$18 = 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$18.apply(this, arguments); }
|
|
307
305
|
|
|
308
306
|
function SvgVolumeUp(props) {
|
|
309
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
307
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$18({
|
|
310
308
|
viewBox: "0 0 16 16",
|
|
311
309
|
strokeLinecap: "round",
|
|
312
310
|
strokeLinejoin: "round",
|
|
@@ -314,7 +312,7 @@ function SvgVolumeUp(props) {
|
|
|
314
312
|
width: "1em",
|
|
315
313
|
height: "1em",
|
|
316
314
|
fill: "none"
|
|
317
|
-
}, props), _path$
|
|
315
|
+
}, props), _path$_ || (_path$_ = /*#__PURE__*/React__namespace.createElement("path", {
|
|
318
316
|
d: "M7.333 3.333L4 6H1.333v4H4l3.333 2.667V3.333zm5.38-.046a6.667 6.667 0 010 9.426M10.36 5.64a3.333 3.333 0 010 4.713"
|
|
319
317
|
})));
|
|
320
318
|
}
|
|
@@ -441,29 +439,29 @@ IconButton.defaultProps = {
|
|
|
441
439
|
color: 'secondary',
|
|
442
440
|
};
|
|
443
441
|
|
|
444
|
-
var useTypographyStyles = styles.makeStyles(function () {
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
});
|
|
442
|
+
var useTypographyStyles = styles.makeStyles(function () { return ({
|
|
443
|
+
root: function (_a) {
|
|
444
|
+
var _b;
|
|
445
|
+
var weight = _a.weight;
|
|
446
|
+
return (__assign((_b = {}, _b["& ." + iconStaticClassName] = {
|
|
447
|
+
position: 'relative',
|
|
448
|
+
top: '0.125em',
|
|
449
|
+
padding: '0 0.125em',
|
|
450
|
+
boxSizing: 'content-box',
|
|
451
|
+
}, _b), (weight && { fontWeight: (weight === 'semi-bold' && 600) || (weight === 'bold' && 700) || 400 })));
|
|
452
|
+
},
|
|
453
|
+
caption: {
|
|
454
|
+
display: 'inline',
|
|
455
|
+
},
|
|
456
|
+
overline: {
|
|
457
|
+
display: 'inline',
|
|
458
|
+
},
|
|
459
|
+
}); });
|
|
463
460
|
|
|
464
461
|
var Typography = React.forwardRef(function (props, ref) {
|
|
462
|
+
props.weight; var restProps = __rest(props, ["weight"]);
|
|
465
463
|
var classes = useTypographyStyles(props);
|
|
466
|
-
return React__default['default'].createElement(
|
|
464
|
+
return React__default['default'].createElement(core.Typography, __assign({ ref: ref, classes: classes }, restProps));
|
|
467
465
|
});
|
|
468
466
|
Typography.displayName = 'Typography';
|
|
469
467
|
|
|
@@ -1034,6 +1032,11 @@ var Switch = React.forwardRef(function (props, ref) {
|
|
|
1034
1032
|
});
|
|
1035
1033
|
Switch.displayName = 'Switch';
|
|
1036
1034
|
|
|
1035
|
+
var TabPanel = function (props) {
|
|
1036
|
+
var children = props.children, show = props.show;
|
|
1037
|
+
return show ? React__default['default'].createElement(core.Box, null, children) : null;
|
|
1038
|
+
};
|
|
1039
|
+
|
|
1037
1040
|
var useToggleButtonStyles = styles.makeStyles(function (theme) { return ({
|
|
1038
1041
|
root: {
|
|
1039
1042
|
color: theme.palette.text.primary,
|
|
@@ -1149,6 +1152,36 @@ var useCollapsibleText = function () {
|
|
|
1149
1152
|
};
|
|
1150
1153
|
};
|
|
1151
1154
|
|
|
1155
|
+
var useTabs = function (options) {
|
|
1156
|
+
var initialTab = options.initialTab;
|
|
1157
|
+
var genTabId = function (id) { return ("tab-" + id).toLowerCase().replace(/ /g, '-'); };
|
|
1158
|
+
var genPanelId = function (id) { return ("tab-panel-" + id).toLowerCase().replace(/ /g, '-'); };
|
|
1159
|
+
var _a = React.useState(genTabId(initialTab)), activeTab = _a[0], setActiveTab = _a[1];
|
|
1160
|
+
var handleChange = function (_, nextTab) { return setActiveTab(nextTab); };
|
|
1161
|
+
var TabsProps = { onChange: handleChange, value: activeTab };
|
|
1162
|
+
var useTab = function (baseId) {
|
|
1163
|
+
var tabId = genTabId(baseId);
|
|
1164
|
+
var tabPanelId = genPanelId(baseId);
|
|
1165
|
+
var tabProps = {
|
|
1166
|
+
id: tabId,
|
|
1167
|
+
label: baseId,
|
|
1168
|
+
value: tabId,
|
|
1169
|
+
'aria-controls': tabPanelId,
|
|
1170
|
+
};
|
|
1171
|
+
var panelProps = {
|
|
1172
|
+
id: tabPanelId,
|
|
1173
|
+
role: 'tabpanel',
|
|
1174
|
+
show: activeTab === tabId,
|
|
1175
|
+
'aria-labelledby': tabId,
|
|
1176
|
+
};
|
|
1177
|
+
return [tabProps, panelProps];
|
|
1178
|
+
};
|
|
1179
|
+
return {
|
|
1180
|
+
TabsProps: TabsProps,
|
|
1181
|
+
useTab: useTab,
|
|
1182
|
+
};
|
|
1183
|
+
};
|
|
1184
|
+
|
|
1152
1185
|
Object.defineProperty(exports, 'Alert', {
|
|
1153
1186
|
enumerable: true,
|
|
1154
1187
|
get: function () {
|
|
@@ -1566,9 +1599,11 @@ exports.PaperContent = PaperContent;
|
|
|
1566
1599
|
exports.Radio = Radio;
|
|
1567
1600
|
exports.SplitInput = SplitInput;
|
|
1568
1601
|
exports.Switch = Switch;
|
|
1602
|
+
exports.TabPanel = TabPanel;
|
|
1569
1603
|
exports.ToggleButton = ToggleButton;
|
|
1570
1604
|
exports.ToggleButtonGroup = ToggleButtonGroup;
|
|
1571
1605
|
exports.Tooltip = Tooltip;
|
|
1572
1606
|
exports.Typography = Typography;
|
|
1573
1607
|
exports.useCollapsibleText = useCollapsibleText;
|
|
1608
|
+
exports.useTabs = useTabs;
|
|
1574
1609
|
//# sourceMappingURL=index.js.map
|