orcs-design-system 3.3.55 → 3.3.57

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.
@@ -3,5 +3,5 @@ import { themeGet } from "@styled-system/theme-get";
3
3
  // GLOBAL STYLES
4
4
  // For browser reset, setting global box sizing and font sizing etc.
5
5
 
6
- const GlobalStyles = createGlobalStyle(["html{box-sizing:border-box;line-height:1.15;line-height:calc(2px + 2ex + 2px);}html *{line-height:calc(2px + 2ex + 2px);}*,*:before,*:after{box-sizing:inherit;}html,body{height:100%;width:100%;margin:", ";}body{font-family:", ";color:", ";}html{font-size:62.5%;}body{font-size:", ";}main{display:flex;align-items:stretch;align-content:stretch;width:100%;}section{height:", ";width:100%;overflow-y:scroll;}img{border-style:none;}small{font-size:80%;}p{margin:", ";}h1,h2,h3,h4,h5,h6{font-weight:", ";font-family:", ";margin:", ";}h1{font-size:", "}h2{font-size:", "}h3{font-size:", "}h4{font-size:", "}h5{font-size:", "}h6{font-size:", "}a,p,small,li,h1,h2,h3,h4,h5,h6{word-break:break-word;}"], props => themeGet("space.0")(props), props => themeGet("fonts.main")(props), props => themeGet("colors.greyDarkest")(props), props => themeGet("fontSizes.2")(props), props => themeGet("appScale.navBarSize")(props), props => themeGet("space.0")(props), props => themeGet("fontWeights.1")(props), props => themeGet("fonts.main")(props), props => themeGet("space.0")(props), props => themeGet("fontSizes.6")(props), props => themeGet("fontSizes.5")(props), props => themeGet("fontSizes.4")(props), props => themeGet("fontSizes.3")(props), props => themeGet("fontSizes.2")(props), props => themeGet("fontSizes.1")(props));
6
+ const GlobalStyles = createGlobalStyle(["html{box-sizing:border-box;line-height:1.15;line-height:calc(2px + 2ex + 2px);}html *{line-height:calc(2px + 2ex + 2px);}*,*:before,*:after{box-sizing:inherit;}html,body{height:100%;width:100%;margin:", ";}body{font-family:", ";color:", ";}html{font-size:62.5%;}body{font-size:", ";}main{display:flex;align-items:stretch;align-content:stretch;width:100%;}section{height:auto;width:100%;overflow-y:auto;}img{border-style:none;}small{font-size:80%;}p{margin:", ";}h1,h2,h3,h4,h5,h6{font-weight:", ";font-family:", ";margin:", ";}h1{font-size:", "}h2{font-size:", "}h3{font-size:", "}h4{font-size:", "}h5{font-size:", "}h6{font-size:", "}a,p,small,li,h1,h2,h3,h4,h5,h6{word-break:break-word;}"], props => themeGet("space.0")(props), props => themeGet("fonts.main")(props), props => themeGet("colors.greyDarkest")(props), props => themeGet("fontSizes.2")(props), props => themeGet("space.0")(props), props => themeGet("fontWeights.1")(props), props => themeGet("fonts.main")(props), props => themeGet("space.0")(props), props => themeGet("fontSizes.6")(props), props => themeGet("fontSizes.5")(props), props => themeGet("fontSizes.4")(props), props => themeGet("fontSizes.3")(props), props => themeGet("fontSizes.2")(props), props => themeGet("fontSizes.1")(props));
7
7
  export default GlobalStyles;
@@ -6,9 +6,12 @@ import PropTypes from "prop-types";
6
6
  import Icon from "../Icon";
7
7
  import Popover from "../Popover";
8
8
  import { BREAKPOINTS } from "./constants/sideNav";
