orcs-design-system 3.3.45 → 3.3.46

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.
@@ -124,7 +124,7 @@ const Shape = styled("div").withConfig({
124
124
  height: resolveCustomSize(props.customSize, props) || themeGet("avatarScale.avatarDefault")(props),
125
125
  fontWeight: themeGet("fontWeights.2")(props),
126
126
  flex: "0 0 auto",
127
- background: `linear-gradient(135deg, ${themeGet("colors.primaryLightest")(props)}, ${themeGet("colors.primaryLight")(props)})`,
127
+ background: props.gradient ? props.gradient : `linear-gradient(135deg, ${themeGet("colors.primaryLightest")(props)}, ${themeGet("colors.primaryLight")(props)})`,
128
128
  color: themeGet("colors.white")(props),
129
129
  border: "0",
130
130
  display: "flex",
@@ -353,8 +353,16 @@ const HeaderAvatarShape = styled("div").withConfig({
353
353
  })(_ref7 => {
354
354
  let {
355
355
  $size,
356
- $shape
356
+ $shape,
357
+ $gradient
357
358
  } = _ref7;
359
+ const backgroundStyles = $gradient ? {
360
+ backgroundImage: $gradient,
361
+ backgroundSize: "cover",
362
+ backgroundPosition: "center center"
363
+ } : {
364
+ background: "#e6e6e6"
365
+ };
358
366
  return {
359
367
  width: $size,
360
368
  height: $size,
@@ -362,7 +370,7 @@ const HeaderAvatarShape = styled("div").withConfig({
362
370
  display: "flex",
363
371
  alignItems: "center",
364
372
  justifyContent: "center",
365
- background: "#e6e6e6",
373
+ ...backgroundStyles,
366
374
  color: "#222",
367
375
  fontWeight: 600,
368
376
  fontSize: `calc(${$size} / 2.5)`,
@@ -446,6 +454,7 @@ const Avatar = _ref0 => {
446
454
  let {
447
455
  sizing,
448
456
  image,
457
+ gradient,
449
458
  imageAlt,
450
459
  initials,
451
460
  title,
@@ -494,6 +503,7 @@ const Avatar = _ref0 => {
494
503
  }) : /*#__PURE__*/_jsx(HeaderAvatarShape, {
495
504
  $size: size,
496
505
  $shape: shape,
506
+ $gradient: gradient,
497
507
  children: initials ? initials : shape === "hexagon" ? /*#__PURE__*/_jsx(Icon, {
498
508
  icon: ["fas", "users"]
499
509
  }) : shape === "tag" ? /*#__PURE__*/_jsx(Icon, {
@@ -567,6 +577,7 @@ const Avatar = _ref0 => {
567
577
  type: type,
568
578
  className: type == "inverted" ? "inverted" : "",
569
579
  uppercase: uppercase,
580
+ gradient: gradient,
570
581
  children: initials ? initials : shape === "hexagon" ? /*#__PURE__*/_jsx(Icon, {
571
582
  icon: ["fas", "users"]
572
583
  }) : shape === "tag" ? /*#__PURE__*/_jsx(Icon, {
@@ -26,7 +26,8 @@ export const AvatarLink = _ref => {
26
26
  name,
27
27
  link,
28
28
  shape = "square",
29
- showName
29
+ showName,
30
+ gradient
30
31
  } = _ref;
31
32
  return /*#__PURE__*/_jsxs(Link, {
32
33
  to: link,
@@ -34,7 +35,8 @@ export const AvatarLink = _ref => {
34
35
  children: [/*#__PURE__*/_jsx(Avatar, {
35
36
  image: avatar,
36
37
  customSize: "24px",
37
- shape: shape
38
+ shape: shape,
39
+ gradient: gradient
38
40
  }), showName && /*#__PURE__*/_jsx(ItemName, {
39
41
  children: name
40
42
  })]
@@ -45,7 +47,8 @@ AvatarLink.propTypes = {
45
47
  name: PropTypes.string.isRequired,
46
48
  link: PropTypes.string.isRequired,
47
49
  shape: PropTypes.string,
48
- showName: PropTypes.bool
50
+ showName: PropTypes.bool,
51
+ gradient: PropTypes.string
49
52
  };
50
53
  const BaseSection = _ref2 => {
51
54
  let {
@@ -173,6 +176,13 @@ AvatarLink.__docgenInfo = {
173
176
  "name": "bool"
174
177
  },
175
178
  "required": false
179
+ },
180
+ "gradient": {
181
+ "description": "",
182
+ "type": {
183
+ "name": "string"
184
+ },
185
+ "required": false
176
186
  }
177
187
  }
178
188
  };
@@ -38,10 +38,26 @@ const CurrentViewContent = _ref => {
38
38
  subNav,
39
39
  isExpanded,
40
40
  avatar,
41
- shape
41
+ shape,
42
+ gradient
42
43
  } = _ref;
43
44
  const link = subNav?.[0]?.link;
44
45
  const hasValidLink = Boolean(link);
46
+ const avatarAndLabelMarkup = /*#__PURE__*/_jsxs(Flex, {
47
+ flexWrap: "nowrap",
48
+ gap: "s",
49
+ alignItems: "center",
50
+ children: [/*#__PURE__*/_jsx(Avatar, {
51
+ image: avatar,
52
+ customSize: "24px",
53
+ shape: shape,
54
+ border: "1px solid",
55
+ gradient: gradient
56
+ }), /*#__PURE__*/_jsx(H6, {
57
+ fontWeight: "bold",
58
+ children: name
59
+ })]
60
+ });
45
61
  return /*#__PURE__*/_jsxs(Flex, {
46
62
  flexDirection: "column",
47
63
  gap: "s",
@@ -57,34 +73,8 @@ const CurrentViewContent = _ref => {
57
73
  alignItems: "center",
58
74
  children: [hasValidLink ? /*#__PURE__*/_jsx(UnstyledNavLink, {
59
75
  to: link,
60
- children: /*#__PURE__*/_jsxs(Flex, {
61
- flexWrap: "nowrap",
62
- gap: "s",
63
- alignItems: "center",
64
- children: [/*#__PURE__*/_jsx(Avatar, {
65
- image: avatar,
66
- customSize: "24px",
67
- shape: shape,
68
- border: "1px solid"
69
- }), /*#__PURE__*/_jsx(H6, {
70
- fontWeight: "bold",
71
- children: name
72
- })]
73
- })
74
- }) : /*#__PURE__*/_jsxs(Flex, {
75
- flexWrap: "nowrap",
76
- gap: "s",
77
- alignItems: "center",
78
- children: [/*#__PURE__*/_jsx(Avatar, {
79
- image: avatar,
80
- customSize: "24px",
81
- shape: shape,
82
- border: "1px solid"
83
- }), /*#__PURE__*/_jsx(H6, {
84
- fontWeight: "bold",
85
- children: name
86
- })]
87
- }), badge]
76
+ children: avatarAndLabelMarkup
77
+ }) : avatarAndLabelMarkup, badge]
88
78
  }), /*#__PURE__*/_jsx(SubNavList, {
89
79
  children: subNav?.map(_ref2 => {
90
80
  let {
@@ -111,7 +101,8 @@ const SideNavCurrentViewSection = _ref3 => {
111
101
  isExpanded,
112
102
  avatar,
113
103
  shape,
114
- isSmallScreen
104
+ isSmallScreen,
105
+ gradient
115
106
  } = _ref3;
116
107
  // Don't render anything if there's no valid name
117
108
  if (!name) {
@@ -123,7 +114,8 @@ const SideNavCurrentViewSection = _ref3 => {
123
114
  subNav: subNav,
124
115
  isExpanded: isExpanded,
125
116
  avatar: avatar,
126
- shape: shape
117
+ shape: shape,
118
+ gradient: gradient
127
119
  });
128
120
  return /*#__PURE__*/_jsxs(Flex, {
129
121
  isExpanded: isExpanded,
@@ -138,7 +130,8 @@ const SideNavCurrentViewSection = _ref3 => {
138
130
  image: avatar,
139
131
  customSize: "24px",
140
132
  shape: shape,
141
- isSmallScreen: isSmallScreen
133
+ isSmallScreen: isSmallScreen,
134
+ gradient: gradient
142
135
  })
143
136
  }), isExpanded && !isSmallScreen && currentViewMarkup]
144
137
  });
@@ -16,7 +16,8 @@ const SideNavPinnedSection = _ref => {
16
16
  name,
17
17
  link,
18
18
  shape,
19
- onUnpin
19
+ onUnpin,
20
+ gradient
20
21
  } = item;
21
22
  return /*#__PURE__*/_jsx(Item, {
22
23
  children: isExpanded ? /*#__PURE__*/_jsxs(_Fragment, {
@@ -25,7 +26,8 @@ const SideNavPinnedSection = _ref => {
25
26
  name: name,
26
27
  link: link,
27
28
  shape: shape,
28
- showName: true
29
+ showName: true,
30
+ gradient: gradient
29
31
  }), /*#__PURE__*/_jsx(Popover, {
30
32
  text: "Unpin item",
31
33
  direction: "right",
@@ -54,7 +56,8 @@ const SideNavPinnedSection = _ref => {
54
56
  name: name,
55
57
  link: link,
56
58
  shape: shape,
57
- showName: false
59
+ showName: false,
60
+ gradient: gradient
58
61
  })
59
62
  })
60
63
  }, name);
@@ -12,7 +12,8 @@ const SideNavTeamsSection = _ref => {
12
12
  const {
13
13
  avatar,
14
14
  name,
15
- link
15
+ link,
16
+ gradient
16
17
  } = team;
17
18
  return /*#__PURE__*/_jsx(Item, {
18
19
  children: isExpanded ? /*#__PURE__*/_jsx(AvatarLink, {
@@ -20,7 +21,8 @@ const SideNavTeamsSection = _ref => {
20
21
  name: name,
21
22
  link: link,
22
23
  shape: "square",
23
- showName: true
24
+ showName: true,
25
+ gradient: gradient
24
26
  }) : /*#__PURE__*/_jsx(Popover, {
25
27
  text: name,
26
28
  direction: "right",
@@ -30,7 +32,8 @@ const SideNavTeamsSection = _ref => {
30
32
  name: name,
31
33
  link: link,
32
34
  shape: "square",
33
- showName: false
35
+ showName: false,
36
+ gradient: gradient
34
37
  })
35
38
  })
36
39
  }, name);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "orcs-design-system",
3
- "version": "3.3.45",
3
+ "version": "3.3.46",
4
4
  "engines": {
5
5
  "node": "20.12.2"
6
6
  },