orcs-design-system 3.3.69 → 3.3.71
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.
|
@@ -47,7 +47,9 @@ const SideNavV2 = _ref => {
|
|
|
47
47
|
yourTeams,
|
|
48
48
|
pinnedItems,
|
|
49
49
|
startExpanded,
|
|
50
|
-
onKeepExpandedChange
|
|
50
|
+
onKeepExpandedChange,
|
|
51
|
+
renderTeamsSection,
|
|
52
|
+
renderPinnedSection
|
|
51
53
|
} = _ref;
|
|
52
54
|
const {
|
|
53
55
|
expandedItem,
|
|
@@ -111,13 +113,19 @@ const SideNavV2 = _ref => {
|
|
|
111
113
|
handleItemClick: handleItemClick,
|
|
112
114
|
navItemRefs: navItemRefs,
|
|
113
115
|
showDivider: true
|
|
114
|
-
}), /*#__PURE__*/_jsx(CurrentViewSectionPortalTarget, {}), yourTeams && yourTeams.length > 0 &&
|
|
116
|
+
}), /*#__PURE__*/_jsx(CurrentViewSectionPortalTarget, {}), yourTeams && yourTeams.length > 0 && (renderTeamsSection ? renderTeamsSection({
|
|
117
|
+
teams: yourTeams,
|
|
118
|
+
isExpanded
|
|
119
|
+
}) : /*#__PURE__*/_jsx(SideNavTeamsSection, {
|
|
115
120
|
teams: yourTeams,
|
|
116
121
|
isExpanded: isExpanded
|
|
117
|
-
}), pinnedItems && pinnedItems.length > 0 &&
|
|
122
|
+
})), pinnedItems && pinnedItems.length > 0 && (renderPinnedSection ? renderPinnedSection({
|
|
123
|
+
items: pinnedItems,
|
|
124
|
+
isExpanded
|
|
125
|
+
}) : /*#__PURE__*/_jsx(SideNavPinnedSection, {
|
|
118
126
|
items: pinnedItems,
|
|
119
127
|
isExpanded: isExpanded
|
|
120
|
-
}), /*#__PURE__*/_jsx(ItemSection, {
|
|
128
|
+
})), /*#__PURE__*/_jsx(ItemSection, {
|
|
121
129
|
items: bottomAlignedItems,
|
|
122
130
|
isExpanded: isExpanded,
|
|
123
131
|
isSmallScreen: isSmallScreen,
|
|
@@ -188,7 +196,9 @@ SideNavV2.propTypes = {
|
|
|
188
196
|
onUnpin: PropTypes.func
|
|
189
197
|
})),
|
|
190
198
|
startExpanded: PropTypes.bool,
|
|
191
|
-
onKeepExpandedChange: PropTypes.func
|
|
199
|
+
onKeepExpandedChange: PropTypes.func,
|
|
200
|
+
renderTeamsSection: PropTypes.func,
|
|
201
|
+
renderPinnedSection: PropTypes.func
|
|
192
202
|
};
|
|
193
203
|
SideNavV2.__docgenInfo = {
|
|
194
204
|
"description": "SideNavV2 - A responsive side navigation component with expandable panels\n\nFeatures:\n- Responsive design that adapts to mobile and desktop\n- Expandable panels with resizable functionality\n- Hover-based auto-expansion (when enabled)\n- Team and pinned item sections\n- Current view section portal integration\n\n@param {Object} props - Component props\n@param {Array} props.items - Navigation items to display\n@param {string} props.sideNavHeight - Height of the side navigation\n@param {Array} [props.yourTeams] - Teams to display in the teams section\n@param {Array} [props.pinnedItems] - Pinned items to display\n@param {boolean} [props.startExpanded] - Whether the sidebar should start expanded\n@param {(keepExpanded: boolean) => void} [props.onKeepExpandedChange] - Callback when the sidebar is locked open or unlocked\n@returns {JSX.Element} Rendered side navigation",
|
|
@@ -358,6 +368,20 @@ SideNavV2.__docgenInfo = {
|
|
|
358
368
|
"name": "func"
|
|
359
369
|
},
|
|
360
370
|
"required": false
|
|
371
|
+
},
|
|
372
|
+
"renderTeamsSection": {
|
|
373
|
+
"description": "",
|
|
374
|
+
"type": {
|
|
375
|
+
"name": "func"
|
|
376
|
+
},
|
|
377
|
+
"required": false
|
|
378
|
+
},
|
|
379
|
+
"renderPinnedSection": {
|
|
380
|
+
"description": "",
|
|
381
|
+
"type": {
|
|
382
|
+
"name": "func"
|
|
383
|
+
},
|
|
384
|
+
"required": false
|
|
361
385
|
}
|
|
362
386
|
}
|
|
363
387
|
};
|
|
@@ -12,7 +12,80 @@ import Flex from "../Flex";
|
|
|
12
12
|
import Spacer from "../Spacer/index";
|
|
13
13
|
import Card from "../Card/index";
|
|
14
14
|
import RenderCurrentViewSection from "./components/RenderCurrentViewSection";
|
|
15
|
+
import Badge from "../Badge";
|
|
16
|
+
import Popover from "../Popover";
|
|
17
|
+
import BaseSection, { AvatarLink, Item } from "./components/BaseSection";
|
|
18
|
+
import Icon from "../Icon";
|
|
19
|
+
import Button from "../Button";
|
|
20
|
+
import Avatar from "../Avatar";
|
|
21
|
+
import styled from "styled-components";
|
|
22
|
+
import themeGet from "@styled-system/theme-get";
|
|
23
|
+
import { variant } from "styled-system";
|
|
24
|
+
|
|
25
|
+
// Team type bar component for visual indicator
|
|
26
|
+
// Uses styled-system variant to map badge variants to background colors
|
|
15
27
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
28
|
+
const TeamTypeBar = /*#__PURE__*/styled.div.withConfig({
|
|
29
|
+
displayName: "TeamTypeBar",
|
|
30
|
+
componentId: "sc-6cqkwa-0"
|
|
31
|
+
})(["width:4px;height:20px;margin-left:2px;flex-shrink:0;border-radius:2px;", ""], variant({
|
|
32
|
+
prop: "badgeVariant",
|
|
33
|
+
variants: {
|
|
34
|
+
success: {
|
|
35
|
+
bg: "successLightest"
|
|
36
|
+
},
|
|
37
|
+
successPending: {
|
|
38
|
+
bg: "successEvenLighter"
|
|
39
|
+
},
|
|
40
|
+
warning: {
|
|
41
|
+
bg: "warningLightest"
|
|
42
|
+
},
|
|
43
|
+
danger: {
|
|
44
|
+
bg: "dangerLightest"
|
|
45
|
+
},
|
|
46
|
+
primaryLight: {
|
|
47
|
+
bg: "primaryLightest"
|
|
48
|
+
},
|
|
49
|
+
primary: {
|
|
50
|
+
bg: "primaryLighter"
|
|
51
|
+
},
|
|
52
|
+
primaryDark: {
|
|
53
|
+
bg: "primaryLight"
|
|
54
|
+
},
|
|
55
|
+
secondary: {
|
|
56
|
+
bg: "secondaryEvenLighter"
|
|
57
|
+
},
|
|
58
|
+
default: {
|
|
59
|
+
bg: "secondary"
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}));
|
|
63
|
+
const BarSpacer = /*#__PURE__*/styled.div.withConfig({
|
|
64
|
+
displayName: "BarSpacer",
|
|
65
|
+
componentId: "sc-6cqkwa-1"
|
|
66
|
+
})(["width:6px;flex-shrink:0;"]);
|
|
67
|
+
|
|
68
|
+
// Expanded row wrapper with active/hover states
|
|
69
|
+
const ExpandedRowWrapper = /*#__PURE__*/styled(Flex).withConfig({
|
|
70
|
+
displayName: "ExpandedRowWrapper",
|
|
71
|
+
componentId: "sc-6cqkwa-2"
|
|
72
|
+
})(["width:100%;padding:", " ", ";border-radius:", ";transition:", ";&.active{background-color:", ";}&:hover:not(.active){background-color:", ";}"], props => themeGet("space.xxs")(props), props => props.theme.space.xs, props => props.theme.radii[2], props => props.theme.transition.transitionDefault, props => props.theme.colors.primaryLightest, props => props.theme.colors.greyLightest);
|
|
73
|
+
const ItemName = /*#__PURE__*/styled.span.withConfig({
|
|
74
|
+
displayName: "ItemName",
|
|
75
|
+
componentId: "sc-6cqkwa-3"
|
|
76
|
+
})(["font-size:", ";display:inline;"], props => themeGet("fontSizes.1")(props));
|
|
77
|
+
const StyledBadge = /*#__PURE__*/styled(Badge).withConfig({
|
|
78
|
+
displayName: "StyledBadge",
|
|
79
|
+
componentId: "sc-6cqkwa-4"
|
|
80
|
+
})(["flex-shrink:0;font-size:", ";padding:", " ", ";line-height:1.2;"], props => themeGet("fontSizes.0")(props), props => themeGet("space.xxs")(props), props => themeGet("space.xs")(props));
|
|
81
|
+
const StyledLink = /*#__PURE__*/styled(Link).withConfig({
|
|
82
|
+
displayName: "StyledLink",
|
|
83
|
+
componentId: "sc-6cqkwa-5"
|
|
84
|
+
})(["flex:1;min-width:0;max-width:100%;display:flex;align-items:center;gap:", ";overflow:hidden;text-decoration:none;color:inherit;"], props => themeGet("space.xs")(props));
|
|
85
|
+
const StyledPopover = /*#__PURE__*/styled(Popover).withConfig({
|
|
86
|
+
displayName: "StyledPopover",
|
|
87
|
+
componentId: "sc-6cqkwa-6"
|
|
88
|
+
})(["margin-left:auto;padding-left:", ";"], props => themeGet("space.xs")(props));
|
|
16
89
|
library.add(far, fas);
|
|
17
90
|
export default {
|
|
18
91
|
title: "Components/SideNavV2",
|
|
@@ -182,34 +255,297 @@ const PageCard = _ref2 => {
|
|
|
182
255
|
})
|
|
183
256
|
});
|
|
184
257
|
};
|
|
185
|
-
const
|
|
258
|
+
const yourTeamsWithTypes = [{
|
|
186
259
|
avatar: "https://plus.unsplash.com/premium_photo-1690571200236-0f9098fc6ca9?w=900&auto=format&fit=crop&q=60&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxzZWFyY2h8MXx8YmxhY2tob2xlfGVufDB8fDB8fHww",
|
|
187
260
|
name: "Blackhole",
|
|
188
|
-
link: "/teams/blackhole/overview"
|
|
261
|
+
link: "/teams/blackhole/overview",
|
|
262
|
+
type: "Chapter",
|
|
263
|
+
badgeVariant: "primaryDark",
|
|
264
|
+
// Purple/pink color
|
|
265
|
+
id: "blackhole"
|
|
189
266
|
}, {
|
|
190
267
|
avatar: "https://images.unsplash.com/photo-1602576666092-bf6447a729fc?w=900&auto=format&fit=crop&q=60&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxzZWFyY2h8Mnx8dWklMjBkZXNpZ258ZW58MHx8MHx8fDA%3D",
|
|
191
268
|
name: "Design",
|
|
192
|
-
link: "/teams/design/overview"
|
|
269
|
+
link: "/teams/design/overview",
|
|
270
|
+
type: "Agile Group",
|
|
271
|
+
badgeVariant: "success",
|
|
272
|
+
// Green color
|
|
273
|
+
id: "design"
|
|
274
|
+
}, {
|
|
275
|
+
avatar: "https://images.unsplash.com/photo-1515879218367-8466d910aaa4?w=900&auto=format&fit=crop&q=60&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxzZWFyY2h8Mnx8Y29kZXxlbnwwfHwwfHx8MA%3D%3D",
|
|
276
|
+
name: "Engineering",
|
|
277
|
+
link: "/teams/engineering/overview",
|
|
278
|
+
type: "Chapter Area",
|
|
279
|
+
badgeVariant: "primary",
|
|
280
|
+
// Blue/purple color
|
|
281
|
+
id: "engineering"
|
|
193
282
|
}];
|
|
194
|
-
const
|
|
283
|
+
const pinnedItemsWithTypes = [{
|
|
195
284
|
avatar: "https://images.unsplash.com/photo-1515879218367-8466d910aaa4?w=900&auto=format&fit=crop&q=60&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxzZWFyY2h8Mnx8Y29kZXxlbnwwfHwwfHx8MA%3D%3D",
|
|
196
285
|
name: "Engineering",
|
|
197
286
|
link: "/teams/engineering/overview",
|
|
198
287
|
shape: "square",
|
|
288
|
+
type: "Chapter",
|
|
289
|
+
badgeVariant: "primaryDark",
|
|
290
|
+
// Purple/pink color
|
|
291
|
+
entityType: "team",
|
|
292
|
+
id: "engineering",
|
|
199
293
|
onUnpin: action("unpin-engineering")
|
|
200
294
|
}, {
|
|
201
295
|
avatar: "https://images.unsplash.com/photo-1556741533-e228ee50f8b8?w=900&auto=format&fit=crop&q=60&ixlib=rb-4.1.0&ixid=M3wxMjA3fDF8MHxzZWFyY2h8MXx8Y3VzdG9tZXJ8ZW58MHx8MHx8fDA%3D",
|
|
202
296
|
name: "Customer Journey",
|
|
203
297
|
link: "/pinned/new-account",
|
|
204
298
|
shape: "hexagon",
|
|
299
|
+
type: "Agile Group",
|
|
300
|
+
badgeVariant: "success",
|
|
301
|
+
// Green color
|
|
302
|
+
entityType: "team",
|
|
303
|
+
id: "customer-journey",
|
|
205
304
|
onUnpin: action("unpin-customer-journey")
|
|
206
305
|
}, {
|
|
207
306
|
avatar: "https://randomuser.me/api/portraits/men/24.jpg",
|
|
208
307
|
name: "James Merrit",
|
|
209
308
|
link: "/people/james-merrit/details",
|
|
210
309
|
onUnpin: action("unpin-james-merrit"),
|
|
211
|
-
shape: "circle"
|
|
310
|
+
shape: "circle",
|
|
311
|
+
entityType: "person"
|
|
212
312
|
}];
|
|
313
|
+
|
|
314
|
+
// Example custom section components with team type bars
|
|
315
|
+
const TeamsSectionWithBadges = _ref3 => {
|
|
316
|
+
let {
|
|
317
|
+
teams,
|
|
318
|
+
isExpanded
|
|
319
|
+
} = _ref3;
|
|
320
|
+
const renderTeamItem = (team, expanded) => {
|
|
321
|
+
const {
|
|
322
|
+
avatar,
|
|
323
|
+
name,
|
|
324
|
+
link,
|
|
325
|
+
gradient,
|
|
326
|
+
type,
|
|
327
|
+
badgeVariant = "success"
|
|
328
|
+
} = team;
|
|
329
|
+
if (!name || !link) {
|
|
330
|
+
return null;
|
|
331
|
+
}
|
|
332
|
+
const hasTeamType = Boolean(type);
|
|
333
|
+
return /*#__PURE__*/_jsx(Item, {
|
|
334
|
+
isExpanded: expanded,
|
|
335
|
+
children: expanded ? /*#__PURE__*/_jsxs(ExpandedRowWrapper, {
|
|
336
|
+
alignItems: "center",
|
|
337
|
+
gap: "xs",
|
|
338
|
+
flex: "1",
|
|
339
|
+
style: {
|
|
340
|
+
minWidth: 0,
|
|
341
|
+
width: "100%"
|
|
342
|
+
},
|
|
343
|
+
children: [/*#__PURE__*/_jsx(Avatar, {
|
|
344
|
+
image: avatar,
|
|
345
|
+
customSize: "24px",
|
|
346
|
+
shape: "square",
|
|
347
|
+
gradient: gradient
|
|
348
|
+
}), hasTeamType && /*#__PURE__*/_jsx(TeamTypeBar, {
|
|
349
|
+
badgeVariant: badgeVariant
|
|
350
|
+
}), /*#__PURE__*/_jsx(Popover, {
|
|
351
|
+
text: /*#__PURE__*/_jsxs(Flex, {
|
|
352
|
+
flexDirection: "row",
|
|
353
|
+
flexWrap: "wrap",
|
|
354
|
+
gap: "xs",
|
|
355
|
+
alignItems: "center",
|
|
356
|
+
children: [/*#__PURE__*/_jsx("span", {
|
|
357
|
+
children: name
|
|
358
|
+
}), hasTeamType && /*#__PURE__*/_jsx(StyledBadge, {
|
|
359
|
+
variant: badgeVariant,
|
|
360
|
+
children: type
|
|
361
|
+
})]
|
|
362
|
+
}),
|
|
363
|
+
direction: "right",
|
|
364
|
+
width: "fit-content",
|
|
365
|
+
children: /*#__PURE__*/_jsx(StyledLink, {
|
|
366
|
+
to: link || "#",
|
|
367
|
+
"aria-label": name,
|
|
368
|
+
children: /*#__PURE__*/_jsx(ItemName, {
|
|
369
|
+
children: name
|
|
370
|
+
})
|
|
371
|
+
})
|
|
372
|
+
})]
|
|
373
|
+
}) : /*#__PURE__*/_jsx(Popover, {
|
|
374
|
+
text: /*#__PURE__*/_jsxs(Flex, {
|
|
375
|
+
flexDirection: "row",
|
|
376
|
+
flexWrap: "wrap",
|
|
377
|
+
gap: "xs",
|
|
378
|
+
alignItems: "center",
|
|
379
|
+
children: [/*#__PURE__*/_jsx("span", {
|
|
380
|
+
children: name
|
|
381
|
+
}), hasTeamType && /*#__PURE__*/_jsx(Badge, {
|
|
382
|
+
variant: badgeVariant,
|
|
383
|
+
style: {
|
|
384
|
+
flexShrink: 0,
|
|
385
|
+
fontSize: "11px",
|
|
386
|
+
padding: "2px 6px",
|
|
387
|
+
lineHeight: "1.2"
|
|
388
|
+
},
|
|
389
|
+
children: type
|
|
390
|
+
})]
|
|
391
|
+
}),
|
|
392
|
+
direction: "right",
|
|
393
|
+
width: "fit-content",
|
|
394
|
+
children: /*#__PURE__*/_jsxs(Flex, {
|
|
395
|
+
alignItems: "center",
|
|
396
|
+
gap: "xs",
|
|
397
|
+
children: [/*#__PURE__*/_jsx(AvatarLink, {
|
|
398
|
+
avatar: avatar,
|
|
399
|
+
name: name,
|
|
400
|
+
link: link,
|
|
401
|
+
shape: "square",
|
|
402
|
+
showName: false,
|
|
403
|
+
gradient: gradient
|
|
404
|
+
}), hasTeamType && /*#__PURE__*/_jsx(TeamTypeBar, {
|
|
405
|
+
badgeVariant: badgeVariant
|
|
406
|
+
})]
|
|
407
|
+
})
|
|
408
|
+
})
|
|
409
|
+
}, name);
|
|
410
|
+
};
|
|
411
|
+
return /*#__PURE__*/_jsx(BaseSection, {
|
|
412
|
+
title: "My Teams",
|
|
413
|
+
items: teams || [],
|
|
414
|
+
isExpanded: isExpanded,
|
|
415
|
+
renderItem: renderTeamItem
|
|
416
|
+
});
|
|
417
|
+
};
|
|
418
|
+
const PinnedSectionWithBadges = _ref4 => {
|
|
419
|
+
let {
|
|
420
|
+
items,
|
|
421
|
+
isExpanded
|
|
422
|
+
} = _ref4;
|
|
423
|
+
const renderPinnedItem = (item, expanded) => {
|
|
424
|
+
const {
|
|
425
|
+
avatar,
|
|
426
|
+
name,
|
|
427
|
+
link,
|
|
428
|
+
shape,
|
|
429
|
+
onUnpin,
|
|
430
|
+
gradient,
|
|
431
|
+
type,
|
|
432
|
+
entityType,
|
|
433
|
+
badgeVariant = "success"
|
|
434
|
+
} = item;
|
|
435
|
+
if (!name || !link) {
|
|
436
|
+
return null;
|
|
437
|
+
}
|
|
438
|
+
const showTeamType = entityType === "team" && type;
|
|
439
|
+
return /*#__PURE__*/_jsx(Item, {
|
|
440
|
+
isExpanded: expanded,
|
|
441
|
+
alignRight: !expanded && showTeamType,
|
|
442
|
+
children: expanded ? /*#__PURE__*/_jsxs(ExpandedRowWrapper, {
|
|
443
|
+
alignItems: "center",
|
|
444
|
+
gap: "xs",
|
|
445
|
+
flex: "1",
|
|
446
|
+
style: {
|
|
447
|
+
minWidth: 0,
|
|
448
|
+
width: "100%"
|
|
449
|
+
},
|
|
450
|
+
children: [/*#__PURE__*/_jsx(Avatar, {
|
|
451
|
+
image: avatar,
|
|
452
|
+
customSize: "24px",
|
|
453
|
+
shape: shape,
|
|
454
|
+
gradient: gradient
|
|
455
|
+
}), showTeamType ? /*#__PURE__*/_jsx(TeamTypeBar, {
|
|
456
|
+
badgeVariant: badgeVariant
|
|
457
|
+
}) : /*#__PURE__*/_jsx(BarSpacer, {}), /*#__PURE__*/_jsx(Popover, {
|
|
458
|
+
text: /*#__PURE__*/_jsxs(Flex, {
|
|
459
|
+
flexDirection: "row",
|
|
460
|
+
flexWrap: "wrap",
|
|
461
|
+
gap: "xs",
|
|
462
|
+
alignItems: "center",
|
|
463
|
+
children: [/*#__PURE__*/_jsx("span", {
|
|
464
|
+
children: name
|
|
465
|
+
}), showTeamType && /*#__PURE__*/_jsx(Badge, {
|
|
466
|
+
variant: badgeVariant,
|
|
467
|
+
style: {
|
|
468
|
+
flexShrink: 0,
|
|
469
|
+
fontSize: "11px",
|
|
470
|
+
padding: "2px 6px",
|
|
471
|
+
lineHeight: "1.2"
|
|
472
|
+
},
|
|
473
|
+
children: type
|
|
474
|
+
})]
|
|
475
|
+
}),
|
|
476
|
+
direction: "right",
|
|
477
|
+
width: "fit-content",
|
|
478
|
+
children: /*#__PURE__*/_jsx(StyledLink, {
|
|
479
|
+
to: link || "#",
|
|
480
|
+
"aria-label": name,
|
|
481
|
+
children: /*#__PURE__*/_jsx(ItemName, {
|
|
482
|
+
children: name
|
|
483
|
+
})
|
|
484
|
+
})
|
|
485
|
+
}), /*#__PURE__*/_jsx(StyledPopover, {
|
|
486
|
+
text: "Unpin item",
|
|
487
|
+
direction: "right",
|
|
488
|
+
width: "fit-content",
|
|
489
|
+
tabIndex: "-1",
|
|
490
|
+
children: /*#__PURE__*/_jsx(Button, {
|
|
491
|
+
height: "20px",
|
|
492
|
+
width: "20px",
|
|
493
|
+
borderRadius: "20px",
|
|
494
|
+
variant: "borderGrey",
|
|
495
|
+
borderColor: "white",
|
|
496
|
+
onClick: () => onUnpin?.(item),
|
|
497
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
498
|
+
icon: ["fas", "thumbtack"],
|
|
499
|
+
color: "greyDarkest",
|
|
500
|
+
size: "sm"
|
|
501
|
+
})
|
|
502
|
+
})
|
|
503
|
+
})]
|
|
504
|
+
}) : /*#__PURE__*/_jsx(Popover, {
|
|
505
|
+
text: /*#__PURE__*/_jsxs(Flex, {
|
|
506
|
+
flexDirection: "row",
|
|
507
|
+
flexWrap: "wrap",
|
|
508
|
+
gap: "xs",
|
|
509
|
+
alignItems: "center",
|
|
510
|
+
children: [/*#__PURE__*/_jsx("span", {
|
|
511
|
+
children: name
|
|
512
|
+
}), showTeamType && /*#__PURE__*/_jsx(Badge, {
|
|
513
|
+
variant: badgeVariant,
|
|
514
|
+
style: {
|
|
515
|
+
flexShrink: 0,
|
|
516
|
+
fontSize: "11px",
|
|
517
|
+
padding: "2px 6px",
|
|
518
|
+
lineHeight: "1.2"
|
|
519
|
+
},
|
|
520
|
+
children: type
|
|
521
|
+
})]
|
|
522
|
+
}),
|
|
523
|
+
direction: "right",
|
|
524
|
+
width: "fit-content",
|
|
525
|
+
children: /*#__PURE__*/_jsxs(Flex, {
|
|
526
|
+
alignItems: "center",
|
|
527
|
+
gap: "xs",
|
|
528
|
+
children: [/*#__PURE__*/_jsx(AvatarLink, {
|
|
529
|
+
avatar: avatar,
|
|
530
|
+
name: name,
|
|
531
|
+
link: link,
|
|
532
|
+
shape: shape,
|
|
533
|
+
showName: false,
|
|
534
|
+
gradient: gradient
|
|
535
|
+
}), showTeamType && /*#__PURE__*/_jsx(TeamTypeBar, {
|
|
536
|
+
badgeVariant: badgeVariant
|
|
537
|
+
})]
|
|
538
|
+
})
|
|
539
|
+
})
|
|
540
|
+
}, name);
|
|
541
|
+
};
|
|
542
|
+
return /*#__PURE__*/_jsx(BaseSection, {
|
|
543
|
+
title: "Pinned",
|
|
544
|
+
items: items || [],
|
|
545
|
+
isExpanded: isExpanded,
|
|
546
|
+
renderItem: renderPinnedItem
|
|
547
|
+
});
|
|
548
|
+
};
|
|
213
549
|
const SideBarWithConfig = () => {
|
|
214
550
|
const location = useLocation();
|
|
215
551
|
const items = [{
|
|
@@ -321,10 +657,30 @@ const SideBarWithConfig = () => {
|
|
|
321
657
|
children: /*#__PURE__*/_jsxs(SideNavStateProvider, {
|
|
322
658
|
children: [/*#__PURE__*/_jsx(SideNavV2, {
|
|
323
659
|
items: items,
|
|
324
|
-
yourTeams:
|
|
325
|
-
pinnedItems:
|
|
660
|
+
yourTeams: yourTeamsWithTypes,
|
|
661
|
+
pinnedItems: pinnedItemsWithTypes,
|
|
326
662
|
sideNavHeight: "100vh",
|
|
327
|
-
startExpanded: true
|
|
663
|
+
startExpanded: true,
|
|
664
|
+
renderTeamsSection: _ref5 => {
|
|
665
|
+
let {
|
|
666
|
+
teams,
|
|
667
|
+
isExpanded
|
|
668
|
+
} = _ref5;
|
|
669
|
+
return /*#__PURE__*/_jsx(TeamsSectionWithBadges, {
|
|
670
|
+
teams: teams,
|
|
671
|
+
isExpanded: isExpanded
|
|
672
|
+
});
|
|
673
|
+
},
|
|
674
|
+
renderPinnedSection: _ref6 => {
|
|
675
|
+
let {
|
|
676
|
+
items: pinned,
|
|
677
|
+
isExpanded
|
|
678
|
+
} = _ref6;
|
|
679
|
+
return /*#__PURE__*/_jsx(PinnedSectionWithBadges, {
|
|
680
|
+
items: pinned,
|
|
681
|
+
isExpanded: isExpanded
|
|
682
|
+
});
|
|
683
|
+
}
|
|
328
684
|
}), /*#__PURE__*/_jsxs(Switch, {
|
|
329
685
|
children: [/*#__PURE__*/_jsx(Route, {
|
|
330
686
|
exact: true,
|
|
@@ -11,7 +11,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
11
11
|
const ItemList = /*#__PURE__*/styled.ul.withConfig({
|
|
12
12
|
displayName: "ItemList",
|
|
13
13
|
componentId: "sc-1y67u5l-0"
|
|
14
|
-
})(["list-style:none;padding:0;margin:0;align-items:", ";text-align:", ";display:flex;flex-direction:column;gap:", ";"], props => props.isExpanded ? "flex-start" : "center", props => props.isExpanded ? "left" : "center", props => themeGet("space.
|
|
14
|
+
})(["list-style:none;padding:0;margin:0;align-items:", ";text-align:", ";display:flex;flex-direction:column;gap:", ";"], props => props.isExpanded ? "flex-start" : "center", props => props.isExpanded ? "left" : "center", props => themeGet("space.xs")(props));
|
|
15
15
|
const ItemName = /*#__PURE__*/styled.span.withConfig({
|
|
16
16
|
displayName: "ItemName",
|
|
17
17
|
componentId: "sc-1y67u5l-1"
|
|
@@ -19,7 +19,17 @@ const ItemName = /*#__PURE__*/styled.span.withConfig({
|
|
|
19
19
|
export const Item = /*#__PURE__*/styled.li.withConfig({
|
|
20
20
|
displayName: "Item",
|
|
21
21
|
componentId: "sc-1y67u5l-2"
|
|
22
|
-
})(["display:flex;width:100%;gap:", ";justify-content:
|
|
22
|
+
})(["display:flex;width:100%;gap:", ";justify-content:", ";align-items:center;a{display:flex;gap:8px;align-items:center;font-size:", ";text-decoration:none;color:", ";padding:", ";border-radius:", ";flex:1;transition:", ";&:hover,&:focus{outline:none;color:", ";}&.active{background-color:", ";color:", ";}}"], props => themeGet("space.xs")(props), props => {
|
|
23
|
+
if (props.isExpanded) {
|
|
24
|
+
return "space-between";
|
|
25
|
+
}
|
|
26
|
+
// When collapsed, pinned items should be right-aligned, teams should be centered
|
|
27
|
+
// Only apply flex-end if alignRight is explicitly true
|
|
28
|
+
if (props.alignRight) {
|
|
29
|
+
return "flex-end";
|
|
30
|
+
}
|
|
31
|
+
return "center";
|
|
32
|
+
}, props => themeGet("fontSizes.1")(props), props => themeGet("colors.greyDarkest")(props), props => themeGet("space.xs")(props), props => themeGet("radii.2")(props), props => themeGet("transition.transitionDefault")(props), props => themeGet("colors.primary")(props), props => themeGet("colors.primaryLightest")(props), props => themeGet("colors.greyDarkest")(props));
|
|
23
33
|
export const AvatarLink = _ref => {
|
|
24
34
|
let {
|
|
25
35
|
avatar,
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "orcs-design-system",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.71",
|
|
4
4
|
"engines": {
|
|
5
|
-
"node": "
|
|
5
|
+
"node": ">=20.0.0"
|
|
6
6
|
},
|
|
7
7
|
"description": "TeamForm's Design System, aka: ORCS",
|
|
8
8
|
"keywords": [
|
|
@@ -47,15 +47,15 @@
|
|
|
47
47
|
"@emotion/react": "^11.11.4",
|
|
48
48
|
"@emotion/styled": "^11.11.5",
|
|
49
49
|
"@floating-ui/react": "^0.26.19",
|
|
50
|
-
"@mui/icons-material": "^5.
|
|
51
|
-
"@mui/material": "^5.
|
|
52
|
-
"@mui/x-date-pickers": "^
|
|
50
|
+
"@mui/icons-material": "^6.5.0",
|
|
51
|
+
"@mui/material": "^6.5.0",
|
|
52
|
+
"@mui/x-date-pickers": "^8.16.0",
|
|
53
53
|
"@styled-system/css": "^5.1.5",
|
|
54
54
|
"@styled-system/prop-types": "^5.1.5",
|
|
55
55
|
"@styled-system/should-forward-prop": "^5.1.5",
|
|
56
56
|
"@styled-system/theme-get": "^5.1.2",
|
|
57
57
|
"focus-trap-react": "^10.2.3",
|
|
58
|
-
"material-react-table": "^2.
|
|
58
|
+
"material-react-table": "^3.2.1",
|
|
59
59
|
"polished": "^3.7.1",
|
|
60
60
|
"prop-types": "^15.6.2",
|
|
61
61
|
"react-app-polyfill": "^2.0.0",
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
"@babel/preset-env": "^7.12.11",
|
|
80
80
|
"@babel/preset-react": "^7.12.10",
|
|
81
81
|
"@babel/runtime": "^7.12.5",
|
|
82
|
-
"@chromatic-com/storybook": "^1.
|
|
82
|
+
"@chromatic-com/storybook": "^1.9.0",
|
|
83
83
|
"@fortawesome/fontawesome-svg-core": "file:libs/fortawesome-fontawesome-svg-core-1.3.0.tgz",
|
|
84
84
|
"@fortawesome/free-regular-svg-icons": "^5.15.1",
|
|
85
85
|
"@fortawesome/free-solid-svg-icons": "^5.15.1",
|
|
@@ -226,4 +226,4 @@
|
|
|
226
226
|
"eslintConfig": {
|
|
227
227
|
"extends": "react-app"
|
|
228
228
|
}
|
|
229
|
-
}
|
|
229
|
+
}
|