@popmenu/common-ui 0.24.0 → 0.26.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/index.es.js CHANGED
@@ -89,12 +89,12 @@ function __rest(s, e) {
89
89
  return t;
90
90
  }
91
91
 
92
- var _path$3M;
92
+ var _path$3f;
93
93
 
94
- function _extends$41() { _extends$41 = 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$41.apply(this, arguments); }
94
+ function _extends$3v() { _extends$3v = 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$3v.apply(this, arguments); }
95
95
 
96
96
  function SvgMinusCircle(props) {
97
- return /*#__PURE__*/React.createElement("svg", _extends$41({
97
+ return /*#__PURE__*/React.createElement("svg", _extends$3v({
98
98
  viewBox: "0 0 16 16",
99
99
  strokeLinecap: "round",
100
100
  strokeLinejoin: "round",
@@ -102,17 +102,17 @@ function SvgMinusCircle(props) {
102
102
  width: "1em",
103
103
  height: "1em",
104
104
  fill: "none"
105
- }, props), _path$3M || (_path$3M = /*#__PURE__*/React.createElement("path", {
106
- d: "M8 14.667A6.667 6.667 0 108 1.333a6.667 6.667 0 000 13.334zM5.333 8h5.334"
105
+ }, props), _path$3f || (_path$3f = /*#__PURE__*/React.createElement("path", {
106
+ d: "M8 14.667A6.667 6.667 0 108 1.334a6.667 6.667 0 000 13.333zM5.333 8h5.334"
107
107
  })));
108
108
  }
109
109
 
110
- var _path$3E;
110
+ var _path$37;
111
111
 
112
- function _extends$3V() { _extends$3V = 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$3V.apply(this, arguments); }
112
+ function _extends$3n() { _extends$3n = 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$3n.apply(this, arguments); }
113
113
 
114
114
  function SvgPlusCircle(props) {
115
- return /*#__PURE__*/React.createElement("svg", _extends$3V({
115
+ return /*#__PURE__*/React.createElement("svg", _extends$3n({
116
116
  viewBox: "0 0 16 16",
117
117
  strokeLinecap: "round",
118
118
  strokeLinejoin: "round",
@@ -120,17 +120,17 @@ function SvgPlusCircle(props) {
120
120
  width: "1em",
121
121
  height: "1em",
122
122
  fill: "none"
123
- }, props), _path$3E || (_path$3E = /*#__PURE__*/React.createElement("path", {
124
- d: "M8 14.667A6.667 6.667 0 108 1.333a6.667 6.667 0 000 13.334zm0-9.334v5.334M5.333 8h5.334"
123
+ }, props), _path$37 || (_path$37 = /*#__PURE__*/React.createElement("path", {
124
+ d: "M8 14.667A6.667 6.667 0 108 1.334a6.667 6.667 0 000 13.333zm0-9.334v5.334M5.333 8h5.334"
125
125
  })));
126
126
  }
127
127
 
128
- var _path$3k;
128
+ var _path$2P;
129
129
 
130
- function _extends$3B() { _extends$3B = 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$3B.apply(this, arguments); }
130
+ function _extends$33() { _extends$33 = 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$33.apply(this, arguments); }
131
131
 
132
132
  function SvgUser(props) {
133
- return /*#__PURE__*/React.createElement("svg", _extends$3B({
133
+ return /*#__PURE__*/React.createElement("svg", _extends$33({
134
134
  viewBox: "0 0 16 16",
135
135
  strokeLinecap: "round",
136
136
  strokeLinejoin: "round",
@@ -138,12 +138,12 @@ function SvgUser(props) {
138
138
  width: "1em",
139
139
  height: "1em",
140
140
  fill: "none"
141
- }, props), _path$3k || (_path$3k = /*#__PURE__*/React.createElement("path", {
141
+ }, props), _path$2P || (_path$2P = /*#__PURE__*/React.createElement("path", {
142
142
  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"
143
143
  })));
144
144
  }
145
145
 
146
- var _path$1f;
146
+ var _path$1l;
147
147
 
148
148
  function _extends$1p() { _extends$1p = 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$1p.apply(this, arguments); }
149
149
 
@@ -156,12 +156,12 @@ function SvgPause(props) {
156
156
  width: "1em",
157
157
  height: "1em",
158
158
  fill: "none"
159
- }, props), _path$1f || (_path$1f = /*#__PURE__*/React.createElement("path", {
160
- d: "M6.667 2.667H4v10.666h2.667V2.667zm5.333 0H9.333v10.666H12V2.667z"
159
+ }, props), _path$1l || (_path$1l = /*#__PURE__*/React.createElement("path", {
160
+ d: "M6.667 2.667H4v10.666h2.667V2.666zm5.333 0H9.333v10.666H12V2.666z"
161
161
  })));
162
162
  }
163
163
 
164
- var _path$1d;
164
+ var _path$1j;
165
165
 
166
166
  function _extends$1n() { _extends$1n = 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$1n.apply(this, arguments); }
167
167
 
@@ -174,12 +174,12 @@ function SvgPlay(props) {
174
174
  width: "1em",
175
175
  height: "1em",
176
176
  fill: "none"
177
- }, props), _path$1d || (_path$1d = /*#__PURE__*/React.createElement("path", {
177
+ }, props), _path$1j || (_path$1j = /*#__PURE__*/React.createElement("path", {
178
178
  d: "M3.333 2l9.334 6-9.334 6V2z"
179
179
  })));
180
180
  }
181
181
 
182
- var _path$10;
182
+ var _path$16;
183
183
 
184
184
  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); }
185
185
 
@@ -192,12 +192,12 @@ function SvgVolumeDown(props) {
192
192
  width: "1em",
193
193
  height: "1em",
194
194
  fill: "none"
195
- }, props), _path$10 || (_path$10 = /*#__PURE__*/React.createElement("path", {
196
- d: "M8.999 3.333L5.665 6H3v4h2.666L9 12.667V3.333zm3.026 2.307a3.333 3.333 0 010 4.713"
195
+ }, props), _path$16 || (_path$16 = /*#__PURE__*/React.createElement("path", {
196
+ d: "M8.999 3.333L5.665 6H3v4h2.666L9 12.667V3.333zm3.026 2.307a3.333 3.333 0 010 4.714"
197
197
  })));
198
198
  }
199
199
 
200
- var _path$$;
200
+ var _path$15;
201
201
 
202
202
  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); }
203
203
 
@@ -210,12 +210,12 @@ function SvgVolumeMute(props) {
210
210
  width: "1em",
211
211
  height: "1em",
212
212
  fill: "none"
213
- }, props), _path$$ || (_path$$ = /*#__PURE__*/React.createElement("path", {
213
+ }, props), _path$15 || (_path$15 = /*#__PURE__*/React.createElement("path", {
214
214
  d: "M7.333 3.333L4 6H1.333v4H4l3.333 2.667V3.333z"
215
215
  })));
216
216
  }
217
217
 
218
- var _path$_;
218
+ var _path$14;
219
219
 
220
220
  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); }
221
221
 
@@ -228,12 +228,12 @@ function SvgVolumeOff(props) {
228
228
  width: "1em",
229
229
  height: "1em",
230
230
  fill: "none"
231
- }, props), _path$_ || (_path$_ = /*#__PURE__*/React.createElement("path", {
231
+ }, props), _path$14 || (_path$14 = /*#__PURE__*/React.createElement("path", {
232
232
  d: "M7.333 3.333L4 6H1.333v4H4l3.333 2.667V3.333zm8 2.667l-4 4m0-4l4 4"
233
233
  })));
