@popmenu/common-ui 0.24.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/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 +72 -37
- package/build/index.es.js.map +1 -1
- package/build/index.js +73 -36
- package/build/index.js.map +1 -1
- package/package.json +2 -2
package/build/index.js
CHANGED
|
@@ -155,12 +155,12 @@ function __rest(s, e) {
|
|
|
155
155
|
return t;
|
|
156
156
|
}
|
|
157
157
|
|
|
158
|
-
var _path$
|
|
158
|
+
var _path$3N;
|
|
159
159
|
|
|
160
|
-
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); }
|
|
161
161
|
|
|
162
162
|
function SvgMinusCircle(props) {
|
|
163
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
163
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$42({
|
|
164
164
|
viewBox: "0 0 16 16",
|
|
165
165
|
strokeLinecap: "round",
|
|
166
166
|
strokeLinejoin: "round",
|
|
@@ -168,17 +168,17 @@ function SvgMinusCircle(props) {
|
|
|
168
168
|
width: "1em",
|
|
169
169
|
height: "1em",
|
|
170
170
|
fill: "none"
|
|
171
|
-
}, props), _path$
|
|
171
|
+
}, props), _path$3N || (_path$3N = /*#__PURE__*/React__namespace.createElement("path", {
|
|
172
172
|
d: "M8 14.667A6.667 6.667 0 108 1.333a6.667 6.667 0 000 13.334zM5.333 8h5.334"
|
|
173
173
|
})));
|
|
174
174
|
}
|
|
175
175
|
|
|
176
|
-
var _path$
|
|
176
|
+
var _path$3F;
|
|
177
177
|
|
|
178
|
-
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); }
|
|
179
179
|
|
|
180
180
|
function SvgPlusCircle(props) {
|
|
181
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
181
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$3W({
|
|
182
182
|
viewBox: "0 0 16 16",
|
|
183
183
|
strokeLinecap: "round",
|
|
184
184
|
strokeLinejoin: "round",
|
|
@@ -186,17 +186,17 @@ function SvgPlusCircle(props) {
|
|
|
186
186
|
width: "1em",
|
|
187
187
|
height: "1em",
|
|
188
188
|
fill: "none"
|
|
189
|
-
}, props), _path$
|
|
189
|
+
}, props), _path$3F || (_path$3F = /*#__PURE__*/React__namespace.createElement("path", {
|
|
190
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"
|
|
191
191
|
})));
|
|
192
192
|
}
|
|
193
193
|
|
|
194
|
-
var _path$
|
|
194
|
+
var _path$3l;
|
|
195
195
|
|
|
196
|
-
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); }
|
|
197
197
|
|
|
198
198
|
function SvgUser(props) {
|
|
199
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
199
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$3C({
|
|
200
200
|
viewBox: "0 0 16 16",
|
|
201
201
|
strokeLinecap: "round",
|
|
202
202
|
strokeLinejoin: "round",
|
|
@@ -204,17 +204,17 @@ function SvgUser(props) {
|
|
|
204
204
|
width: "1em",
|
|
205
205
|
height: "1em",
|
|
206
206
|
fill: "none"
|
|
207
|
-
}, props), _path$
|
|
207
|
+
}, props), _path$3l || (_path$3l = /*#__PURE__*/React__namespace.createElement("path", {
|
|
208
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"
|
|
209
209
|
})));
|
|
210
210
|
}
|
|
211
211
|
|
|
212
|
-
var _path$
|
|
212
|
+
var _path$1g;
|
|
213
213
|
|
|
214
|
-
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); }
|
|
215
215
|
|
|
216
216
|
function SvgPause(props) {
|
|
217
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
217
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$1q({
|
|
218
218
|
viewBox: "0 0 16 16",
|
|
219
219
|
strokeLinecap: "round",
|
|
220
220
|
strokeLinejoin: "round",
|
|
@@ -222,17 +222,17 @@ function SvgPause(props) {
|
|
|
222
222
|
width: "1em",
|
|
223
223
|
height: "1em",
|
|
224
224
|
fill: "none"
|
|
225
|
-
}, props), _path$
|
|
225
|
+
}, props), _path$1g || (_path$1g = /*#__PURE__*/React__namespace.createElement("path", {
|
|
226
226
|
d: "M6.667 2.667H4v10.666h2.667V2.667zm5.333 0H9.333v10.666H12V2.667z"
|
|
227
227
|
})));
|
|
228
228
|
}
|
|
229
229
|
|
|
230
|
-
var _path$
|
|
230
|
+
var _path$1e;
|
|
231
231
|
|
|
232
|
-
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); }
|
|
233
233
|
|
|
234
234
|
function SvgPlay(props) {
|
|
235
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
235
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$1o({
|
|
236
236
|
viewBox: "0 0 16 16",
|
|
237
237
|
strokeLinecap: "round",
|
|
238
238
|
strokeLinejoin: "round",
|
|
@@ -240,17 +240,17 @@ function SvgPlay(props) {
|
|
|
240
240
|
width: "1em",
|
|
241
241
|
height: "1em",
|
|
242
242
|
fill: "none"
|
|
243
|
-
}, props), _path$
|
|
243
|
+
}, props), _path$1e || (_path$1e = /*#__PURE__*/React__namespace.createElement("path", {
|
|
244
244
|
d: "M3.333 2l9.334 6-9.334 6V2z"
|
|
245
245
|
})));
|
|
246
246
|
}
|
|
247
247
|
|
|
248
|
-
var _path$
|
|
248
|
+
var _path$11;
|
|
249
249
|
|
|
250
|
-
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); }
|
|
251
251
|
|
|
252
252
|
function SvgVolumeDown(props) {
|
|
253
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
253
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$1b({
|
|
254
254
|
viewBox: "0 0 16 16",
|
|
255
255
|
strokeLinecap: "round",
|
|
256
256
|
strokeLinejoin: "round",
|
|
@@ -258,17 +258,17 @@ function SvgVolumeDown(props) {
|
|
|
258
258
|
width: "1em",
|
|
259
259
|
height: "1em",
|
|
260
260
|
fill: "none"
|
|
261
|
-
}, props), _path$
|
|
261
|
+
}, props), _path$11 || (_path$11 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
262
262
|
d: "M8.999 3.333L5.665 6H3v4h2.666L9 12.667V3.333zm3.026 2.307a3.333 3.333 0 010 4.713"
|
|
263
263
|
})));
|
|
264
264
|
}
|
|
265
265
|
|
|
266
|
-
var _path
|
|
266
|
+
var _path$10;
|
|
267
267
|
|
|
268
|
-
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); }
|
|
269
269
|
|
|
270
270
|
function SvgVolumeMute(props) {
|
|
271
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
271
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$1a({
|
|
272
272
|
viewBox: "0 0 16 16",
|
|
273
273
|
strokeLinecap: "round",
|
|
274
274
|
strokeLinejoin: "round",
|
|
@@ -276,17 +276,17 @@ function SvgVolumeMute(props) {
|
|
|
276
276
|
width: "1em",
|
|
277
277
|
height: "1em",
|
|
278
278
|
fill: "none"
|
|
279
|
-
}, props), _path
|
|
279
|
+
}, props), _path$10 || (_path$10 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
280
280
|
d: "M7.333 3.333L4 6H1.333v4H4l3.333 2.667V3.333z"
|
|
281
281
|
})));
|
|
282
282
|
}
|
|
283
283
|
|
|
284
|
-
var _path
|
|
284
|
+
var _path$$;
|
|
285
285
|
|
|
286
|
-
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); }
|
|
287
287
|
|
|
288
288
|
function SvgVolumeOff(props) {
|
|
289
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
289
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$19({
|
|
290
290
|
viewBox: "0 0 16 16",
|
|
291
291
|
strokeLinecap: "round",
|
|
292
292
|
strokeLinejoin: "round",
|
|
@@ -294,17 +294,17 @@ function SvgVolumeOff(props) {
|
|
|
294
294
|
width: "1em",
|
|
295
295
|
height: "1em",
|
|
296
296
|
fill: "none"
|
|
297
|
-
}, props), _path
|
|
297
|
+
}, props), _path$$ || (_path$$ = /*#__PURE__*/React__namespace.createElement("path", {
|
|
298
298
|
d: "M7.333 3.333L4 6H1.333v4H4l3.333 2.667V3.333zm8 2.667l-4 4m0-4l4 4"
|
|
299
299
|
})));
|
|
300
300
|
}
|
|
301
301
|
|
|
302
|
-
var _path$
|
|
302
|
+
var _path$_;
|
|
303
303
|
|
|
304
|
-
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); }
|
|
305
305
|
|
|
306
306
|
function SvgVolumeUp(props) {
|
|
307
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
307
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$18({
|
|
308
308
|
viewBox: "0 0 16 16",
|
|
309
309
|
strokeLinecap: "round",
|
|
310
310
|
strokeLinejoin: "round",
|
|
@@ -312,7 +312,7 @@ function SvgVolumeUp(props) {
|
|
|
312
312
|
width: "1em",
|
|
313
313
|
height: "1em",
|
|
314
314
|
fill: "none"
|
|
315
|
-
}, props), _path$
|
|
315
|
+
}, props), _path$_ || (_path$_ = /*#__PURE__*/React__namespace.createElement("path", {
|
|
316
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"
|
|
317
317
|
})));
|
|
318
318
|
}
|
|
@@ -1032,6 +1032,11 @@ var Switch = React.forwardRef(function (props, ref) {
|
|
|
1032
1032
|
});
|
|
1033
1033
|
Switch.displayName = 'Switch';
|
|
1034
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
|
+
|
|
1035
1040
|
var useToggleButtonStyles = styles.makeStyles(function (theme) { return ({
|
|
1036
1041
|
root: {
|
|
1037
1042
|
color: theme.palette.text.primary,
|
|
@@ -1147,6 +1152,36 @@ var useCollapsibleText = function () {
|
|
|
1147
1152
|
};
|
|
1148
1153
|
};
|
|
1149
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
|
+
|
|
1150
1185
|
Object.defineProperty(exports, 'Alert', {
|
|
1151
1186
|
enumerable: true,
|
|
1152
1187
|
get: function () {
|
|
@@ -1564,9 +1599,11 @@ exports.PaperContent = PaperContent;
|
|
|
1564
1599
|
exports.Radio = Radio;
|
|
1565
1600
|
exports.SplitInput = SplitInput;
|
|
1566
1601
|
exports.Switch = Switch;
|
|
1602
|
+
exports.TabPanel = TabPanel;
|
|
1567
1603
|
exports.ToggleButton = ToggleButton;
|
|
1568
1604
|
exports.ToggleButtonGroup = ToggleButtonGroup;
|
|
1569
1605
|
exports.Tooltip = Tooltip;
|
|
1570
1606
|
exports.Typography = Typography;
|
|
1571
1607
|
exports.useCollapsibleText = useCollapsibleText;
|
|
1608
|
+
exports.useTabs = useTabs;
|
|
1572
1609
|
//# sourceMappingURL=index.js.map
|