@superdispatch/ui-lab 0.50.7 → 0.50.9
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 +31 -24
- package/dist-node/index.js.map +1 -1
- package/dist-src/navbar/NavbarAccordion.js +2 -2
- package/dist-src/navbar/NavbarItem.js +3 -2
- package/dist-src/navbar/NavbarList.js +26 -20
- package/dist-types/index.d.ts +2 -1
- package/dist-web/index.js +31 -24
- package/dist-web/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -23,7 +23,7 @@ var NavbarAccordionRoot = /*#__PURE__*/styled(Accordion).withConfig({
|
|
|
23
23
|
var NavbarAccordionSummary = /*#__PURE__*/styled(AccordionSummary).withConfig({
|
|
24
24
|
displayName: "NavbarAccordion__NavbarAccordionSummary",
|
|
25
25
|
componentId: "SD__sc-1s7g3kw-2"
|
|
26
|
-
})(["border-left:4px solid transparent;padding-left:20px;&.MuiAccordionSummary-root{max-height:40px;min-height:40px;}
|
|
26
|
+
})(["border-left:4px solid transparent;padding-left:20px;&.MuiAccordionSummary-root,&.MuiAccordionSummary-root.Mui-expanded{max-height:40px;min-height:40px;}& .MuiAccordionSummary-content{align-items:center;}&:hover,&[aria-current],&[data-active='true']{color:", ";background-color:", ";border-left-color:", ";}&[data-expanded='false']{.MuiAccordionSummary-expandIcon{display:none;}}"], Color.White, Color.White10, ColorDynamic.Blue300);
|
|
27
27
|
var IconWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
28
28
|
displayName: "NavbarAccordion__IconWrapper",
|
|
29
29
|
componentId: "SD__sc-1s7g3kw-3"
|
|
@@ -45,7 +45,7 @@ export function NavbarAccordion(_ref2) {
|
|
|
45
45
|
groupExpanded,
|
|
46
46
|
setGroupExpanded
|
|
47
47
|
} = useNavbarContext();
|
|
48
|
-
var isExpanded = (_groupExpanded$groupK = groupExpanded[groupKey]) !== null && _groupExpanded$groupK !== void 0 ? _groupExpanded$groupK : true;
|
|
48
|
+
var isExpanded = isNavbarExpanded ? (_groupExpanded$groupK = groupExpanded[groupKey]) !== null && _groupExpanded$groupK !== void 0 ? _groupExpanded$groupK : true : false;
|
|
49
49
|
var filteredItems = useMemo(() => items.filter(item => !item.hide), [items]);
|
|
50
50
|
return /*#__PURE__*/_jsxs(NavbarAccordionRoot, {
|
|
51
51
|
square: true,
|
|
@@ -23,6 +23,7 @@ export function NavbarItem(_ref) {
|
|
|
23
23
|
label,
|
|
24
24
|
gutter,
|
|
25
25
|
badge,
|
|
26
|
+
badgeIcon,
|
|
26
27
|
icon,
|
|
27
28
|
component,
|
|
28
29
|
onClick,
|
|
@@ -45,9 +46,9 @@ export function NavbarItem(_ref) {
|
|
|
45
46
|
}), /*#__PURE__*/_jsx(NavbarLabel, {
|
|
46
47
|
id: uid,
|
|
47
48
|
children: label
|
|
48
|
-
}), badge != null && /*#__PURE__*/_jsx(NavbarBadge, {
|
|
49
|
+
}), badge != null && !badgeIcon && /*#__PURE__*/_jsx(NavbarBadge, {
|
|
49
50
|
"data-variant": variant,
|
|
50
51
|
children: badge
|
|
51
|
-
})]
|
|
52
|
+
}), badgeIcon]
|
|
52
53
|
});
|
|
53
54
|
}
|
|
@@ -15,7 +15,7 @@ var Header = /*#__PURE__*/styled.div.withConfig({
|
|
|
15
15
|
var Wrapper = /*#__PURE__*/styled.div.withConfig({
|
|
16
16
|
displayName: "NavbarList__Wrapper",
|
|
17
17
|
componentId: "SD__sc-19zrmxc-1"
|
|
18
|
-
})(["display:flex;flex:1;flex-direction:column;overflow:hidden;padding-top:16px;background:", ";transition:width 0.3s linear;height:100
|
|
18
|
+
})(["display:flex;flex:1;flex-direction:column;overflow:hidden;padding-top:16px;background:", ";transition:width 0.3s linear;height:100%;--_SdNavbar-width:", ";width:var(--_SdNavbar-width);&[data-expanded='true']{--_SdNavbar-width:", ";}&[data-expanded='false']{--_SdNavbar-width:", ";& > ", "{justify-content:center;}}"], _ref => {
|
|
19
19
|
var {
|
|
20
20
|
theme
|
|
21
21
|
} = _ref;
|
|
@@ -71,6 +71,10 @@ var Content = /*#__PURE__*/styled.div.withConfig({
|
|
|
71
71
|
displayName: "NavbarList__Content",
|
|
72
72
|
componentId: "SD__sc-19zrmxc-5"
|
|
73
73
|
})(["height:100%;min-height:50px;overflow-y:auto;overflow-x:hidden;&[aria-expanded='false']{", ",", "{display:none;}}&::-webkit-scrollbar{width:10px;height:10px;}&::-webkit-scrollbar-track{background-color:transparent;}&::-webkit-scrollbar-thumb{background-color:", ";border-radius:100vw;margin-bottom:100px;}"], NavbarBadge, NavbarLabel, ColorDark.Silver500);
|
|
74
|
+
var ContentInner = /*#__PURE__*/styled.div.withConfig({
|
|
75
|
+
displayName: "NavbarList__ContentInner",
|
|
76
|
+
componentId: "SD__sc-19zrmxc-6"
|
|
77
|
+
})(["width:var(--_SdNavbar-width);transition:width 0.3s linear;"]);
|
|
74
78
|
export function NavbarList(_ref6) {
|
|
75
79
|
var {
|
|
76
80
|
header,
|
|
@@ -107,28 +111,30 @@ export function NavbarList(_ref6) {
|
|
|
107
111
|
})]
|
|
108
112
|
}), /*#__PURE__*/_jsx(Content, {
|
|
109
113
|
"aria-expanded": isSidebarOpened,
|
|
110
|
-
children:
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
114
|
+
children: /*#__PURE__*/_jsx(ContentInner, {
|
|
115
|
+
children: filteredItems.map(item => {
|
|
116
|
+
var index = filteredItems.indexOf(item);
|
|
117
|
+
var prev = filteredItems[index - 1];
|
|
118
|
+
if ('items' in item) {
|
|
119
|
+
return /*#__PURE__*/_createElement(NavbarAccordion, _objectSpread(_objectSpread({}, item), {}, {
|
|
120
|
+
key: item.key,
|
|
121
|
+
gutter: prev && prev.groupKey !== item.groupKey,
|
|
122
|
+
onClick: item.onClick,
|
|
123
|
+
groupKey: item.groupKey || item.key
|
|
124
|
+
}));
|
|
125
|
+
}
|
|
126
|
+
return /*#__PURE__*/_createElement(NavbarItem, _objectSpread(_objectSpread({}, item), {}, {
|
|
115
127
|
key: item.key,
|
|
116
128
|
gutter: prev && prev.groupKey !== item.groupKey,
|
|
117
|
-
onClick:
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
gutter: prev && prev.groupKey !== item.groupKey,
|
|
124
|
-
onClick: event => {
|
|
125
|
-
var _item$onClick;
|
|
126
|
-
(_item$onClick = item.onClick) === null || _item$onClick === void 0 || _item$onClick.call(item, event);
|
|
127
|
-
if (!event.isDefaultPrevented()) {
|
|
128
|
-
setDrawerOpen(false);
|
|
129
|
+
onClick: event => {
|
|
130
|
+
var _item$onClick;
|
|
131
|
+
(_item$onClick = item.onClick) === null || _item$onClick === void 0 || _item$onClick.call(item, event);
|
|
132
|
+
if (!event.isDefaultPrevented()) {
|
|
133
|
+
setDrawerOpen(false);
|
|
134
|
+
}
|
|
129
135
|
}
|
|
130
|
-
}
|
|
131
|
-
})
|
|
136
|
+
}));
|
|
137
|
+
})
|
|
132
138
|
})
|
|
133
139
|
}), /*#__PURE__*/_jsx(Footer, {
|
|
134
140
|
children: footer
|
package/dist-types/index.d.ts
CHANGED
|
@@ -271,12 +271,13 @@ interface NavbarItemProps {
|
|
|
271
271
|
label: ReactNode;
|
|
272
272
|
icon?: ReactNode;
|
|
273
273
|
badge?: ReactNode;
|
|
274
|
+
badgeIcon?: ReactNode;
|
|
274
275
|
ident?: number;
|
|
275
276
|
gutter?: boolean;
|
|
276
277
|
variant?: 'danger' | 'primary';
|
|
277
278
|
active?: boolean;
|
|
278
279
|
}
|
|
279
|
-
declare function NavbarItem({ label, gutter, badge, icon, component, onClick, variant, ident, active, }: NavbarItemProps): ReactElement;
|
|
280
|
+
declare function NavbarItem({ label, gutter, badge, badgeIcon, icon, component, onClick, variant, ident, active, }: NavbarItemProps): ReactElement;
|
|
280
281
|
|
|
281
282
|
interface NavbarMenuItemProps {
|
|
282
283
|
icon?: ReactNode;
|
package/dist-web/index.js
CHANGED
|
@@ -1429,6 +1429,7 @@ function NavbarItem(_ref) {
|
|
|
1429
1429
|
label,
|
|
1430
1430
|
gutter,
|
|
1431
1431
|
badge,
|
|
1432
|
+
badgeIcon,
|
|
1432
1433
|
icon,
|
|
1433
1434
|
component,
|
|
1434
1435
|
onClick,
|
|
@@ -1451,10 +1452,10 @@ function NavbarItem(_ref) {
|
|
|
1451
1452
|
}), /*#__PURE__*/jsx(NavbarLabel, {
|
|
1452
1453
|
id: uid,
|
|
1453
1454
|
children: label
|
|
1454
|
-
}), badge != null && /*#__PURE__*/jsx(NavbarBadge, {
|
|
1455
|
+
}), badge != null && !badgeIcon && /*#__PURE__*/jsx(NavbarBadge, {
|
|
1455
1456
|
"data-variant": variant,
|
|
1456
1457
|
children: badge
|
|
1457
|
-
})]
|
|
1458
|
+
}), badgeIcon]
|
|
1458
1459
|
});
|
|
1459
1460
|
}
|
|
1460
1461
|
|
|
@@ -1474,7 +1475,7 @@ var NavbarAccordionRoot = /*#__PURE__*/styled(Accordion).withConfig({
|
|
|
1474
1475
|
var NavbarAccordionSummary = /*#__PURE__*/styled(AccordionSummary).withConfig({
|
|
1475
1476
|
displayName: "NavbarAccordion__NavbarAccordionSummary",
|
|
1476
1477
|
componentId: "SD__sc-1s7g3kw-2"
|
|
1477
|
-
})(["border-left:4px solid transparent;padding-left:20px;&.MuiAccordionSummary-root{max-height:40px;min-height:40px;}
|
|
1478
|
+
})(["border-left:4px solid transparent;padding-left:20px;&.MuiAccordionSummary-root,&.MuiAccordionSummary-root.Mui-expanded{max-height:40px;min-height:40px;}& .MuiAccordionSummary-content{align-items:center;}&:hover,&[aria-current],&[data-active='true']{color:", ";background-color:", ";border-left-color:", ";}&[data-expanded='false']{.MuiAccordionSummary-expandIcon{display:none;}}"], Color.White, Color.White10, ColorDynamic.Blue300);
|
|
1478
1479
|
var IconWrapper$2 = /*#__PURE__*/styled.div.withConfig({
|
|
1479
1480
|
displayName: "NavbarAccordion__IconWrapper",
|
|
1480
1481
|
componentId: "SD__sc-1s7g3kw-3"
|
|
@@ -1496,7 +1497,7 @@ function NavbarAccordion(_ref2) {
|
|
|
1496
1497
|
groupExpanded,
|
|
1497
1498
|
setGroupExpanded
|
|
1498
1499
|
} = useNavbarContext();
|
|
1499
|
-
var isExpanded = (_groupExpanded$groupK = groupExpanded[groupKey]) !== null && _groupExpanded$groupK !== void 0 ? _groupExpanded$groupK : true;
|
|
1500
|
+
var isExpanded = isNavbarExpanded ? (_groupExpanded$groupK = groupExpanded[groupKey]) !== null && _groupExpanded$groupK !== void 0 ? _groupExpanded$groupK : true : false;
|
|
1500
1501
|
var filteredItems = useMemo(() => items.filter(item => !item.hide), [items]);
|
|
1501
1502
|
return /*#__PURE__*/jsxs(NavbarAccordionRoot, {
|
|
1502
1503
|
square: true,
|
|
@@ -1551,7 +1552,7 @@ var Header = /*#__PURE__*/styled.div.withConfig({
|
|
|
1551
1552
|
var Wrapper = /*#__PURE__*/styled.div.withConfig({
|
|
1552
1553
|
displayName: "NavbarList__Wrapper",
|
|
1553
1554
|
componentId: "SD__sc-19zrmxc-1"
|
|
1554
|
-
})(["display:flex;flex:1;flex-direction:column;overflow:hidden;padding-top:16px;background:", ";transition:width 0.3s linear;height:100
|
|
1555
|
+
})(["display:flex;flex:1;flex-direction:column;overflow:hidden;padding-top:16px;background:", ";transition:width 0.3s linear;height:100%;--_SdNavbar-width:", ";width:var(--_SdNavbar-width);&[data-expanded='true']{--_SdNavbar-width:", ";}&[data-expanded='false']{--_SdNavbar-width:", ";& > ", "{justify-content:center;}}"], _ref => {
|
|
1555
1556
|
var {
|
|
1556
1557
|
theme
|
|
1557
1558
|
} = _ref;
|
|
@@ -1607,6 +1608,10 @@ var Content$1 = /*#__PURE__*/styled.div.withConfig({
|
|
|
1607
1608
|
displayName: "NavbarList__Content",
|
|
1608
1609
|
componentId: "SD__sc-19zrmxc-5"
|
|
1609
1610
|
})(["height:100%;min-height:50px;overflow-y:auto;overflow-x:hidden;&[aria-expanded='false']{", ",", "{display:none;}}&::-webkit-scrollbar{width:10px;height:10px;}&::-webkit-scrollbar-track{background-color:transparent;}&::-webkit-scrollbar-thumb{background-color:", ";border-radius:100vw;margin-bottom:100px;}"], NavbarBadge, NavbarLabel, ColorDark.Silver500);
|
|
1611
|
+
var ContentInner = /*#__PURE__*/styled.div.withConfig({
|
|
1612
|
+
displayName: "NavbarList__ContentInner",
|
|
1613
|
+
componentId: "SD__sc-19zrmxc-6"
|
|
1614
|
+
})(["width:var(--_SdNavbar-width);transition:width 0.3s linear;"]);
|
|
1610
1615
|
function NavbarList(_ref6) {
|
|
1611
1616
|
var {
|
|
1612
1617
|
header,
|
|
@@ -1643,28 +1648,30 @@ function NavbarList(_ref6) {
|
|
|
1643
1648
|
})]
|
|
1644
1649
|
}), /*#__PURE__*/jsx(Content$1, {
|
|
1645
1650
|
"aria-expanded": isSidebarOpened,
|
|
1646
|
-
children:
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
+
children: /*#__PURE__*/jsx(ContentInner, {
|
|
1652
|
+
children: filteredItems.map(item => {
|
|
1653
|
+
var index = filteredItems.indexOf(item);
|
|
1654
|
+
var prev = filteredItems[index - 1];
|
|
1655
|
+
if ('items' in item) {
|
|
1656
|
+
return /*#__PURE__*/createElement(NavbarAccordion, _objectSpread(_objectSpread({}, item), {}, {
|
|
1657
|
+
key: item.key,
|
|
1658
|
+
gutter: prev && prev.groupKey !== item.groupKey,
|
|
1659
|
+
onClick: item.onClick,
|
|
1660
|
+
groupKey: item.groupKey || item.key
|
|
1661
|
+
}));
|
|
1662
|
+
}
|
|
1663
|
+
return /*#__PURE__*/createElement(NavbarItem, _objectSpread(_objectSpread({}, item), {}, {
|
|
1651
1664
|
key: item.key,
|
|
1652
1665
|
gutter: prev && prev.groupKey !== item.groupKey,
|
|
1653
|
-
onClick:
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
gutter: prev && prev.groupKey !== item.groupKey,
|
|
1660
|
-
onClick: event => {
|
|
1661
|
-
var _item$onClick;
|
|
1662
|
-
(_item$onClick = item.onClick) === null || _item$onClick === void 0 || _item$onClick.call(item, event);
|
|
1663
|
-
if (!event.isDefaultPrevented()) {
|
|
1664
|
-
setDrawerOpen(false);
|
|
1666
|
+
onClick: event => {
|
|
1667
|
+
var _item$onClick;
|
|
1668
|
+
(_item$onClick = item.onClick) === null || _item$onClick === void 0 || _item$onClick.call(item, event);
|
|
1669
|
+
if (!event.isDefaultPrevented()) {
|
|
1670
|
+
setDrawerOpen(false);
|
|
1671
|
+
}
|
|
1665
1672
|
}
|
|
1666
|
-
}
|
|
1667
|
-
})
|
|
1673
|
+
}));
|
|
1674
|
+
})
|
|
1668
1675
|
})
|
|
1669
1676
|
}), /*#__PURE__*/jsx(Footer, {
|
|
1670
1677
|
children: footer
|