@superdispatch/ui-lab 0.18.3 → 0.19.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/dist-node/index.js +152 -5
- package/dist-node/index.js.map +1 -1
- package/dist-src/index.js +2 -0
- package/dist-src/multiline-text/MultilineText.js +11 -0
- package/dist-src/navbar/NavbarAccordion.js +97 -0
- package/dist-src/navbar/NavbarItem.js +4 -2
- package/dist-src/navbar/NavbarList.js +11 -1
- package/dist-types/index.d.ts +33 -4
- package/dist-web/index.js +153 -8
- package/dist-web/index.js.map +1 -1
- package/package.json +3 -3
package/dist-node/index.js
CHANGED
|
@@ -17,6 +17,7 @@ var reactTransitionGroup = require('react-transition-group');
|
|
|
17
17
|
var core = require('@material-ui/core');
|
|
18
18
|
var js = require('@mdi/js');
|
|
19
19
|
var Dropzone = _interopDefault(require('react-dropzone'));
|
|
20
|
+
var reactAnchorme = require('react-anchorme');
|
|
20
21
|
var lodash = require('lodash');
|
|
21
22
|
|
|
22
23
|
function colorMixin(textColor, backgroundColor, buttonHoverColor) {
|
|
@@ -1012,6 +1013,52 @@ var FileListItem = /*#__PURE__*/react.forwardRef((_ref2, ref) => {
|
|
|
1012
1013
|
});
|
|
1013
1014
|
if (process.env.NODE_ENV !== "production") FileListItem.displayName = "FileListItem";
|
|
1014
1015
|
|
|
1016
|
+
var _excluded$6 = ["color", "target", "rel"],
|
|
1017
|
+
_excluded2$2 = ["children", "linkComponent"];
|
|
1018
|
+
var DefaultLinkComponent = /*#__PURE__*/react.forwardRef((_ref, ref) => {
|
|
1019
|
+
var {
|
|
1020
|
+
color,
|
|
1021
|
+
target = '_blank',
|
|
1022
|
+
rel = 'noreferrer noopener'
|
|
1023
|
+
} = _ref,
|
|
1024
|
+
props = _objectWithoutProperties(_ref, _excluded$6);
|
|
1025
|
+
|
|
1026
|
+
return /*#__PURE__*/jsxRuntime.jsx(core.Link, _objectSpread(_objectSpread({}, props), {}, {
|
|
1027
|
+
ref: ref,
|
|
1028
|
+
rel: rel,
|
|
1029
|
+
target: target
|
|
1030
|
+
}));
|
|
1031
|
+
});
|
|
1032
|
+
if (process.env.NODE_ENV !== "production") DefaultLinkComponent.displayName = "DefaultLinkComponent";
|
|
1033
|
+
DefaultLinkComponent.displayName = 'DefaultLinkComponent';
|
|
1034
|
+
function LinkedText(_ref2) {
|
|
1035
|
+
var {
|
|
1036
|
+
children,
|
|
1037
|
+
linkComponent = DefaultLinkComponent
|
|
1038
|
+
} = _ref2,
|
|
1039
|
+
props = _objectWithoutProperties(_ref2, _excluded2$2);
|
|
1040
|
+
|
|
1041
|
+
if (!children) {
|
|
1042
|
+
return null;
|
|
1043
|
+
}
|
|
1044
|
+
|
|
1045
|
+
return /*#__PURE__*/jsxRuntime.jsx(reactAnchorme.Anchorme, _objectSpread(_objectSpread({}, props), {}, {
|
|
1046
|
+
linkComponent: linkComponent,
|
|
1047
|
+
children: children
|
|
1048
|
+
}));
|
|
1049
|
+
}
|
|
1050
|
+
|
|
1051
|
+
var MultilineText = /*#__PURE__*/styled__default.span.withConfig({
|
|
1052
|
+
displayName: "MultilineText",
|
|
1053
|
+
componentId: "SD__sc-34heyp-0"
|
|
1054
|
+
})(["white-space:pre-wrap;overflow-wrap:", ";"], _ref => {
|
|
1055
|
+
var {
|
|
1056
|
+
overflowWrap = 'normal'
|
|
1057
|
+
} = _ref;
|
|
1058
|
+
return overflowWrap;
|
|
1059
|
+
});
|
|
1060
|
+
MultilineText.displayName = 'MultilineText';
|
|
1061
|
+
|
|
1015
1062
|
var NavbarContext = /*#__PURE__*/react.createContext({
|
|
1016
1063
|
isDrawerOpen: false,
|
|
1017
1064
|
isExpanded: false,
|
|
@@ -1090,7 +1137,7 @@ var NavbarLabel = /*#__PURE__*/styled__default.span.withConfig({
|
|
|
1090
1137
|
var NavbarItemRoot = /*#__PURE__*/styled__default.div.withConfig({
|
|
1091
1138
|
displayName: "NavbarItem__NavbarItemRoot",
|
|
1092
1139
|
componentId: "SD__sc-1pvzq3w-2"
|
|
1093
|
-
})(["width:100%;display:flex;align-items:center;color:#c2c4c9;font-size:14px;font-weight:400;line-height:20px;text-decoration:none;outline:none;cursor:pointer;padding:8px 16px;border-left:4px solid transparent;&:hover,&[aria-current]{background-color:#2f394a;color:", ";border-left-color:", ";}"], ui.Color.White, ui.Color.Blue300);
|
|
1140
|
+
})(["width:100%;display:flex;align-items:center;color:#c2c4c9;font-size:14px;font-weight:400;line-height:20px;text-decoration:none;outline:none;cursor:pointer;padding:8px 16px;border-left:4px solid transparent;&:hover,&[aria-current]{background-color:#2f394a;color:", ";border-left-color:", ";}&[data-active='true']{border-left-color:", ";}"], ui.Color.White, ui.Color.Blue300, ui.Color.Blue300);
|
|
1094
1141
|
var IconWrapper$1 = /*#__PURE__*/styled__default.div.withConfig({
|
|
1095
1142
|
displayName: "NavbarItem__IconWrapper",
|
|
1096
1143
|
componentId: "SD__sc-1pvzq3w-3"
|
|
@@ -1104,13 +1151,15 @@ function NavbarItem(_ref) {
|
|
|
1104
1151
|
component,
|
|
1105
1152
|
onClick,
|
|
1106
1153
|
variant,
|
|
1107
|
-
ident = 0
|
|
1154
|
+
ident = 0,
|
|
1155
|
+
active
|
|
1108
1156
|
} = _ref;
|
|
1109
1157
|
var uid = ui.useUID();
|
|
1110
1158
|
return /*#__PURE__*/jsxRuntime.jsxs(NavbarItemRoot, {
|
|
1111
1159
|
as: component,
|
|
1112
1160
|
onClick: onClick,
|
|
1113
1161
|
"aria-labelledby": uid,
|
|
1162
|
+
"data-active": active,
|
|
1114
1163
|
style: {
|
|
1115
1164
|
marginTop: gutter ? '16px' : '0',
|
|
1116
1165
|
paddingLeft: (ident + 1) * 20
|
|
@@ -1127,6 +1176,93 @@ function NavbarItem(_ref) {
|
|
|
1127
1176
|
});
|
|
1128
1177
|
}
|
|
1129
1178
|
|
|
1179
|
+
var NavbarAccordionLabel = /*#__PURE__*/styled__default.span.withConfig({
|
|
1180
|
+
displayName: "NavbarAccordion__NavbarAccordionLabel",
|
|
1181
|
+
componentId: "SD__sc-1s7g3kw-0"
|
|
1182
|
+
})(["flex-grow:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;&[data-expanded='false']{display:none;}"]);
|
|
1183
|
+
var NavbarAccordionRoot = /*#__PURE__*/styled__default(core.Accordion).withConfig({
|
|
1184
|
+
displayName: "NavbarAccordion__NavbarAccordionRoot",
|
|
1185
|
+
componentId: "SD__sc-1s7g3kw-1"
|
|
1186
|
+
})(_ref => {
|
|
1187
|
+
var {
|
|
1188
|
+
gutter
|
|
1189
|
+
} = _ref;
|
|
1190
|
+
return styled.css(["width:100%;color:#c2c4c9;font-size:14px;font-weight:400;line-height:20px;text-decoration:none;outline:none;cursor:pointer;background-color:#1b2638;margin-top:", ";&:hover,&[aria-current]{background-color:#2f394a;color:", ";}&.MuiAccordion-root:before{background-color:#1b2638;}&.MuiPaper-elevation0{border:0px;}&&.MuiAccordionSummary-root.Mui-expanded{margin-top:", ";max-height:40px;min-height:40px;}"], gutter ? '16px' : '0', ui.Color.White, gutter ? '16px' : '0');
|
|
1191
|
+
});
|
|
1192
|
+
var NavbarAccordionSummary = /*#__PURE__*/styled__default(core.AccordionSummary).withConfig({
|
|
1193
|
+
displayName: "NavbarAccordion__NavbarAccordionSummary",
|
|
1194
|
+
componentId: "SD__sc-1s7g3kw-2"
|
|
1195
|
+
})(["border-left:4px solid transparent;padding-left:20px;&.MuiAccordionSummary-root{max-height:40px;min-height:40px;}&:hover,&[data-active='true']{border-left-color:", ";}&[data-expanded='false']{.MuiAccordionSummary-expandIcon{display:none;}}"], ui.Color.Blue300);
|
|
1196
|
+
var IconWrapper$2 = /*#__PURE__*/styled__default.div.withConfig({
|
|
1197
|
+
displayName: "NavbarAccordion__IconWrapper",
|
|
1198
|
+
componentId: "SD__sc-1s7g3kw-3"
|
|
1199
|
+
})(["width:24px;margin-right:8px;& svg{font-size:24px;}"]);
|
|
1200
|
+
function NavbarAccordion(_ref2) {
|
|
1201
|
+
var {
|
|
1202
|
+
label,
|
|
1203
|
+
icon,
|
|
1204
|
+
gutter,
|
|
1205
|
+
items,
|
|
1206
|
+
onClick: _onClick
|
|
1207
|
+
} = _ref2;
|
|
1208
|
+
var uid = ui.useUID();
|
|
1209
|
+
var {
|
|
1210
|
+
isExpanded: isMenuExpanded,
|
|
1211
|
+
isDrawerOpen,
|
|
1212
|
+
setDrawerOpen
|
|
1213
|
+
} = useNavbarContext();
|
|
1214
|
+
var [isExpanded, setExpanded] = react.useState(false);
|
|
1215
|
+
react.useEffect(() => {
|
|
1216
|
+
if (!isMenuExpanded) {
|
|
1217
|
+
setExpanded(false);
|
|
1218
|
+
}
|
|
1219
|
+
}, [isMenuExpanded]);
|
|
1220
|
+
return /*#__PURE__*/jsxRuntime.jsxs(NavbarAccordionRoot, {
|
|
1221
|
+
"aria-labelledby": uid,
|
|
1222
|
+
gutter: !!gutter,
|
|
1223
|
+
expanded: isExpanded,
|
|
1224
|
+
onClick: event => {
|
|
1225
|
+
if (isMenuExpanded || isDrawerOpen) {
|
|
1226
|
+
setExpanded(!isExpanded);
|
|
1227
|
+
}
|
|
1228
|
+
|
|
1229
|
+
_onClick(event);
|
|
1230
|
+
},
|
|
1231
|
+
square: true,
|
|
1232
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs(NavbarAccordionSummary, {
|
|
1233
|
+
"data-active": !isExpanded && items.some(item => item.active),
|
|
1234
|
+
"data-expanded": isMenuExpanded || isDrawerOpen,
|
|
1235
|
+
expandIcon: /*#__PURE__*/jsxRuntime.jsx(icons.ExpandMore, {}),
|
|
1236
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(IconWrapper$2, {
|
|
1237
|
+
children: icon
|
|
1238
|
+
}), /*#__PURE__*/jsxRuntime.jsx(NavbarAccordionLabel, {
|
|
1239
|
+
id: uid,
|
|
1240
|
+
"data-expanded": isMenuExpanded || isDrawerOpen,
|
|
1241
|
+
children: label
|
|
1242
|
+
})]
|
|
1243
|
+
}), items.map(item => {
|
|
1244
|
+
var index = items.indexOf(item);
|
|
1245
|
+
var prev = items[index - 1];
|
|
1246
|
+
return /*#__PURE__*/react.createElement(NavbarItem, _objectSpread(_objectSpread({}, item), {}, {
|
|
1247
|
+
key: item.key,
|
|
1248
|
+
ident: 1,
|
|
1249
|
+
active: item.active,
|
|
1250
|
+
gutter: prev && prev.groupKey !== item.groupKey,
|
|
1251
|
+
onClick: event => {
|
|
1252
|
+
var _item$onClick;
|
|
1253
|
+
|
|
1254
|
+
event.stopPropagation();
|
|
1255
|
+
(_item$onClick = item.onClick) === null || _item$onClick === void 0 ? void 0 : _item$onClick.call(item, event);
|
|
1256
|
+
|
|
1257
|
+
if (!event.isDefaultPrevented()) {
|
|
1258
|
+
setDrawerOpen(false);
|
|
1259
|
+
}
|
|
1260
|
+
}
|
|
1261
|
+
}));
|
|
1262
|
+
})]
|
|
1263
|
+
});
|
|
1264
|
+
}
|
|
1265
|
+
|
|
1130
1266
|
var Header = /*#__PURE__*/styled__default.div.withConfig({
|
|
1131
1267
|
displayName: "NavbarList__Header",
|
|
1132
1268
|
componentId: "SD__sc-19zrmxc-0"
|
|
@@ -1184,7 +1320,7 @@ function NavbarMenuItem(_ref4) {
|
|
|
1184
1320
|
var Content = /*#__PURE__*/styled__default.div.withConfig({
|
|
1185
1321
|
displayName: "NavbarList__Content",
|
|
1186
1322
|
componentId: "SD__sc-19zrmxc-5"
|
|
1187
|
-
})(["height:100%;min-height:50px;overflow:
|
|
1323
|
+
})(["height:100%;min-height:50px;overflow-y:auto;overflow-x:hidden;&[aria-expanded='false']{", ",", "{display:none;}}"], NavbarBadge, NavbarLabel);
|
|
1188
1324
|
function NavbarList(_ref5) {
|
|
1189
1325
|
var {
|
|
1190
1326
|
header,
|
|
@@ -1224,6 +1360,15 @@ function NavbarList(_ref5) {
|
|
|
1224
1360
|
children: filteredItems.map(item => {
|
|
1225
1361
|
var index = filteredItems.indexOf(item);
|
|
1226
1362
|
var prev = filteredItems[index - 1];
|
|
1363
|
+
|
|
1364
|
+
if ('items' in item) {
|
|
1365
|
+
return /*#__PURE__*/react.createElement(NavbarAccordion, _objectSpread(_objectSpread({}, item), {}, {
|
|
1366
|
+
key: item.key,
|
|
1367
|
+
gutter: prev && prev.groupKey !== item.groupKey,
|
|
1368
|
+
onClick: item.onClick
|
|
1369
|
+
}));
|
|
1370
|
+
}
|
|
1371
|
+
|
|
1227
1372
|
return /*#__PURE__*/react.createElement(NavbarItem, _objectSpread(_objectSpread({}, item), {}, {
|
|
1228
1373
|
key: item.key,
|
|
1229
1374
|
gutter: prev && prev.groupKey !== item.groupKey,
|
|
@@ -1318,7 +1463,7 @@ function Navbar(_ref) {
|
|
|
1318
1463
|
});
|
|
1319
1464
|
}
|
|
1320
1465
|
|
|
1321
|
-
var _excluded$
|
|
1466
|
+
var _excluded$7 = ["title", "subtitle", "children"];
|
|
1322
1467
|
var StyledTypography = /*#__PURE__*/styled__default(core.Typography).withConfig({
|
|
1323
1468
|
displayName: "NavbarAvatar__StyledTypography",
|
|
1324
1469
|
componentId: "SD__sc-19q2zd0-0"
|
|
@@ -1329,7 +1474,7 @@ function NavbarAvatar(_ref) {
|
|
|
1329
1474
|
subtitle,
|
|
1330
1475
|
children
|
|
1331
1476
|
} = _ref,
|
|
1332
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
1477
|
+
props = _objectWithoutProperties(_ref, _excluded$7);
|
|
1333
1478
|
|
|
1334
1479
|
var {
|
|
1335
1480
|
isExpanded,
|
|
@@ -1770,6 +1915,8 @@ exports.Container = Container;
|
|
|
1770
1915
|
exports.DescriptionItem = DescriptionItem;
|
|
1771
1916
|
exports.FileDropZone = FileDropZone;
|
|
1772
1917
|
exports.FileListItem = FileListItem;
|
|
1918
|
+
exports.LinkedText = LinkedText;
|
|
1919
|
+
exports.MultilineText = MultilineText;
|
|
1773
1920
|
exports.Navbar = Navbar;
|
|
1774
1921
|
exports.NavbarAvatar = NavbarAvatar;
|
|
1775
1922
|
exports.NavbarBadge = NavbarBadge;
|