@superdispatch/ui-lab 0.18.0 → 0.18.3

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.
@@ -0,0 +1,40 @@
1
+ import _objectSpread from "@babel/runtime/helpers/objectSpread2";
2
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
+ var _excluded = ["color", "target", "rel"],
4
+ _excluded2 = ["children", "linkComponent"];
5
+ import { Link } from '@material-ui/core';
6
+ import { forwardRef } from 'react';
7
+ import { Anchorme } from 'react-anchorme';
8
+ import { jsx as _jsx } from "react/jsx-runtime";
9
+ var DefaultLinkComponent = /*#__PURE__*/forwardRef((_ref, ref) => {
10
+ var {
11
+ color,
12
+ target = '_blank',
13
+ rel = 'noreferrer noopener'
14
+ } = _ref,
15
+ props = _objectWithoutProperties(_ref, _excluded);
16
+
17
+ return /*#__PURE__*/_jsx(Link, _objectSpread(_objectSpread({}, props), {}, {
18
+ ref: ref,
19
+ rel: rel,
20
+ target: target
21
+ }));
22
+ });
23
+ if (process.env.NODE_ENV !== "production") DefaultLinkComponent.displayName = "DefaultLinkComponent";
24
+ DefaultLinkComponent.displayName = 'DefaultLinkComponent';
25
+ export function LinkedText(_ref2) {
26
+ var {
27
+ children,
28
+ linkComponent = DefaultLinkComponent
29
+ } = _ref2,
30
+ props = _objectWithoutProperties(_ref2, _excluded2);
31
+
32
+ if (!children) {
33
+ return null;
34
+ }
35
+
36
+ return /*#__PURE__*/_jsx(Anchorme, _objectSpread(_objectSpread({}, props), {}, {
37
+ linkComponent: linkComponent,
38
+ children: children
39
+ }));
40
+ }
@@ -15,7 +15,7 @@ var Aside = /*#__PURE__*/styled.aside.withConfig({
15
15
  var Main = /*#__PURE__*/styled.main.withConfig({
16
16
  displayName: "Navbar__Main",
17
17
  componentId: "SD__sc-1oiqig8-1"
18
- })(["flex:1;display:flex;flex-direction:column;overflow:auto;"]);
18
+ })(["flex:1;display:flex;flex-direction:column;overflow:scroll;"]);
19
19
  export function Navbar(_ref) {
20
20
  var {
21
21
  footer,
@@ -37,8 +37,10 @@ export function NavbarAvatar(_ref) {
37
37
  children: /*#__PURE__*/_jsxs(Stack, {
38
38
  space: "none",
39
39
  children: [/*#__PURE__*/_jsx(StyledTypography, {
40
+ variant: "caption",
40
41
  children: title
41
42
  }), /*#__PURE__*/_jsx(StyledTypography, {
43
+ variant: "caption",
42
44
  children: subtitle
43
45
  })]
44
46
  })
@@ -1,17 +1,18 @@
1
1
  import _objectSpread from "@babel/runtime/helpers/objectSpread2";
2
2
  import { IconButton } from '@material-ui/core';
3
- import { Menu as MenuIcon, MenuOpen, MoreHoriz } from '@material-ui/icons';
4
- import { AdaptiveVerticalToolbar, Color, Inline, useResponsiveValue } from '@superdispatch/ui';
3
+ import { Menu as MenuIcon, MenuOpen } from '@material-ui/icons';
4
+ import { Color, Inline, useResponsiveValue } from '@superdispatch/ui';
5
5
  import { useMemo } from 'react';
6
6
  import styled from 'styled-components';
7
7
  import { useNavbarContext } from "./NavbarContext.js";
8
8
  import { NavbarBadge, NavbarItem, NavbarLabel } from "./NavbarItem.js";
9
9
  import { jsx as _jsx } from "react/jsx-runtime";
10
10
  import { jsxs as _jsxs } from "react/jsx-runtime";
11
+ import { createElement as _createElement } from "react";
11
12
  var Header = /*#__PURE__*/styled.div.withConfig({
12
13
  displayName: "NavbarList__Header",
13
14
  componentId: "SD__sc-19zrmxc-0"
14
- })(["margin:0 16px 8px;display:flex;flex-shrink:0;align-items:center;justify-content:space-between;"]);
15
+ })(["margin:0 16px 8px;display:flex;flex-shrink:0;align-items:center;justify-content:space-between;position:sticky;"]);
15
16
  var Wrapper = /*#__PURE__*/styled.div.withConfig({
16
17
  displayName: "NavbarList__Wrapper",
17
18
  componentId: "SD__sc-19zrmxc-1"
@@ -38,7 +39,7 @@ var ExpandIconButton = /*#__PURE__*/styled(IconButton).withConfig({
38
39
  var Footer = /*#__PURE__*/styled.div.withConfig({
39
40
  displayName: "NavbarList__Footer",
40
41
  componentId: "SD__sc-19zrmxc-3"
41
- })(["flex-grow:1;display:flex;align-items:flex-end;margin:16px 0 8px;"]);
42
+ })(["flex-grow:1;display:flex;align-items:flex-end;margin:16px 0 8px;position:sticky;"]);
42
43
  var Root = /*#__PURE__*/styled.div.withConfig({
43
44
  displayName: "NavbarList__Root",
44
45
  componentId: "SD__sc-19zrmxc-4"
@@ -65,7 +66,7 @@ export function NavbarMenuItem(_ref4) {
65
66
  var Content = /*#__PURE__*/styled.div.withConfig({
66
67
  displayName: "NavbarList__Content",
67
68
  componentId: "SD__sc-19zrmxc-5"
68
- })(["height:100%;min-height:50px;&[aria-expanded='false']{", ",", "{visibility:hidden;}}"], NavbarBadge, NavbarLabel);
69
+ })(["height:100%;min-height:50px;overflow:scroll;&[aria-expanded='false']{", ",", "{visibility:hidden;}}"], NavbarBadge, NavbarLabel);
69
70
  export function NavbarList(_ref5) {
70
71
  var {
71
72
  header,
@@ -102,41 +103,22 @@ export function NavbarList(_ref5) {
102
103
  })]
103
104
  }), /*#__PURE__*/_jsx(Content, {
104
105
  "aria-expanded": isSidebarOpened,
105
- children: /*#__PURE__*/_jsx(AdaptiveVerticalToolbar, {
106
- disableGutters: true,
107
- items: filteredItems,
108
- renderItem: item => {
109
- var navbarItem = item;
110
- var index = filteredItems.indexOf(navbarItem);
111
- var prev = filteredItems[index - 1];
112
- return /*#__PURE__*/_jsx(NavbarItem, _objectSpread(_objectSpread({}, item), {}, {
113
- gutter: prev && prev.groupKey !== navbarItem.groupKey,
114
- onClick: event => {
115
- var _item$onClick;
116
-
117
- (_item$onClick = item.onClick) === null || _item$onClick === void 0 ? void 0 : _item$onClick.call(item, event);
118
-
119
- if (!event.isDefaultPrevented()) {
120
- setDrawerOpen(false);
121
- }
122
- }
123
- }));
124
- },
125
- renderMenuItem: item => /*#__PURE__*/_jsx(NavbarMenuItem, _objectSpread(_objectSpread({}, item), {}, {
106
+ children: filteredItems.map(item => {
107
+ var index = filteredItems.indexOf(item);
108
+ var prev = filteredItems[index - 1];
109
+ return /*#__PURE__*/_createElement(NavbarItem, _objectSpread(_objectSpread({}, item), {}, {
110
+ key: item.key,
111
+ gutter: prev && prev.groupKey !== item.groupKey,
126
112
  onClick: event => {
127
- var _item$onClick2;
113
+ var _item$onClick;
128
114
 
129
- (_item$onClick2 = item.onClick) === null || _item$onClick2 === void 0 ? void 0 : _item$onClick2.call(item, event);
115
+ (_item$onClick = item.onClick) === null || _item$onClick === void 0 ? void 0 : _item$onClick.call(item, event);
130
116
 
131
117
  if (!event.isDefaultPrevented()) {
132
118
  setDrawerOpen(false);
133
119
  }
134
120
  }
135
- })),
136
- moreElement: /*#__PURE__*/_jsx(NavbarItem, {
137
- icon: /*#__PURE__*/_jsx(MoreHoriz, {}),
138
- label: "More"
139
- })
121
+ }));
140
122
  })
141
123
  }), /*#__PURE__*/_jsx(Footer, {
142
124
  children: footer
package/dist-web/index.js CHANGED
@@ -1,6 +1,6 @@
1
- import { CheckCircle, Info, Error, Image, Refresh, Delete, Menu, MenuOpen, MoreHoriz, OpenInNew } from '@material-ui/icons';
1
+ import { CheckCircle, Info, Error, Image, Refresh, Delete, Menu, MenuOpen, OpenInNew } from '@material-ui/icons';
2
2
  import { Alert as Alert$1 } from '@material-ui/lab';
3
- import { Color, parseResponsiveProp, isColorProp, parseSpaceProp, Stack, mergeRefs, useUID, isEmptyReactNode, Columns, Column, Inline, CardButton, useResponsiveValue, AdaptiveVerticalToolbar } from '@superdispatch/ui';
3
+ import { Color, parseResponsiveProp, isColorProp, parseSpaceProp, Stack, mergeRefs, useUID, isEmptyReactNode, Columns, Column, Inline, CardButton, useResponsiveValue } from '@superdispatch/ui';
4
4
  import { forwardRef, useState, useEffect, useRef, useLayoutEffect, Suspense, memo, useContext, createContext, useMemo, createElement } from 'react';
5
5
  import styled, { css, keyframes } from 'styled-components';
6
6
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
@@ -1123,7 +1123,7 @@ function NavbarItem(_ref) {
1123
1123
  var Header = /*#__PURE__*/styled.div.withConfig({
1124
1124
  displayName: "NavbarList__Header",
1125
1125
  componentId: "SD__sc-19zrmxc-0"
1126
- })(["margin:0 16px 8px;display:flex;flex-shrink:0;align-items:center;justify-content:space-between;"]);
1126
+ })(["margin:0 16px 8px;display:flex;flex-shrink:0;align-items:center;justify-content:space-between;position:sticky;"]);
1127
1127
  var Wrapper = /*#__PURE__*/styled.div.withConfig({
1128
1128
  displayName: "NavbarList__Wrapper",
1129
1129
  componentId: "SD__sc-19zrmxc-1"
@@ -1150,7 +1150,7 @@ var ExpandIconButton = /*#__PURE__*/styled(IconButton).withConfig({
1150
1150
  var Footer = /*#__PURE__*/styled.div.withConfig({
1151
1151
  displayName: "NavbarList__Footer",
1152
1152
  componentId: "SD__sc-19zrmxc-3"
1153
- })(["flex-grow:1;display:flex;align-items:flex-end;margin:16px 0 8px;"]);
1153
+ })(["flex-grow:1;display:flex;align-items:flex-end;margin:16px 0 8px;position:sticky;"]);
1154
1154
  var Root = /*#__PURE__*/styled.div.withConfig({
1155
1155
  displayName: "NavbarList__Root",
1156
1156
  componentId: "SD__sc-19zrmxc-4"
@@ -1177,7 +1177,7 @@ function NavbarMenuItem(_ref4) {
1177
1177
  var Content = /*#__PURE__*/styled.div.withConfig({
1178
1178
  displayName: "NavbarList__Content",
1179
1179
  componentId: "SD__sc-19zrmxc-5"
1180
- })(["height:100%;min-height:50px;&[aria-expanded='false']{", ",", "{visibility:hidden;}}"], NavbarBadge, NavbarLabel);
1180
+ })(["height:100%;min-height:50px;overflow:scroll;&[aria-expanded='false']{", ",", "{visibility:hidden;}}"], NavbarBadge, NavbarLabel);
1181
1181
  function NavbarList(_ref5) {
1182
1182
  var {
1183
1183
  header,
@@ -1214,41 +1214,22 @@ function NavbarList(_ref5) {
1214
1214
  })]
1215
1215
  }), /*#__PURE__*/jsx(Content, {
1216
1216
  "aria-expanded": isSidebarOpened,
1217
- children: /*#__PURE__*/jsx(AdaptiveVerticalToolbar, {
1218
- disableGutters: true,
1219
- items: filteredItems,
1220
- renderItem: item => {
1221
- var navbarItem = item;
1222
- var index = filteredItems.indexOf(navbarItem);
1223
- var prev = filteredItems[index - 1];
1224
- return /*#__PURE__*/jsx(NavbarItem, _objectSpread(_objectSpread({}, item), {}, {
1225
- gutter: prev && prev.groupKey !== navbarItem.groupKey,
1226
- onClick: event => {
1227
- var _item$onClick;
1228
-
1229
- (_item$onClick = item.onClick) === null || _item$onClick === void 0 ? void 0 : _item$onClick.call(item, event);
1230
-
1231
- if (!event.isDefaultPrevented()) {
1232
- setDrawerOpen(false);
1233
- }
1234
- }
1235
- }));
1236
- },
1237
- renderMenuItem: item => /*#__PURE__*/jsx(NavbarMenuItem, _objectSpread(_objectSpread({}, item), {}, {
1217
+ children: filteredItems.map(item => {
1218
+ var index = filteredItems.indexOf(item);
1219
+ var prev = filteredItems[index - 1];
1220
+ return /*#__PURE__*/createElement(NavbarItem, _objectSpread(_objectSpread({}, item), {}, {
1221
+ key: item.key,
1222
+ gutter: prev && prev.groupKey !== item.groupKey,
1238
1223
  onClick: event => {
1239
- var _item$onClick2;
1224
+ var _item$onClick;
1240
1225
 
1241
- (_item$onClick2 = item.onClick) === null || _item$onClick2 === void 0 ? void 0 : _item$onClick2.call(item, event);
1226
+ (_item$onClick = item.onClick) === null || _item$onClick === void 0 ? void 0 : _item$onClick.call(item, event);
1242
1227
 
1243
1228
  if (!event.isDefaultPrevented()) {
1244
1229
  setDrawerOpen(false);
1245
1230
  }
1246
1231
  }
1247
- })),
1248
- moreElement: /*#__PURE__*/jsx(NavbarItem, {
1249
- icon: /*#__PURE__*/jsx(MoreHoriz, {}),
1250
- label: "More"
1251
- })
1232
+ }));
1252
1233
  })
1253
1234
  }), /*#__PURE__*/jsx(Footer, {
1254
1235
  children: footer
@@ -1263,7 +1244,7 @@ var Aside = /*#__PURE__*/styled.aside.withConfig({
1263
1244
  var Main = /*#__PURE__*/styled.main.withConfig({
1264
1245
  displayName: "Navbar__Main",
1265
1246
  componentId: "SD__sc-1oiqig8-1"
1266
- })(["flex:1;display:flex;flex-direction:column;overflow:auto;"]);
1247
+ })(["flex:1;display:flex;flex-direction:column;overflow:scroll;"]);
1267
1248
  function Navbar(_ref) {
1268
1249
  var {
1269
1250
  footer,
@@ -1361,8 +1342,10 @@ function NavbarAvatar(_ref) {
1361
1342
  children: /*#__PURE__*/jsxs(Stack, {
1362
1343
  space: "none",
1363
1344
  children: [/*#__PURE__*/jsx(StyledTypography, {
1345
+ variant: "caption",
1364
1346
  children: title
1365
1347
  }), /*#__PURE__*/jsx(StyledTypography, {
1348
+ variant: "caption",
1366
1349
  children: subtitle
1367
1350
  })]
1368
1351
  })