orcs-design-system 3.2.46 → 3.2.48

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,10 @@
1
+ import { keyframes } from "styled-components";
2
+ export const crossFadeIn = keyframes(["0%{opacity:0;}75%{opacity:0;}100%{opacity:1;}"]);
3
+ export const beforeDotCollapsing = keyframes(["0%{transform:translate(0,-6px);}50%{transform:translate(0,0);}100%{transform:translate(0,0);}"]);
4
+ export const beforeDotExpanding = keyframes(["0%{transform:translate(0,0);}50%{transform:translate(0,0);}100%{transform:translate(0,-6px);}"]);
5
+ export const afterDotCollapsing = keyframes(["0%{transform:translate(0,6px);}50%{transform:translate(0,0);}100%{transform:translate(0,0);}"]);
6
+ export const afterDotExpanding = keyframes(["0%{transform:translate(0,0);}50%{transform:translate(0,0);}100%{transform:translate(0,6px);}"]);
7
+ export const beforeCrossExpanding = keyframes(["0%{height:4px;transform:rotate(-45deg);}50%{height:4px;transform:rotate(-45deg);}100%{height:18px;transform:translate(0,-7px) rotate(-45deg);}"]);
8
+ export const beforeCrossCollapsing = keyframes(["0%{height:18px;transform:translate(0,-7px) rotate(-45deg);}50%{height:4px;transform:rotate(-45deg);}100%{height:4px;transform:rotate(-45deg);}"]);
9
+ export const afterCrossExpanding = keyframes(["0%{height:4px;transform:rotate(45deg);}50%{height:4px;transform:rotate(45deg);}100%{height:18px;transform:translate(0,-7px) rotate(45deg);}"]);
10
+ export const afterCrossCollapsing = keyframes(["0%{height:18px;transform:translate(0,-7px) rotate(45deg);}50%{height:4px;transform:rotate(45deg);}100%{height:4px;transform:rotate(45deg);}"]);
@@ -104,6 +104,7 @@ const MenuItems = /*#__PURE__*/React.forwardRef((_ref, ref) => {
104
104
  if (id === "other") {
105
105
  return /*#__PURE__*/_jsx(ActionsMenuItem, {
106
106
  type: "button",
107
+ id: "other",
107
108
  selected: selectedReason === id,
108
109
  onClick: clickOther,
109
110
  children: /*#__PURE__*/_jsxs(Flex, {
@@ -127,7 +128,6 @@ const MenuItems = /*#__PURE__*/React.forwardRef((_ref, ref) => {
127
128
  id: "editableContent",
128
129
  p: "s",
129
130
  children: [/*#__PURE__*/_jsx(TextArea, {
130
- inverted: true,
131
131
  id: "TextArea01",
132
132
  label: "Reason for rejection",
133
133
  cols: "35",
@@ -1,16 +1,15 @@
1
1
  import React, { useState, useImperativeHandle, createContext, useContext, useMemo, useId, useLayoutEffect } from "react";
2
- import styled, { css, keyframes, ThemeProvider } from "styled-components";
2
+ import styled, { css, ThemeProvider } from "styled-components";
3
3
  import PropTypes from "prop-types";
4
4
  import { space, layout } from "styled-system";
5
5
  import { themeGet } from "@styled-system/theme-get";
6
6
  import { commonKeys } from "../../hooks/keypress";
7
7
  import useActionMenu from "./useActionMenu";
8
+ import { crossFadeIn, beforeDotCollapsing, beforeDotExpanding, afterDotCollapsing, afterDotExpanding, beforeCrossExpanding, beforeCrossCollapsing, afterCrossExpanding, afterCrossCollapsing } from "./ActionsMenu.animations";
8
9
  import { FloatingFocusManager, FloatingPortal, useMergeRefs } from "@floating-ui/react";
9
10
  import { getFloatingUiRootElement, getFloatingUiZIndex } from "../../utils/floatingUiHelpers";
10
11
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
11
12
  const ActionMenuContext = /*#__PURE__*/createContext({});
12
- const crossTransform1 = keyframes(["0%{transform:translate(0,-6px);border-radius:2px;}50%{transform:translate(0,0);border-radius:2px;}75%{transform:rotate(-45deg) translate(0,0);border-radius:2px;}100%{transform:rotate(-45deg) translate(0,0) scaleX(4);border-radius:0;}"]);
13
- const crossTransform2 = keyframes(["0%{transform:translate(0,6px);border-radius:2px;}50%{transform:translate(0,0);border-radius:2px;}75%{transform:rotate(45deg) translate(0,0);border-radius:2px;}100%{transform:rotate(45deg) translate(0,0) scaleX(4);border-radius:0;}"]);
14
13
  const StyledActionsMenuContainer = styled.div.withConfig({
15
14
  displayName: "ActionsMenu__StyledActionsMenuContainer",
16
15
  componentId: "sc-yvbni2-0"
@@ -22,15 +21,19 @@ const Wrapper = styled.div.withConfig({
22
21
  const Control = styled.button.withConfig({
23
22
  displayName: "ActionsMenu__Control",
24
23
  componentId: "sc-yvbni2-2"
25
- })(["position:relative;background-color:", ";border:none;display:flex;align-items:center;justify-content:center;-moz-appearance:none;-webkit-appearance:none;appearance:none;box-shadow:none;text-decoration:none;text-align:center;border-radius:", ";transition:", ";cursor:pointer;width:30px;height:30px;&:hover,&:focus{outline:0;background-color:", ";}&[data-state=\"open\"] .action-menu-icon{&:before{animation:400ms ", " ease-in-out forwards;}&:after{animation:400ms ", " ease-in-out forwards;}}"], props => themeGet("colors.greyLighter")(props), props => themeGet("radii.2")(props), props => themeGet("transition.transitionDefault")(props), props => themeGet("colors.greyLight")(props), crossTransform1, crossTransform2);
26
- const Icon = styled.div.withConfig({
27
- displayName: "ActionsMenu__Icon",
24
+ })(["position:relative;background-color:", ";border:solid 1px ", ";display:flex;align-items:center;justify-content:center;-moz-appearance:none;-webkit-appearance:none;appearance:none;box-shadow:none;text-decoration:none;text-align:center;border-radius:", ";transition:", ";cursor:pointer;width:30px;height:30px;&:hover,&:focus{outline:0;border-color:", ";}&[data-state=\"open\"] .actionsMenu__dots{&:before{animation:500ms ", " cubic-bezier(0.68,-0.6,0.32,1.6) forwards;}&:after{animation:500ms ", " cubic-bezier(0.68,-0.6,0.32,1.6) forwards;}}&[data-state=\"open\"] .actionsMenu__cross{&:before{animation:500ms ", " cubic-bezier(0.68,-0.6,0.32,1.6) forwards;}&:after{animation:500ms ", " cubic-bezier(0.68,-0.6,0.32,1.6) forwards;}}&[data-state=\"closed\"] .actionsMenu__dots{&:before{animation:500ms ", " cubic-bezier(0.68,-0.6,0.32,1.6) forwards;}&:after{animation:500ms ", " cubic-bezier(0.68,-0.6,0.32,1.6) forwards;}}&[data-state=\"closed\"] .actionsMenu__cross{&:before{animation:500ms ", " cubic-bezier(0.68,-0.6,0.32,1.6) forwards;}&:after{animation:500ms ", " cubic-bezier(0.68,-0.6,0.32,1.6) forwards;}}"], props => themeGet("colors.white")(props), props => themeGet("colors.greyLight")(props), props => themeGet("radii.2")(props), props => themeGet("transition.transitionDefault")(props), props => themeGet("colors.primary")(props), beforeDotCollapsing, afterDotCollapsing, beforeCrossExpanding, afterCrossExpanding, beforeDotExpanding, afterDotExpanding, beforeCrossCollapsing, afterCrossCollapsing);
25
+ const Dots = styled.div.withConfig({
26
+ displayName: "ActionsMenu__Dots",
28
27
  componentId: "sc-yvbni2-3"
29
- })(["border-radius:2px;height:4px;width:4px;background-color:", ";&:before,&:after{content:\"\";display:block;position:absolute;border-radius:2px;height:4px;width:4px;background-color:", ";transition:", ";transform-origin:50% 50%;}&:before{transform:translate(0,-6px) scaleX(1);}&:after{transform:translate(0,6px) scaleX(1);}"], props => themeGet("colors.greyDarker")(props), props => themeGet("colors.greyDarker")(props), props => themeGet("transition.transitionDefault")(props));
28
+ })(["border-radius:2px;height:4px;width:4px;background-color:", ";&:before,&:after{content:\"\";display:block;position:absolute;border-radius:2px;height:4px;width:4px;background-color:", ";}&:before{transform:translate(0,-6px);}&:after{transform:translate(0,6px);}"], props => themeGet("colors.greyDarker")(props), props => themeGet("colors.greyDarker")(props));
29
+ const Cross = styled.div.withConfig({
30
+ displayName: "ActionsMenu__Cross",
31
+ componentId: "sc-yvbni2-4"
32
+ })(["animation:1500ms ", " ease-in-out forwards;opacity:0;position:absolute;left:calc(50% - 2px);top:calc(50% - 2px);&:before,&:after{content:\"\";display:block;position:absolute;border-radius:2px;height:4px;width:4px;background-color:", ";}&:before{transform:rotate(-45deg);}&:after{transform:rotate(45deg);}"], crossFadeIn, props => themeGet("colors.greyDarker")(props));
30
33
  const Menu = styled.div.withConfig({
31
34
  displayName: "ActionsMenu__Menu",
32
- componentId: "sc-yvbni2-4"
33
- })(["display:block;width:", ";z-index:5;background-color:", ";border-radius:", ";"], props => props.menuWidth ? props.menuWidth : "auto", props => themeGet("colors.greyDarker")(props), props => themeGet("radii.2")(props));
35
+ componentId: "sc-yvbni2-5"
36
+ })(["display:block;width:", ";z-index:5;background-color:", ";border:1px solid ", ";box-shadow:", ";border-radius:", ";"], props => props.menuWidth ? props.menuWidth : "auto", themeGet("colors.white"), themeGet("colors.greyLight"), themeGet("shadows.boxDefault"), props => themeGet("radii.2")(props));
34
37
  export const ActionsMenuHeading = styled(props => {
35
38
  const {
36
39
  actionMenu
@@ -56,8 +59,8 @@ export const ActionsMenuHeading = styled(props => {
56
59
  role: "button"
57
60
  }).withConfig({
58
61
  displayName: "ActionsMenu__ActionsMenuHeading",
59
- componentId: "sc-yvbni2-5"
60
- })(["color:", ";padding:8px;width:100%;font-size:", ";font-weight:", ";border-bottom:solid 1px ", ";white-space:nowrap;cursor:", ";"], props => themeGet("colors.white")(props), props => themeGet("fontSizes.1")(props), props => themeGet("fontWeights.1")(props), props => themeGet("colors.greyDarkest")(props), props => props.canClick ? "pointer" : "default");
62
+ componentId: "sc-yvbni2-6"
63
+ })(["color:", ";padding:8px;width:100%;font-size:", ";font-weight:", ";border-bottom:solid 1px ", ";white-space:nowrap;cursor:", ";"], props => themeGet("colors.greyDark")(props), props => themeGet("fontSizes.0")(props), props => themeGet("fontWeights.1")(props), props => themeGet("colors.greyLighter")(props), props => props.canClick ? "pointer" : "default");
61
64
  export const ActionsMenuItem = styled(props => {
62
65
  const {
63
66
  id,
@@ -102,12 +105,12 @@ export const ActionsMenuItem = styled(props => {
102
105
  role: "menuitem"
103
106
  }).withConfig({
104
107
  displayName: "ActionsMenu__ActionsMenuItem",
105
- componentId: "sc-yvbni2-6"
108
+ componentId: "sc-yvbni2-7"
106
109
  })(["", ""], _ref => {
107
110
  let {
108
111
  Component
109
112
  } = _ref;
110
- return Component ? "" : css(["white-space:nowrap;display:block;width:100%;text-align:left;cursor:pointer;margin:0;padding:8px;appearance:none;background-color:", ";border:none;border-bottom:solid 1px ", ";border-radius:0;color:", ";font-size:", ";line-height:", ";font-family:", ";font-weight:", ";text-decoration:none;transition:", ";&:hover,&:focus{outline:0;background-color:", ";}&:first-child{border-radius:", " ", " 0 0;}&:last-child{border:0;border-radius:0 0 ", " ", ";}&:only-child{border-radius:", ";}"], props => props.selected ? themeGet("colors.successDark")(props) : "transparent", props => themeGet("colors.greyDarkest")(props), props => themeGet("colors.white")(props), props => themeGet("fontSizes.1")(props), props => themeGet("fontSizes.1")(props), props => themeGet("fonts.main")(props), props => themeGet("fontWeights.2")(props), props => themeGet("transition.transitionDefault")(props), props => themeGet("colors.primaryDark")(props), props => themeGet("radii.2")(props), props => themeGet("radii.2")(props), props => themeGet("radii.2")(props), props => themeGet("radii.2")(props), props => themeGet("radii.2")(props));
113
+ return Component ? "" : css(["white-space:nowrap;display:block;width:100%;text-align:left;cursor:pointer;margin:0;padding:8px;appearance:none;background-color:", ";border:none;border-bottom:solid 1px ", ";border-radius:0;color:", ";font-size:", ";line-height:", ";font-family:", ";font-weight:", ";text-decoration:none;transition:", ";&:hover{background-color:", ";}&:first-child{border-radius:", " ", " 0 0;}&:last-child{border:0;border-radius:0 0 ", " ", ";}&:only-child{border-radius:", ";}&#other{padding:6px 8px;}"], props => props.selected ? themeGet("colors.success20")(props) : "transparent", props => themeGet("colors.white")(props), props => themeGet("colors.greyDarkest")(props), props => themeGet("fontSizes.0")(props), props => themeGet("fontSizes.0")(props), props => themeGet("fonts.main")(props), props => themeGet("fontWeights.2")(props), props => themeGet("transition.transitionDefault")(props), props => themeGet("colors.primaryLightest")(props), props => themeGet("radii.2")(props), props => themeGet("radii.2")(props), props => themeGet("radii.2")(props), props => themeGet("radii.2")(props), props => themeGet("radii.2")(props));
111
114
  });
112
115
  export const ActionsMenuBody = _ref2 => {
113
116
  let {
@@ -153,11 +156,13 @@ export const ActionsMenuBody = _ref2 => {
153
156
  "data-testid": dataTestId
154
157
  })
155
158
  }), [ariaLabel, onTriggerFocus, id, actionMenu, onToggle, props, triggerRef, dataTestId]);
156
- let triggerComponent = /*#__PURE__*/_jsx(Control, {
159
+ let triggerComponent = /*#__PURE__*/_jsxs(Control, {
157
160
  ...triggerProps,
158
- children: /*#__PURE__*/_jsx(Icon, {
159
- className: "action-menu-icon"
160
- })
161
+ children: [/*#__PURE__*/_jsx(Dots, {
162
+ className: "actionsMenu__dots"
163
+ }), /*#__PURE__*/_jsx(Cross, {
164
+ className: "actionsMenu__cross"
165
+ })]
161
166
  });
162
167
  if (renderTrigger) {
163
168
  triggerComponent = renderTrigger(triggerProps);
@@ -0,0 +1,80 @@
1
+ import React from "react";
2
+ import FloatingPanels from ".";
3
+ import Box from "../Box";
4
+ import { far } from "@fortawesome/free-regular-svg-icons";
5
+ import { library } from "@fortawesome/fontawesome-svg-core";
6
+ import TextInput from "../TextInput";
7
+ import Toggle from "../Toggle";
8
+ import Spacer from "../Spacer";
9
+ import Badge from "../Badge";
10
+ import { P } from "../Typography";
11
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
12
+ library.add(far);
13
+ export default {
14
+ title: "Components/FloatingPanels",
15
+ decorators: [storyFn => /*#__PURE__*/_jsx(Box, {
16
+ minHeight: "600px",
17
+ children: storyFn()
18
+ })],
19
+ component: FloatingPanels
20
+ };
21
+ const Properties = () => {
22
+ return /*#__PURE__*/_jsxs(_Fragment, {
23
+ children: [/*#__PURE__*/_jsxs(Spacer, {
24
+ mb: "r",
25
+ children: [/*#__PURE__*/_jsx(Badge, {
26
+ variant: "secondary",
27
+ children: "Blah"
28
+ }), /*#__PURE__*/_jsx(P, {
29
+ children: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
30
+ }), /*#__PURE__*/_jsx(Toggle, {
31
+ id: "toggle1",
32
+ label: "Group items",
33
+ small: true
34
+ }), /*#__PURE__*/_jsx(Toggle, {
35
+ id: "toggle2",
36
+ label: "Show teams",
37
+ small: true
38
+ })]
39
+ }), /*#__PURE__*/_jsx(TextInput, {
40
+ id: "textInput1",
41
+ type: "text",
42
+ label: "Full name",
43
+ placeholder: "E.g. John Smith",
44
+ my: "20px"
45
+ }, "textInput1")]
46
+ });
47
+ };
48
+ const panels = [{
49
+ id: "view-options",
50
+ iconName: "eye",
51
+ title: "View Options",
52
+ defaultExpanded: true,
53
+ content: /*#__PURE__*/_jsx(Properties, {})
54
+ }, {
55
+ id: "properties",
56
+ iconName: "sun",
57
+ title: "Properties",
58
+ content: /*#__PURE__*/_jsx(Properties, {})
59
+ }, {
60
+ id: "person-details",
61
+ iconName: "user",
62
+ title: "Person Details",
63
+ content: /*#__PURE__*/_jsx(Properties, {})
64
+ }];
65
+ export const defaultFloatingPanels = () => {
66
+ return /*#__PURE__*/_jsx(FloatingPanels, {
67
+ panels: panels,
68
+ containerHeight: 500,
69
+ position: {
70
+ right: 20,
71
+ top: 20
72
+ }
73
+ });
74
+ };
75
+ defaultFloatingPanels.storyName = "Default Floating Panels";
76
+ defaultFloatingPanels.__docgenInfo = {
77
+ "description": "",
78
+ "methods": [],
79
+ "displayName": "defaultFloatingPanels"
80
+ };
@@ -0,0 +1,107 @@
1
+ import styled from "styled-components";
2
+ import { themeGet } from "@styled-system/theme-get";
3
+ export const Container = styled.div.withConfig({
4
+ displayName: "FloatingPanelsstyles__Container",
5
+ componentId: "sc-1by914f-0"
6
+ })(["z-index:2;position:absolute;display:flex;flex-direction:column;gap:8px;width:300px;max-height:", ";", ""], _ref => {
7
+ let {
8
+ containerHeight
9
+ } = _ref;
10
+ return containerHeight ? `${containerHeight}px` : "100%";
11
+ }, _ref2 => {
12
+ let {
13
+ position
14
+ } = _ref2;
15
+ return Object.entries(position).filter(_ref3 => {
16
+ let [, value] = _ref3;
17
+ return value !== undefined;
18
+ }).map(_ref4 => {
19
+ let [key, value] = _ref4;
20
+ return `${key}: ${typeof value === "number" ? `${value}px` : value};`;
21
+ }).join("\n");
22
+ });
23
+ export const PanelWrapper = styled.div.withConfig({
24
+ displayName: "FloatingPanelsstyles__PanelWrapper",
25
+ componentId: "sc-1by914f-1"
26
+ })(["background:white;border:", ";border-radius:8px;border-radius:0 0 8px 8px;box-shadow:", ";overflow-y:", ";padding:", ";margin-top:46px;max-height:", ";transition:max-height 0.3s ease-in-out;"], _ref5 => {
27
+ let {
28
+ isExpanded,
29
+ theme
30
+ } = _ref5;
31
+ return isExpanded ? `1px solid ${theme.colors.greyLighter}` : "1px solid white";
32
+ }, _ref6 => {
33
+ let {
34
+ isExpanded
35
+ } = _ref6;
36
+ return isExpanded ? "0 1px 3px rgba(0, 0, 0, 0.1)" : "none";
37
+ }, _ref7 => {
38
+ let {
39
+ isExpanded
40
+ } = _ref7;
41
+ return isExpanded ? "auto" : "hidden";
42
+ }, _ref8 => {
43
+ let {
44
+ isExpanded
45
+ } = _ref8;
46
+ return isExpanded ? "0 12px 12px 12px" : "0 12px";
47
+ }, _ref9 => {
48
+ let {
49
+ isExpanded
50
+ } = _ref9;
51
+ return isExpanded ? "none" : "0";
52
+ });
53
+ export const PanelHeader = styled.button.withConfig({
54
+ displayName: "FloatingPanelsstyles__PanelHeader",
55
+ componentId: "sc-1by914f-2"
56
+ })(["font-family:", ";box-shadow:0 0 4px rgba(0,0,0,0.1);color:", ";width:100%;margin-left:-13px;margin-top:-46px;border-radius:", ";appearance:none;background-color:white;display:flex;align-items:center;justify-content:space-between;padding:12px 12px 12px 12px;height:46px;position:fixed;width:300px;border-bottom:", ";border:solid 1px ", ";z-index:1;cursor:pointer;user-select:none;transition:padding 0.3s ease-in-out;&:focus{outline:none;}"], themeGet("fonts.main"), themeGet("colors.greyDarkest"), _ref10 => {
57
+ let {
58
+ isExpanded
59
+ } = _ref10;
60
+ return isExpanded ? "8px 8px 0 0" : "8px";
61
+ }, _ref11 => {
62
+ let {
63
+ isExpanded,
64
+ theme
65
+ } = _ref11;
66
+ return isExpanded ? `1px solid ${theme.colors.greyLighter}` : "none";
67
+ }, themeGet("colors.greyLighter"));
68
+ export const HeaderContent = styled.div.withConfig({
69
+ displayName: "FloatingPanelsstyles__HeaderContent",
70
+ componentId: "sc-1by914f-3"
71
+ })(["display:flex;align-items:center;gap:12px;"]);
72
+ export const Title = styled.span.withConfig({
73
+ displayName: "FloatingPanelsstyles__Title",
74
+ componentId: "sc-1by914f-4"
75
+ })(["font-size:14px;font-weight:500;"]);
76
+ export const IconWrapper = styled.div.withConfig({
77
+ displayName: "FloatingPanelsstyles__IconWrapper",
78
+ componentId: "sc-1by914f-5"
79
+ })(["background-color:", ";width:22px;height:22px;border-radius:50%;display:flex;align-items:center;justify-content:center;"], themeGet("colors.primary"));
80
+ export const ChevronWrapper = styled(IconWrapper).withConfig({
81
+ displayName: "FloatingPanelsstyles__ChevronWrapper",
82
+ componentId: "sc-1by914f-6"
83
+ })(["transition:background-color 0.3s ease-in-out;background-color:", ";"], _ref12 => {
84
+ let {
85
+ isHovered
86
+ } = _ref12;
87
+ return isHovered ? themeGet("colors.greyLighter") : "white";
88
+ });
89
+ export const PanelContent = styled.div.withConfig({
90
+ displayName: "FloatingPanelsstyles__PanelContent",
91
+ componentId: "sc-1by914f-7"
92
+ })(["padding-top:12px;display:", ";height:", ";opacity:", ";"], _ref13 => {
93
+ let {
94
+ isExpanded
95
+ } = _ref13;
96
+ return isExpanded ? "block" : "none";
97
+ }, _ref14 => {
98
+ let {
99
+ isExpanded
100
+ } = _ref14;
101
+ return isExpanded ? "100%" : "0";
102
+ }, _ref15 => {
103
+ let {
104
+ isExpanded
105
+ } = _ref15;
106
+ return isExpanded ? "1" : "0";
107
+ });
@@ -0,0 +1,115 @@
1
+ import React, { useState } from "react";
2
+ import PropTypes from "prop-types";
3
+ import Icon from "../Icon";
4
+ import { PanelWrapper, PanelHeader, HeaderContent, Title, IconWrapper, ChevronWrapper, PanelContent } from "./FloatingPanels.styles";
5
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
6
+ const Panel = _ref => {
7
+ let {
8
+ iconName,
9
+ title,
10
+ containerHeight,
11
+ content,
12
+ defaultExpanded = false
13
+ } = _ref;
14
+ const [isExpanded, setIsExpanded] = useState(defaultExpanded);
15
+ const arrowIcon = isExpanded ? "chevron-up" : "chevron-down";
16
+ const [isHovered, setIsHovered] = useState(false);
17
+ return /*#__PURE__*/_jsxs(PanelWrapper, {
18
+ containerHeight: containerHeight,
19
+ isExpanded: isExpanded,
20
+ children: [/*#__PURE__*/_jsxs(PanelHeader, {
21
+ onClick: () => setIsExpanded(!isExpanded),
22
+ isExpanded: isExpanded,
23
+ onMouseEnter: () => setIsHovered(true),
24
+ onMouseLeave: () => setIsHovered(false),
25
+ onFocus: () => setIsHovered(true),
26
+ onBlur: () => setIsHovered(false),
27
+ children: [/*#__PURE__*/_jsxs(HeaderContent, {
28
+ children: [/*#__PURE__*/_jsx(IconWrapper, {
29
+ children: /*#__PURE__*/_jsx(Icon, {
30
+ size: "xs",
31
+ color: "white",
32
+ icon: ["far", iconName]
33
+ })
34
+ }), /*#__PURE__*/_jsx(Title, {
35
+ children: title
36
+ })]
37
+ }), /*#__PURE__*/_jsx(ChevronWrapper, {
38
+ isHovered: isHovered,
39
+ children: /*#__PURE__*/_jsx(Icon, {
40
+ size: "sm",
41
+ icon: ["fas", arrowIcon],
42
+ color: "greyDarker"
43
+ })
44
+ })]
45
+ }), /*#__PURE__*/_jsx(PanelContent, {
46
+ isExpanded: isExpanded,
47
+ children: content
48
+ })]
49
+ });
50
+ };
51
+ Panel.propTypes = {
52
+ iconName: PropTypes.string.isRequired,
53
+ title: PropTypes.string.isRequired,
54
+ content: PropTypes.node.isRequired,
55
+ defaultExpanded: PropTypes.bool,
56
+ containerHeight: PropTypes.number,
57
+ isExpanded: PropTypes.bool.isRequired
58
+ };
59
+ Panel.defaultProps = {
60
+ defaultExpanded: false
61
+ };
62
+ Panel.__docgenInfo = {
63
+ "description": "",
64
+ "methods": [],
65
+ "displayName": "Panel",
66
+ "props": {
67
+ "defaultExpanded": {
68
+ "defaultValue": {
69
+ "value": "false",
70
+ "computed": false
71
+ },
72
+ "description": "",
73
+ "type": {
74
+ "name": "bool"
75
+ },
76
+ "required": false
77
+ },
78
+ "iconName": {
79
+ "description": "",
80
+ "type": {
81
+ "name": "string"
82
+ },
83
+ "required": true
84
+ },
85
+ "title": {
86
+ "description": "",
87
+ "type": {
88
+ "name": "string"
89
+ },
90
+ "required": true
91
+ },
92
+ "content": {
93
+ "description": "",
94
+ "type": {
95
+ "name": "node"
96
+ },
97
+ "required": true
98
+ },
99
+ "containerHeight": {
100
+ "description": "",
101
+ "type": {
102
+ "name": "number"
103
+ },
104
+ "required": false
105
+ },
106
+ "isExpanded": {
107
+ "description": "",
108
+ "type": {
109
+ "name": "bool"
110
+ },
111
+ "required": true
112
+ }
113
+ }
114
+ };
115
+ export default Panel;
@@ -0,0 +1,141 @@
1
+ import React from "react";
2
+ import { Container } from "./FloatingPanels.styles";
3
+ import Panel from "./Panel";
4
+ import PropTypes from "prop-types";
5
+ import { jsx as _jsx } from "react/jsx-runtime";
6
+ const FloatingPanels = _ref => {
7
+ let {
8
+ panels,
9
+ containerHeight,
10
+ position = {
11
+ right: 20,
12
+ top: 20
13
+ }
14
+ } = _ref;
15
+ return /*#__PURE__*/_jsx(Container, {
16
+ containerHeight: containerHeight,
17
+ position: position,
18
+ children: panels.map(panel => /*#__PURE__*/_jsx(Panel, {
19
+ ...panel,
20
+ containerHeight: containerHeight
21
+ }, panel?.id))
22
+ });
23
+ };
24
+ FloatingPanels.propTypes = {
25
+ panels: PropTypes.arrayOf(PropTypes.shape({
26
+ id: PropTypes.string.isRequired,
27
+ iconName: PropTypes.string.isRequired,
28
+ title: PropTypes.string.isRequired,
29
+ content: PropTypes.node.isRequired,
30
+ defaultExpanded: PropTypes.bool
31
+ })).isRequired,
32
+ containerHeight: PropTypes.number,
33
+ position: PropTypes.shape({
34
+ top: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
35
+ right: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
36
+ bottom: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
37
+ left: PropTypes.oneOfType([PropTypes.number, PropTypes.string])
38
+ })
39
+ };
40
+ FloatingPanels.defaultProps = {
41
+ position: {
42
+ right: 20,
43
+ top: 20
44
+ }
45
+ };
46
+ FloatingPanels.__docgenInfo = {
47
+ "description": "",
48
+ "methods": [],
49
+ "displayName": "FloatingPanels",
50
+ "props": {
51
+ "position": {
52
+ "defaultValue": {
53
+ "value": "{ right: 20, top: 20 }",
54
+ "computed": false
55
+ },
56
+ "description": "",
57
+ "type": {
58
+ "name": "shape",
59
+ "value": {
60
+ "top": {
61
+ "name": "union",
62
+ "value": [{
63
+ "name": "number"
64
+ }, {
65
+ "name": "string"
66
+ }],
67
+ "required": false
68
+ },
69
+ "right": {
70
+ "name": "union",
71
+ "value": [{
72
+ "name": "number"
73
+ }, {
74
+ "name": "string"
75
+ }],
76
+ "required": false
77
+ },
78
+ "bottom": {
79
+ "name": "union",
80
+ "value": [{
81
+ "name": "number"
82
+ }, {
83
+ "name": "string"
84
+ }],
85
+ "required": false
86
+ },
87
+ "left": {
88
+ "name": "union",
89
+ "value": [{
90
+ "name": "number"
91
+ }, {
92
+ "name": "string"
93
+ }],
94
+ "required": false
95
+ }
96
+ }
97
+ },
98
+ "required": false
99
+ },
100
+ "panels": {
101
+ "description": "",
102
+ "type": {
103
+ "name": "arrayOf",
104
+ "value": {
105
+ "name": "shape",
106
+ "value": {
107
+ "id": {
108
+ "name": "string",
109
+ "required": true
110
+ },
111
+ "iconName": {
112
+ "name": "string",
113
+ "required": true
114
+ },
115
+ "title": {
116
+ "name": "string",
117
+ "required": true
118
+ },
119
+ "content": {
120
+ "name": "node",
121
+ "required": true
122
+ },
123
+ "defaultExpanded": {
124
+ "name": "bool",
125
+ "required": false
126
+ }
127
+ }
128
+ }
129
+ },
130
+ "required": true
131
+ },
132
+ "containerHeight": {
133
+ "description": "",
134
+ "type": {
135
+ "name": "number"
136
+ },
137
+ "required": false
138
+ }
139
+ }
140
+ };
141
+ export default FloatingPanels;
@@ -306,6 +306,7 @@ const Select = /*#__PURE__*/forwardRef((props, ref) => {
306
306
  padding: "6.5px 6px 6.5px 5px",
307
307
  display: state.data.isFixed ? "none" : provided.display,
308
308
  cursor: "pointer",
309
+ alignSelf: "stretch",
309
310
  borderRadius: "0 15px 15px 0",
310
311
  transition: themeGet("transition.transitionDefault")({
311
312
  theme
@@ -203,11 +203,21 @@ export const withTagType = () => /*#__PURE__*/_jsxs(Spacer, {
203
203
  children: "product design"
204
204
  })]
205
205
  });
206
- export const smallVariant = () => /*#__PURE__*/_jsx(Tag, {
207
- selected: true,
208
- tagType: "specialist",
209
- small: true,
210
- children: "Agile Coach"
206
+ export const smallVariant = () => /*#__PURE__*/_jsxs(Spacer, {
207
+ m: "2px",
208
+ children: [/*#__PURE__*/_jsx(Tag, {
209
+ selected: true,
210
+ tagType: "specialist",
211
+ small: true,
212
+ children: "Agile Coach"
213
+ }), /*#__PURE__*/_jsx(Tag, {
214
+ selected: true,
215
+ showRemove: true,
216
+ showEdit: true,
217
+ tagType: "Project",
218
+ small: true,
219
+ children: "Infracore 2.0"
220
+ })]
211
221
  });
212
222
  export const highlightedVariant = () => /*#__PURE__*/_jsx(Tag, {
213
223
  selected: true,
@@ -20,7 +20,7 @@ const TagValue = styled.button.attrs(props => ({
20
20
  const TagValueText = styled.div.withConfig({
21
21
  displayName: "Tag__TagValueText",
22
22
  componentId: "sc-1dh2aa8-2"
23
- })(["text-decoration:", ";text-overflow:ellipsis;white-space:normal;text-align:left;line-height:", ";padding-bottom:1px;"], props => props.showStrikeThrough ? "line-through" : "none", props => props.small ? themeGet("fontSizes.0")(props) : themeGet("fontSizes.1")(props));
23
+ })(["text-decoration:", ";white-space:normal;text-align:left;line-height:", ";padding-bottom:1px;"], props => props.showStrikeThrough ? "line-through" : "none", props => props.small ? themeGet("fontSizes.0")(props) : themeGet("fontSizes.1")(props));
24
24
  const TagActionIconWrapper = styled(TagValue).withConfig({
25
25
  displayName: "Tag__TagActionIconWrapper",
26
26
  componentId: "sc-1dh2aa8-3"
@@ -28,11 +28,11 @@ const TagActionIconWrapper = styled(TagValue).withConfig({
28
28
  const TagRemoveIconWrapper = styled(TagValue).withConfig({
29
29
  displayName: "Tag__TagRemoveIconWrapper",
30
30
  componentId: "sc-1dh2aa8-4"
31
- })(["border-radius:0 15px 15px 0;padding:", ";&:focus{z-index:2;}", ""], props => props.small ? "0 8px 3px 7px" : "0 10px 3px 9px", props => props.selected ? css(["border-left:", ";&:hover{border-left:", ";}"], props => props.selected && props.highlighted ? `solid 1px ${themeGet("colors.warningDarker")(props)}` : `solid 1px ${themeGet("colors.primaryDark")(props)}`, props => props.selected && props.highlighted ? `solid 1px ${themeGet("colors.warningDarker")(props)}` : `solid 1px ${themeGet("colors.primaryDark")(props)}`) : css(["border-left:0;&:hover,&:focus{background-color:", ";border-left:0;}"], themeGet("colors.primaryLightest")(props)));
31
+ })(["border-radius:0 15px 15px 0;padding:", ";&:focus{z-index:2;}", ""], props => props.small ? "2px 8px 2px 7px" : "2px 10px 2px 9px", props => props.selected ? css(["border-left:", ";&:hover{border-left:", ";}"], props => props.selected && props.highlighted ? `solid 1px ${themeGet("colors.warningDarker")(props)}` : `solid 1px ${themeGet("colors.primaryDark")(props)}`, props => props.selected && props.highlighted ? `solid 1px ${themeGet("colors.warningDarker")(props)}` : `solid 1px ${themeGet("colors.primaryDark")(props)}`) : css(["border-left:0;&:hover,&:focus{background-color:", ";border-left:0;}"], themeGet("colors.primaryLightest")(props)));
32
32
  const TagType = styled.div.withConfig({
33
33
  displayName: "Tag__TagType",
34
34
  componentId: "sc-1dh2aa8-5"
35
- })(["text-transform:uppercase;margin-left:", ";padding:", ";line-height:1;white-space:normal;text-align:left;flex:1 1 auto;border-radius:", ";font-size:", ";background-color:", ";color:", ";"], props => props.small ? "6px" : "10px", props => props.small ? themeGet("space.2")(props) : themeGet("space.2")(props), props => themeGet("radii.1")(props), props => props.small ? "1rem" : themeGet("fontSizes.0")(props), props => props.disabled ? themeGet("colors.grey")(props) : props.selected && props.highlighted ? themeGet("colors.warningLighter")(props) : props.selected ? "rgba(0,0,0,0.25)" : themeGet("colors.primaryLightest")(props), props => props.disabled ? themeGet("colors.white")(props) : props.selected && props.highlighted ? themeGet("colors.black70")(props) : props.selected ? themeGet("colors.white")(props) : themeGet("colors.primaryDark")(props));
35
+ })(["text-transform:uppercase;margin-left:", ";padding:", ";line-height:1;white-space:nowrap;text-align:left;flex:1 1 auto;border-radius:", ";font-size:", ";background-color:", ";color:", ";"], props => props.small ? "6px" : "10px", props => props.small ? themeGet("space.2")(props) : themeGet("space.2")(props), props => themeGet("radii.1")(props), props => props.small ? "1rem" : themeGet("fontSizes.0")(props), props => props.disabled ? themeGet("colors.grey")(props) : props.selected && props.highlighted ? themeGet("colors.warningLighter")(props) : props.selected ? "rgba(0,0,0,0.25)" : themeGet("colors.primaryLightest")(props), props => props.disabled ? themeGet("colors.white")(props) : props.selected && props.highlighted ? themeGet("colors.black70")(props) : props.selected ? themeGet("colors.white")(props) : themeGet("colors.primaryDark")(props));
36
36
  const TagAvatar = styled(Avatar).withConfig({
37
37
  displayName: "Tag__TagAvatar",
38
38
  componentId: "sc-1dh2aa8-6"
@@ -60,6 +60,7 @@ export default function Tag(_ref) {
60
60
  showStrikeThrough,
61
61
  children,
62
62
  isPending,
63
+ ariaLabel,
63
64
  small,
64
65
  highlighted,
65
66
  personEntity,
@@ -77,8 +78,7 @@ export default function Tag(_ref) {
77
78
  showRemove: showRemove,
78
79
  onClick: onSelect,
79
80
  small: small,
80
- "aria-label": "Navigate to tag",
81
- title: "Navigate to tag",
81
+ "aria-label": ariaLabel,
82
82
  children: [personEntity && /*#__PURE__*/_jsx(TagAvatar, {
83
83
  selected: selected,
84
84
  highlighted: highlighted,
@@ -110,11 +110,11 @@ export default function Tag(_ref) {
110
110
  showRemove: showRemove,
111
111
  onClick: onEdit,
112
112
  small: small,
113
- "aria-label": "Edit tag",
114
- title: "Edit tag",
113
+ "aria-label": "Edit",
114
+ title: "Edit",
115
115
  children: /*#__PURE__*/_jsx(Icon, {
116
116
  icon: ["fas", "pen"],
117
- size: "xs"
117
+ size: "sm"
118
118
  })
119
119
  }), showInfo && /*#__PURE__*/_jsx(TagActionIconWrapper, {
120
120
  selected: selected,
@@ -123,11 +123,11 @@ export default function Tag(_ref) {
123
123
  onClick: onInfo,
124
124
  showInfo: showInfo,
125
125
  small: small,
126
- "aria-label": "View tag details",
127
- title: "View tag details",
126
+ "aria-label": "View details",
127
+ title: "View details",
128
128
  children: /*#__PURE__*/_jsx(Icon, {
129
129
  icon: ["fas", "info"],
130
- size: "xs"
130
+ size: "sm"
131
131
  })
132
132
  }), showRemove && /*#__PURE__*/_jsx(TagRemoveIconWrapper, {
133
133
  selected: selected,
@@ -135,11 +135,11 @@ export default function Tag(_ref) {
135
135
  disabled: disabled,
136
136
  onClick: onRemove,
137
137
  small: small,
138
- "aria-label": "Remove tag",
139
- title: "Remove tag",
138
+ "aria-label": "Remove",
139
+ title: "Remove",
140
140
  children: /*#__PURE__*/_jsx(Icon, {
141
141
  icon: ["fas", "times"],
142
- size: "xs"
142
+ size: "sm"
143
143
  })
144
144
  })]
145
145
  });
@@ -183,7 +183,9 @@ Tag.propTypes = {
183
183
  /** Applies a highlighted style and colour to the tag */
184
184
  highlighted: PropTypes.bool,
185
185
  /** Allows you to set a person avatar image or initials */
186
- personEntity: PropTypes.object
186
+ personEntity: PropTypes.object,
187
+ /** Add ariaLabel text describing to screen readers what this tag button does when pressed. e.g. Apply filter or Navigate to tag. */
188
+ ariaLabel: PropTypes.string.isRequired
187
189
  };
188
190
  Tag.defaultProps = {
189
191
  selected: false,
@@ -365,6 +367,13 @@ Tag.__docgenInfo = {
365
367
  "name": "object"
366
368
  },
367
369
  "required": false
370
+ },
371
+ "ariaLabel": {
372
+ "description": "Add ariaLabel text describing to screen readers what this tag button does when pressed. e.g. Apply filter or Navigate to tag.",
373
+ "type": {
374
+ "name": "string"
375
+ },
376
+ "required": true
368
377
  }
369
378
  }
370
379
  };
@@ -21,6 +21,7 @@ test("all components exported", () => {
21
21
  "Expandable",
22
22
  "Flex",
23
23
  "FlexItem",
24
+ "FloatingPanels",
24
25
  "GlobalStyles",
25
26
  "Grid",
26
27
  "GridItem",
package/es/index.js CHANGED
@@ -20,6 +20,7 @@ export { default as Divider } from "./components/Divider";
20
20
  export { default as Expandable } from "./components/Expandable";
21
21
  export { default as Flex, FlexItem } from "./components/Flex";
22
22
  export { default as Grid, GridItem } from "./components/Grid";
23
+ export { default as FloatingPanels } from "./components/FloatingPanels";
23
24
  export { default as Header } from "./components/Header";
24
25
  export { default as HeaderSimple } from "./components/HeaderSimple";
25
26
  export { default as Icon } from "./components/Icon";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "orcs-design-system",
3
- "version": "3.2.46",
3
+ "version": "3.2.48",
4
4
  "engines": {
5
5
  "node": "20.12.2"
6
6
  },