9
+
10
+ // Icon column width for consistent grid layout
9
11
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
10
- const sharedNavItemStyles = styledCss(["cursor:pointer;padding:", ";text-decoration:none;border-radius:", ";width:100%;position:relative;border:none;path{transition:", ";fill:", ";}font-family:", ";display:flex;align-items:center;justify-content:center;transition:", ";background-color:transparent;font-size:1.4rem;font-weight:", ";&:hover,&:focus{color:", ";path{fill:", ";}}@media screen and (max-width:", "px){width:auto;max-height:30px;height:30px;}&:focus{outline:0;color:", ";path{fill:", ";}}"], themeGet("space.s"), themeGet("radii.2"), themeGet("transition.transitionDefault"), themeGet("colors.greyDarker"), themeGet("fonts.main"), themeGet("transition.transitionDefault"), themeGet("fontWeights.1"), themeGet("colors.primary"), themeGet("colors.primary"), BREAKPOINTS.SMALL_SCREEN, themeGet("colors.primary"), themeGet("colors.primary"));
11
- const expandedNavItemStyles = props => styledCss(["justify-content:flex-start;gap:", ";.nav-item-text{font-size:", ";line-height:1;font-weight:", ";color:", ";white-space:nowrap;text-overflow:ellipsis;}&:hover .nav-item-text,&:focus .nav-item-text{color:", ";}"], themeGet("space.s"), themeGet("fontSizes.1"), themeGet("fontWeights.1"), props.active ? themeGet("colors.greyDarkest") : themeGet("colors.greyDarker"), props.active ? themeGet("colors.greyDarkest") : themeGet("colors.primary"));
12
+ const ICON_COLUMN_WIDTH = "12px";
13
+ const sharedNavItemStyles = styledCss(["cursor:pointer;padding:", ";text-decoration:none;border-radius:", ";width:100%;position:relative;border:none;path{transition:", ";fill:", ";}font-family:", ";display:grid;grid-template-columns:", ";place-items:center;transition:", ";background-color:transparent;font-size:1.4rem;font-weight:", ";&:hover,&:focus{color:", ";path{fill:", ";}}@media screen and (max-width:", "px){width:auto;max-height:30px;height:30px;}&:focus{outline:0;color:", ";path{fill:", ";}}"], themeGet("space.s"), themeGet("radii.2"), themeGet("transition.transitionDefault"), themeGet("colors.greyDarker"), themeGet("fonts.main"), ICON_COLUMN_WIDTH, themeGet("transition.transitionDefault"), themeGet("fontWeights.1"), themeGet("colors.primary"), themeGet("colors.primary"), BREAKPOINTS.SMALL_SCREEN, themeGet("colors.primary"), themeGet("colors.primary"));
14
+ const expandedNavItemStyles = props => styledCss(["grid-template-columns:", " 1fr;gap:8px;place-items:center;.nav-item-text{font-size:", ";line-height:1;font-weight:", ";color:", ";text-align:left;justify-self:start;}&:hover .nav-item-text,&:focus .nav-item-text{color:", ";}"], ICON_COLUMN_WIDTH, themeGet("fontSizes.1"), themeGet("fontWeights.1"), props.active ? themeGet("colors.greyDarkest") : themeGet("colors.greyDarker"), props.active ? themeGet("colors.greyDarkest") : themeGet("colors.primary"));
12
15
  const variantActiveStyles = {
13
16
  expandableItem: props => styledCss(["color:", ";path{fill:", ";}:after{height:100%;position:absolute;right:0;transform:", ";content:\"\";border-right:3px solid ", ";z-index:5;}&:hover .nav-item-text,&:focus .nav-item-text{color:", ";}@media screen and (max-width:", "px){:after{border-top:3px solid ", ";border-right:none;transform:translateY(-10px);right:auto;width:100%;}}"], themeGet("colors.greyDarkest"), themeGet("colors.greyDarkest"), props.isExpanded ? "translateX(9px)" : "translateX(8px)", themeGet("colors.primary"), themeGet("colors.primary"), BREAKPOINTS.SMALL_SCREEN, themeGet("colors.primary")),
14
17
  default: styledCss(["background-color:", ";path{fill:", ";}&:hover,&:focus{path{fill:", ";}}&:focus{path{fill:", ";}}"], themeGet("colors.primaryLightest"), themeGet("colors.greyDarkest"), themeGet("colors.greyDarkest"), themeGet("colors.greyDarkest"))
@@ -40,7 +43,7 @@ const BadgeNumber = styled("div").withConfig({
40
43
  fontWeight: themeGet("fontWeights.2")(props),
41
44
  color: themeGet("colors.white")(props),
42
45
  borderRadius: "50%",
43
- top: props.isExpanded ? "8px" : "0",
46
+ top: props.isExpanded ? "5px" : "0",
44
47
  right: "0",
45
48
  display: "flex",
46
49
  alignItems: "center",
@@ -55,7 +58,7 @@ const BadgeDot = styled("div").withConfig({
55
58
  width: "8px",
56
59
  bg: themeGet("colors.primary")(props),
57
60
  borderRadius: "50%",
58
- top: props.isExpanded ? "12px" : "2px",
61
+ top: props.isExpanded ? "9px" : "2px",
59
62
  right: "0"
60
63
  }));
61
64
  const SideNavItemWrapper = styled.div.withConfig({
@@ -15,11 +15,11 @@ const ItemList = styled.ul.withConfig({
15
15
  const ItemName = styled.span.withConfig({
16
16
  displayName: "BaseSection__ItemName",
17
17
  componentId: "sc-1y67u5l-1"
18
- })(["margin-left:8px;font-size:", ";"], props => themeGet("fontSizes.1")(props));
18
+ })(["font-size:", ";"], props => themeGet("fontSizes.1")(props));
19
19
  export const Item = styled.li.withConfig({
20
20
  displayName: "BaseSection__Item",
21
21
  componentId: "sc-1y67u5l-2"
22
- })(["display:flex;width:100%;gap:", ";justify-content:space-between;align-items:center;a{display:flex;align-items:center;font-size:", ";text-decoration:none;color:", ";&:hover,&:focus{outline:none;color:", ";}}"], props => themeGet("space.xs")(props), props => themeGet("fontSizes.1")(props), props => themeGet("colors.greyDarkest")(props), props => themeGet("colors.primary")(props));
22
+ })(["display:flex;width:100%;gap:", ";justify-content:space-between;align-items:center;a{display:flex;gap:8px;align-items:center;font-size:", ";text-decoration:none;color:", ";&:hover,&:focus{outline:none;color:", ";}}"], props => themeGet("space.xs")(props), props => themeGet("fontSizes.1")(props), props => themeGet("colors.greyDarkest")(props), props => themeGet("colors.primary")(props));
23
23
  export const AvatarLink = _ref => {
24
24
  let {
25
25
  avatar,
@@ -1,4 +1,4 @@
1
- import React, { useState, useRef, useEffect, useCallback } from "react";
1
+ import React, { useState, useRef, useEffect, useCallback, createElement as _createElement } from "react";
2
2
  import styled, { css } from "styled-components";
3
3
  import { NavLink, useLocation } from "react-router-dom";
4
4
  import { isEqual } from "lodash";
@@ -21,10 +21,7 @@ const VisibleTabs = styled.div.withConfig({
21
21
  componentId: "sc-hkpvfu-2"
22
22
  })(["flex-shrink:1;display:flex;align-items:center;justify-content:flex-start;overflow:hidden;height:inherit;"]);
23
23
  const activeTabStyle = css(["background-color:", ";color:", ";border-bottom:2px solid ", ";cursor:default;&:hover,&:focus{background-color:", ";color:", ";box-shadow:none;}"], themeGet("colors.white"), themeGet("colors.primary"), themeGet("colors.primary"), themeGet("colors.white"), themeGet("colors.primary"));
24
- const Tab = styled(NavLink).withConfig({
25
- displayName: "TabsAlt__Tab",
26
- componentId: "sc-hkpvfu-3"
27
- })(["width:", ";display:block;transition:background 200ms ease-in-out,color 200ms ease-in-out;border-bottom:2px solid ", ";padding:0 ", ";height:", ";display:flex;align-items:center;font-size:", ";font-weight:", ";position:relative;white-space:nowrap;text-decoration:none;text-align:center;background-color:", ";color:", ";cursor:pointer;", " &:hover{background-color:", ";color:", ";box-shadow:inset 0 2px 5px 0 ", ";}&:focus{outline:0;box-shadow:inset 0 2px 5px 0 ", ";}&.active{", "}"], _ref => {
24
+ const TabStyles = css(["width:", ";display:block;transition:background 200ms ease-in-out,color 200ms ease-in-out;border-bottom:2px solid ", ";padding:0 ", ";height:", ";display:flex;align-items:center;font-size:", ";font-weight:", ";position:relative;white-space:nowrap;text-decoration:none;text-align:center;background-color:", ";color:", ";cursor:pointer;", " &:hover{background-color:", ";color:", ";box-shadow:inset 0 2px 5px 0 ", ";}&:focus{outline:0;box-shadow:inset 0 2px 5px 0 ", ";}&.active{", "}"], _ref => {
28
25
  let {
29
26
  fullWidth
30
27
  } = _ref;
@@ -35,9 +32,17 @@ const Tab = styled(NavLink).withConfig({
35
32
  } = _ref2;
36
33
  return tabInShowMore ? css(["position:absolute;visibility:hidden;"]) : "";
37
34
  }, themeGet("colors.white"), themeGet("colors.primary"), themeGet("colors.primaryLightest"), themeGet("colors.primaryLightest"), activeTabStyle);
35
+ const NavTab = styled(NavLink).withConfig({
36
+ displayName: "TabsAlt__NavTab",
37
+ componentId: "sc-hkpvfu-3"
38
+ })(["", ""], TabStyles);
39
+ const Tab = styled.div.withConfig({
40
+ displayName: "TabsAlt__Tab",
41
+ componentId: "sc-hkpvfu-4"
42
+ })(["", ""], TabStyles);
38
43
  const ShowMoreButton = styled.button.withConfig({
39
44
  displayName: "TabsAlt__ShowMoreButton",
40
- componentId: "sc-hkpvfu-4"
45
+ componentId: "sc-hkpvfu-5"
41
46
  })(["appearance:none;border:none;font-family:", ";font-size:", ";font-weight:", ";background-color:", ";border-bottom:2px solid ", ";transition:", ";padding:0 ", ";height:", ";color:", ";display:", ";align-items:center;cursor:pointer;&:hover{background-color:", ";color:", ";box-shadow:inset 0 2px 5px 0 ", ";}&:focus{outline:0;box-shadow:inset 0 2px 5px 0 ", ";}&.hasActive{", "}"], themeGet("fonts.main"), themeGet("fontSizes.1"), themeGet("fontWeights.2"), themeGet("colors.white"), themeGet("colors.greyLighter"), themeGet("transition.transitionDefault"), themeGet("space.4"), themeGet("appScale.tabsHeight"), themeGet("colors.greyDark"), _ref3 => {
42
47
  let {
43
48
  showMoreVisible
@@ -46,7 +51,7 @@ const ShowMoreButton = styled.button.withConfig({
46
51
  }, themeGet("colors.white"), themeGet("colors.primary"), themeGet("colors.primaryLightest"), themeGet("colors.primaryLightest"), activeTabStyle);
47
52
  const ShowMoreTabs = styled.div.withConfig({
48
53
  displayName: "TabsAlt__ShowMoreTabs",
49
- componentId: "sc-hkpvfu-5"
54
+ componentId: "sc-hkpvfu-6"
50
55
  })(["border-radius:", ";background-color:", ";width:fit-content;overflow:hidden;display:flex;gap:1px;flex-direction:column;justify-content:flex-start;box-shadow:", ";& [class^=\"TabsAlt__Tab\"]{border:0;padding:", ";text-align:left;}"], themeGet("radii.2"), themeGet("colors.greyLighter"), themeGet("shadows.boxDefault"), themeGet("space.3"));
51
56
  const tabsGap = 0;
52
57
  const TabsAlt = _ref4 => {
@@ -114,6 +119,9 @@ const TabsAlt = _ref4 => {
114
119
  const showMoreTabsList = visibleTabsList.filter((_tab, i) => showMoreTabs.includes(i));
115
120
  const location = useLocation();
116
121
  const showMoreItemActive = showMoreTabsList.find(action => location.pathname.endsWith(action.path));
122
+ console.log({
123
+ visibleTabsList
124
+ });
117
125
  return /*#__PURE__*/_jsx(TabsContainer, {
118
126
  children: /*#__PURE__*/_jsx(TabWrapper, {
119
127
  children: /*#__PURE__*/_jsxs(VisibleTabs, {
@@ -122,15 +130,28 @@ const TabsAlt = _ref4 => {
122
130
  },
123
131
  ref: containerRef,
124
132
  role: "tablist",
125
- children: [visibleTabsList.map((tab, i) => /*#__PURE__*/_jsx(Tab, {
126
- className: tab.className,
127
- id: tab.id,
128
- "data-testid": tab["data-testid"],
129
- tabInShowMore: showMoreTabs.includes(i),
130
- to: tab.path,
131
- role: "tab",
132
- children: tab.label
133
- }, tab.path)), /*#__PURE__*/_jsx(ActionsMenu, {
133
+ children: [visibleTabsList.map((tab, i) => {
134
+ const sharedProps = {
135
+ className: tab.className,
136
+ id: tab.id,
137
+ "data-testid": tab["data-testid"],
138
+ key: tab.path,
139
+ tabInShowMore: showMoreTabs.includes(i),
140
+ role: "tab"
141
+ };
142
+ if (tab?.onClick) {
143
+ return /*#__PURE__*/_createElement(Tab, {
144
+ ...sharedProps,
145
+ onClick: tab?.onClick,
146
+ key: tab.id
147
+ }, tab.label);
148
+ }
149
+ return /*#__PURE__*/_createElement(NavTab, {
150
+ ...sharedProps,
151
+ to: tab.path,
152
+ key: tab.id || tab.path
153
+ }, tab.label);
154
+ }), /*#__PURE__*/_jsx(ActionsMenu, {
134
155
  direction: "bottom-end",
135
156
  role: "presentation",
136
157
  renderTrigger: props => /*#__PURE__*/_jsxs(ShowMoreButton, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "orcs-design-system",
3
- "version": "3.3.55",
3
+ "version": "3.3.57",
4
4
  "engines": {
5
5
  "node": "20.12.2"
6
6
  },