234
234
  }
235
235
 
236
- var _path$Z;
236
+ var _path$13;
237
237
 
238
238
  function _extends$17() { _extends$17 = 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$17.apply(this, arguments); }
239
239
 
@@ -246,7 +246,7 @@ function SvgVolumeUp(props) {
246
246
  width: "1em",
247
247
  height: "1em",
248
248
  fill: "none"
249
- }, props), _path$Z || (_path$Z = /*#__PURE__*/React.createElement("path", {
249
+ }, props), _path$13 || (_path$13 = /*#__PURE__*/React.createElement("path", {
250
250
  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"
251
251
  })));
252
252
  }
@@ -966,6 +966,11 @@ var Switch = forwardRef(function (props, ref) {
966
966
  });
967
967
  Switch.displayName = 'Switch';
968
968
 
969
+ var TabPanel = function (props) {
970
+ var children = props.children, show = props.show;
971
+ return show ? React__default.createElement(Box, null, children) : null;
972
+ };
973
+
969
974
  var useToggleButtonStyles = makeStyles$1(function (theme) { return ({
970
975
  root: {
971
976
  color: theme.palette.text.primary,
@@ -1081,5 +1086,36 @@ var useCollapsibleText = function () {
1081
1086
  };
1082
1087
  };
1083
1088
 
1084
- export { AudioPlayer, Avatar, Button, Checkbox, CollapsibleText, Divider, Icon, IconButton, Link, NumberField, Paper, PaperContent, Radio, SplitInput, Switch, ToggleButton, ToggleButtonGroup, Tooltip, Typography, useCollapsibleText };
1089
+ var useTabs = function (options) {
1090
+ var initialTab = options.initialTab;
1091
+ var genTabId = function (id) { return ("tab-" + id).toLowerCase().replace(/ /g, '-'); };
1092
+ var genPanelId = function (id) { return ("tab-panel-" + id).toLowerCase().replace(/ /g, '-'); };
1093
+ var _a = useState(genTabId(initialTab)), activeTab = _a[0], setActiveTab = _a[1];
1094
+ var handleChange = function (_, nextTab) { return setActiveTab(nextTab); };
1095
+ var TabsProps = { onChange: handleChange, value: activeTab };
1096
+ var useTab = function (baseId) {
1097
+ var tabId = genTabId(baseId);
1098
+ var tabPanelId = genPanelId(baseId);
1099
+ var tabProps = {
1100
+ id: tabId,
1101
+ label: baseId,
1102
+ value: tabId,
1103
+ 'aria-controls': tabPanelId,
1104
+ };
1105
+ var panelProps = {
1106
+ id: tabPanelId,
1107
+ role: 'tabpanel',
1108
+ show: activeTab === tabId,
1109
+ 'aria-labelledby': tabId,
1110
+ };
1111
+ return [tabProps, panelProps];
1112
+ };
1113
+ return {
1114
+ TabsProps: TabsProps,
1115
+ useTab: useTab,
1116
+ setActiveTab: function (tabId) { return setActiveTab(tabId); },
1117
+ };
1118
+ };
1119
+
1120
+ export { AudioPlayer, Avatar, Button, Checkbox, CollapsibleText, Divider, Icon, IconButton, Link, NumberField, Paper, PaperContent, Radio, SplitInput, Switch, TabPanel, ToggleButton, ToggleButtonGroup, Tooltip, Typography, useCollapsibleText, useTabs };
1085
1121
  //# sourceMappingURL=index.es.js.map