@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
|
@@ -65,6 +65,7 @@ export { default as SplitInput, SplitInputProps } from './SplitInput';
|
|
|
65
65
|
export { default as Switch, SwitchProps } from './Switch';
|
|
66
66
|
export { default as Tab, TabProps } from './Tab';
|
|
67
67
|
export { default as Tabs, TabsProps } from './Tabs';
|
|
68
|
+
export { TabPanel, TabPanelProps } from './TabPanel';
|
|
68
69
|
export { default as TextField, TextFieldProps } from './TextField';
|
|
69
70
|
export { default as ThemeProvider, ThemeProviderProps } from './ThemeProvider';
|
|
70
71
|
export { default as ToggleButton, ToggleButtonProps } from './ToggleButton';
|
package/build/hooks/index.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useTabs } from './useTabs';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
declare type PreConfiguredTabProps = {
|
|
2
|
+
id: string;
|
|
3
|
+
label: string;
|
|
4
|
+
value: string;
|
|
5
|
+
'aria-controls': string;
|
|
6
|
+
};
|
|
7
|
+
declare type PreConfiguredPanelProps = {
|
|
8
|
+
id: string;
|
|
9
|
+
role: string;
|
|
10
|
+
show: boolean;
|
|
11
|
+
'aria-labelledby': string;
|
|
12
|
+
};
|
|
13
|
+
export declare type UseTabResult = [PreConfiguredTabProps, PreConfiguredPanelProps];
|
|
14
|
+
export interface UseTabsResult {
|
|
15
|
+
TabsProps: {
|
|
16
|
+
onChange: (event: any, value: string) => void;
|
|
17
|
+
value: string;
|
|
18
|
+
};
|
|
19
|
+
useTab: (baseTabId: string) => UseTabResult;
|
|
20
|
+
}
|
|
21
|
+
export {};
|
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$
|
|
92
|
+
var _path$3N;
|
|
93
93
|
|
|
94
|
-
function _extends$
|
|
94
|
+
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); }
|
|
95
95
|
|
|
96
96
|
function SvgMinusCircle(props) {
|
|
97
|
-
return /*#__PURE__*/React.createElement("svg", _extends$
|
|
97
|
+
return /*#__PURE__*/React.createElement("svg", _extends$42({
|
|
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$
|
|
105
|
+
}, props), _path$3N || (_path$3N = /*#__PURE__*/React.createElement("path", {
|
|
106
106
|
d: "M8 14.667A6.667 6.667 0 108 1.333a6.667 6.667 0 000 13.334zM5.333 8h5.334"
|
|
107
107
|
})));
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
-
var _path$
|
|
110
|
+
var _path$3F;
|
|
111
111
|
|
|
112
|
-
function _extends$
|
|
112
|
+
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); }
|
|
113
113
|
|
|
114
114
|
function SvgPlusCircle(props) {
|
|
115
|
-
return /*#__PURE__*/React.createElement("svg", _extends$
|
|
115
|
+
return /*#__PURE__*/React.createElement("svg", _extends$3W({
|
|
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$
|
|
123
|
+
}, props), _path$3F || (_path$3F = /*#__PURE__*/React.createElement("path", {
|
|
124
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"
|
|
125
125
|
})));
|
|
126
126
|
}
|
|
127
127
|
|
|
128
|
-
var _path$
|
|
128
|
+
var _path$3l;
|
|
129
129
|
|
|
130
|
-
function _extends$
|
|
130
|
+
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); }
|
|
131
131
|
|
|
132
132
|
function SvgUser(props) {
|
|
133
|
-
return /*#__PURE__*/React.createElement("svg", _extends$
|
|
133
|
+
return /*#__PURE__*/React.createElement("svg", _extends$3C({
|
|
134
134
|
viewBox: "0 0 16 16",
|
|
135
135
|
strokeLinecap: "round",
|
|
136
136
|
strokeLinejoin: "round",
|
|
@@ -138,17 +138,17 @@ function SvgUser(props) {
|
|
|
138
138
|
width: "1em",
|
|
139
139
|
height: "1em",
|
|
140
140
|
fill: "none"
|
|
141
|
-
}, props), _path$
|
|
141
|
+
}, props), _path$3l || (_path$3l = /*#__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$
|
|
146
|
+
var _path$1g;
|
|
147
147
|
|
|
148
|
-
function _extends$
|
|
148
|
+
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); }
|
|
149
149
|
|
|
150
150
|
function SvgPause(props) {
|
|
151
|
-
return /*#__PURE__*/React.createElement("svg", _extends$
|
|
151
|
+
return /*#__PURE__*/React.createElement("svg", _extends$1q({
|
|
152
152
|
viewBox: "0 0 16 16",
|
|
153
153
|
strokeLinecap: "round",
|
|
154
154
|
strokeLinejoin: "round",
|
|
@@ -156,17 +156,17 @@ function SvgPause(props) {
|
|
|
156
156
|
width: "1em",
|
|
157
157
|
height: "1em",
|
|
158
158
|
fill: "none"
|
|
159
|
-
}, props), _path$
|
|
159
|
+
}, props), _path$1g || (_path$1g = /*#__PURE__*/React.createElement("path", {
|
|
160
160
|
d: "M6.667 2.667H4v10.666h2.667V2.667zm5.333 0H9.333v10.666H12V2.667z"
|
|
161
161
|
})));
|
|
162
162
|
}
|
|
163
163
|
|
|
164
|
-
var _path$
|
|
164
|
+
var _path$1e;
|
|
165
165
|
|
|
166
|
-
function _extends$
|
|
166
|
+
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); }
|
|
167
167
|
|
|
168
168
|
function SvgPlay(props) {
|
|
169
|
-
return /*#__PURE__*/React.createElement("svg", _extends$
|
|
169
|
+
return /*#__PURE__*/React.createElement("svg", _extends$1o({
|
|
170
170
|
viewBox: "0 0 16 16",
|
|
171
171
|
strokeLinecap: "round",
|
|
172
172
|
strokeLinejoin: "round",
|
|
@@ -174,17 +174,17 @@ function SvgPlay(props) {
|
|
|
174
174
|
width: "1em",
|
|
175
175
|
height: "1em",
|
|
176
176
|
fill: "none"
|
|
177
|
-
}, props), _path$
|
|
177
|
+
}, props), _path$1e || (_path$1e = /*#__PURE__*/React.createElement("path", {
|
|
178
178
|
d: "M3.333 2l9.334 6-9.334 6V2z"
|
|
179
179
|
})));
|
|
180
180
|
}
|
|
181
181
|
|
|
182
|
-
var _path$
|
|
182
|
+
var _path$11;
|
|
183
183
|
|
|
184
|
-
function _extends$
|
|
184
|
+
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); }
|
|
185
185
|
|
|
186
186
|
function SvgVolumeDown(props) {
|
|
187
|
-
return /*#__PURE__*/React.createElement("svg", _extends$
|
|
187
|
+
return /*#__PURE__*/React.createElement("svg", _extends$1b({
|
|
188
188
|
viewBox: "0 0 16 16",
|
|
189
189
|
strokeLinecap: "round",
|
|
190
190
|
strokeLinejoin: "round",
|
|
@@ -192,17 +192,17 @@ function SvgVolumeDown(props) {
|
|
|
192
192
|
width: "1em",
|
|
193
193
|
height: "1em",
|
|
194
194
|
fill: "none"
|
|
195
|
-
}, props), _path$
|
|
195
|
+
}, props), _path$11 || (_path$11 = /*#__PURE__*/React.createElement("path", {
|
|
196
196
|
d: "M8.999 3.333L5.665 6H3v4h2.666L9 12.667V3.333zm3.026 2.307a3.333 3.333 0 010 4.713"
|
|
197
197
|
})));
|
|
198
198
|
}
|
|
199
199
|
|
|
200
|
-
var _path
|
|
200
|
+
var _path$10;
|
|
201
201
|
|
|
202
|
-
function _extends$
|
|
202
|
+
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); }
|
|
203
203
|
|
|
204
204
|
function SvgVolumeMute(props) {
|
|
205
|
-
return /*#__PURE__*/React.createElement("svg", _extends$
|
|
205
|
+
return /*#__PURE__*/React.createElement("svg", _extends$1a({
|
|
206
206
|
viewBox: "0 0 16 16",
|
|
207
207
|
strokeLinecap: "round",
|
|
208
208
|
strokeLinejoin: "round",
|
|
@@ -210,17 +210,17 @@ function SvgVolumeMute(props) {
|
|
|
210
210
|
width: "1em",
|
|
211
211
|
height: "1em",
|
|
212
212
|
fill: "none"
|
|
213
|
-
}, props), _path
|
|
213
|
+
}, props), _path$10 || (_path$10 = /*#__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$$;
|
|
219
219
|
|
|
220
|
-
function _extends$
|
|
220
|
+
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); }
|
|
221
221
|
|
|
222
222
|
function SvgVolumeOff(props) {
|
|
223
|
-
return /*#__PURE__*/React.createElement("svg", _extends$
|
|
223
|
+
return /*#__PURE__*/React.createElement("svg", _extends$19({
|
|
224
224
|
viewBox: "0 0 16 16",
|
|
225
225
|
strokeLinecap: "round",
|
|
226
226
|
strokeLinejoin: "round",
|
|
@@ -228,17 +228,17 @@ function SvgVolumeOff(props) {
|
|
|
228
228
|
width: "1em",
|
|
229
229
|
height: "1em",
|
|
230
230
|
fill: "none"
|
|
231
|
-
}, props), _path
|
|
231
|
+
}, props), _path$$ || (_path$$ = /*#__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$
|
|
236
|
+
var _path$_;
|
|
237
237
|
|
|
238
|
-
function _extends$
|
|
238
|
+
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); }
|
|
239
239
|
|
|
240
240
|
function SvgVolumeUp(props) {
|
|
241
|
-
return /*#__PURE__*/React.createElement("svg", _extends$
|
|
241
|
+
return /*#__PURE__*/React.createElement("svg", _extends$18({
|
|
242
242
|
viewBox: "0 0 16 16",
|
|
243
243
|
strokeLinecap: "round",
|
|
244
244
|
strokeLinejoin: "round",
|
|
@@ -246,7 +246,7 @@ function SvgVolumeUp(props) {
|
|
|
246
246
|
width: "1em",
|
|
247
247
|
height: "1em",
|
|
248
248
|
fill: "none"
|
|
249
|
-
}, props), _path$
|
|
249
|
+
}, props), _path$_ || (_path$_ = /*#__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,35 @@ var useCollapsibleText = function () {
|
|
|
1081
1086
|
};
|
|
1082
1087
|
};
|
|
1083
1088
|
|
|
1084
|
-
|
|
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
|
+
};
|
|
1117
|
+
};
|
|
1118
|
+
|
|
1119
|
+
export { AudioPlayer, Avatar, Button, Checkbox, CollapsibleText, Divider, Icon, IconButton, Link, NumberField, Paper, PaperContent, Radio, SplitInput, Switch, TabPanel, ToggleButton, ToggleButtonGroup, Tooltip, Typography, useCollapsibleText, useTabs };
|
|
1085
1120
|
//# sourceMappingURL=index.es.js.map
|