orcs-design-system 2.1.5 → 2.1.7
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.
|
@@ -259,6 +259,67 @@ export var customActionsMenu = function customActionsMenu() {
|
|
|
259
259
|
return /*#__PURE__*/React.createElement(AdvancedActionsMenu, null);
|
|
260
260
|
};
|
|
261
261
|
customActionsMenu.storyName = "Custom Actions Menu";
|
|
262
|
+
export var textButtonActionsMenu = function textButtonActionsMenu() {
|
|
263
|
+
var TextButtonActionsMenu = function TextButtonActionsMenu() {
|
|
264
|
+
var _useState9 = useState(false),
|
|
265
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
266
|
+
toggleState = _useState10[0],
|
|
267
|
+
setToggle = _useState10[1];
|
|
268
|
+
|
|
269
|
+
var menuItemsRef = useRef(null);
|
|
270
|
+
|
|
271
|
+
var closeMenu = function closeMenu() {
|
|
272
|
+
setToggle(false);
|
|
273
|
+
};
|
|
274
|
+
|
|
275
|
+
var resetAndCloseMenu = function resetAndCloseMenu() {
|
|
276
|
+
if (menuItemsRef.current) {
|
|
277
|
+
menuItemsRef.current.reset();
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
closeMenu();
|
|
281
|
+
};
|
|
282
|
+
|
|
283
|
+
var menuRef = useOnclickOutside(resetAndCloseMenu, {
|
|
284
|
+
disabled: !toggleState
|
|
285
|
+
});
|
|
286
|
+
|
|
287
|
+
var onToggle = function onToggle(e) {
|
|
288
|
+
e.stopPropagation();
|
|
289
|
+
setToggle(!toggleState);
|
|
290
|
+
};
|
|
291
|
+
|
|
292
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
293
|
+
ref: menuRef
|
|
294
|
+
}, /*#__PURE__*/React.createElement(ActionsMenuBody, {
|
|
295
|
+
toggleState: toggleState,
|
|
296
|
+
onToggle: onToggle,
|
|
297
|
+
direction: "right",
|
|
298
|
+
menuTopPosition: "30px",
|
|
299
|
+
menuLeftPosition: "0",
|
|
300
|
+
menuWidth: "120px",
|
|
301
|
+
customTriggerComponent: /*#__PURE__*/React.createElement(Button, {
|
|
302
|
+
variant: "ghost",
|
|
303
|
+
type: "button",
|
|
304
|
+
iconRight: true,
|
|
305
|
+
small: true
|
|
306
|
+
}, "Contact via...", /*#__PURE__*/React.createElement(Icon, {
|
|
307
|
+
icon: ["fas", "chevron-down"]
|
|
308
|
+
}))
|
|
309
|
+
}, /*#__PURE__*/React.createElement(ActionsMenuItem, {
|
|
310
|
+
href: "#"
|
|
311
|
+
}, "Email"), /*#__PURE__*/React.createElement(ActionsMenuItem, {
|
|
312
|
+
href: "#"
|
|
313
|
+
}, "Phone"), /*#__PURE__*/React.createElement(ActionsMenuItem, {
|
|
314
|
+
href: "#"
|
|
315
|
+
}, "MS Teams"), /*#__PURE__*/React.createElement(ActionsMenuItem, {
|
|
316
|
+
href: "#"
|
|
317
|
+
}, "Slack")));
|
|
318
|
+
};
|
|
319
|
+
|
|
320
|
+
return /*#__PURE__*/React.createElement(TextButtonActionsMenu, null);
|
|
321
|
+
};
|
|
322
|
+
textButtonActionsMenu.storyName = "Text Button Actions Menu";
|
|
262
323
|
defaultActionsMenu.__docgenInfo = {
|
|
263
324
|
"description": "",
|
|
264
325
|
"methods": [],
|
|
@@ -278,4 +339,9 @@ customActionsMenu.__docgenInfo = {
|
|
|
278
339
|
"description": "",
|
|
279
340
|
"methods": [],
|
|
280
341
|
"displayName": "customActionsMenu"
|
|
342
|
+
};
|
|
343
|
+
textButtonActionsMenu.__docgenInfo = {
|
|
344
|
+
"description": "",
|
|
345
|
+
"methods": [],
|
|
346
|
+
"displayName": "textButtonActionsMenu"
|
|
281
347
|
};
|
|
@@ -45,10 +45,14 @@ var Icon = styled.div.withConfig({
|
|
|
45
45
|
var Menu = styled.div.withConfig({
|
|
46
46
|
displayName: "ActionsMenu__Menu",
|
|
47
47
|
componentId: "yvbni2-3"
|
|
48
|
-
})(["display:inline-block;position:absolute;left:", ";right:", ";top:
|
|
49
|
-
return props.direction == "left" ? "auto" : "34px";
|
|
48
|
+
})(["display:inline-block;position:absolute;left:", ";right:", ";top:", ";width:", ";z-index:5;background-color:", ";border-radius:", ";transform:scale(0);opacity:0;pointer-events:none;overflow:hidden;transform-origin:", ";transition:all 300ms;transition-timing-function:cubic-bezier(0,1.4,1,1);", ";"], function (props) {
|
|
49
|
+
return props.menuLeftPosition ? props.menuLeftPosition : props.direction == "left" ? "auto" : "34px";
|
|
50
50
|
}, function (props) {
|
|
51
|
-
return props.direction == "left" ? "34px" : "auto";
|
|
51
|
+
return props.menuRightPosition ? props.menuRightPosition : props.direction == "left" ? "34px" : "auto";
|
|
52
|
+
}, function (props) {
|
|
53
|
+
return props.menuTopPosition ? props.menuTopPosition : "0";
|
|
54
|
+
}, function (props) {
|
|
55
|
+
return props.menuWidth ? props.menuWidth : "auto";
|
|
52
56
|
}, function (props) {
|
|
53
57
|
return themeGet("colors.greyDarker")(props);
|
|
54
58
|
}, function (props) {
|
|
@@ -113,9 +117,13 @@ export var ActionsMenuBody = function ActionsMenuBody(_ref) {
|
|
|
113
117
|
onToggle = _ref.onToggle,
|
|
114
118
|
toggleState = _ref.toggleState,
|
|
115
119
|
direction = _ref.direction,
|
|
120
|
+
menuTopPosition = _ref.menuTopPosition,
|
|
121
|
+
menuLeftPosition = _ref.menuLeftPosition,
|
|
122
|
+
menuRightPosition = _ref.menuRightPosition,
|
|
123
|
+
menuWidth = _ref.menuWidth,
|
|
116
124
|
customTriggerComponent = _ref.customTriggerComponent,
|
|
117
125
|
children = _ref.children,
|
|
118
|
-
props = _objectWithoutProperties(_ref, ["theme", "onToggle", "toggleState", "direction", "customTriggerComponent", "children"]);
|
|
126
|
+
props = _objectWithoutProperties(_ref, ["theme", "onToggle", "toggleState", "direction", "menuTopPosition", "menuLeftPosition", "menuRightPosition", "menuWidth", "customTriggerComponent", "children"]);
|
|
119
127
|
|
|
120
128
|
var triggerBtn = null;
|
|
121
129
|
|
|
@@ -133,7 +141,11 @@ export var ActionsMenuBody = function ActionsMenuBody(_ref) {
|
|
|
133
141
|
|
|
134
142
|
var component = /*#__PURE__*/React.createElement(Wrapper, props, triggerBtn, /*#__PURE__*/React.createElement(Menu, {
|
|
135
143
|
isOpen: toggleState,
|
|
136
|
-
direction: direction
|
|
144
|
+
direction: direction,
|
|
145
|
+
menuTopPosition: menuTopPosition,
|
|
146
|
+
menuLeftPosition: menuLeftPosition,
|
|
147
|
+
menuRightPosition: menuRightPosition,
|
|
148
|
+
menuWidth: menuWidth
|
|
137
149
|
}, children));
|
|
138
150
|
return theme ? /*#__PURE__*/React.createElement(ThemeProvider, {
|
|
139
151
|
theme: theme
|
|
@@ -143,6 +155,10 @@ ActionsMenuBody.propTypes = {
|
|
|
143
155
|
onToggle: PropTypes.func.isRequired,
|
|
144
156
|
toggleState: PropTypes.bool.isRequired,
|
|
145
157
|
direction: PropTypes.string,
|
|
158
|
+
menuTopPosition: PropTypes.string,
|
|
159
|
+
menuLeftPosition: PropTypes.string,
|
|
160
|
+
menuRightPosition: PropTypes.string,
|
|
161
|
+
menuWidth: PropTypes.string,
|
|
146
162
|
customTriggerComponent: PropTypes.node,
|
|
147
163
|
children: PropTypes.oneOfType([PropTypes.node, PropTypes.arrayOf(PropTypes.node)]),
|
|
148
164
|
theme: PropTypes.object
|
|
@@ -307,6 +323,34 @@ ActionsMenuBody.__docgenInfo = {
|
|
|
307
323
|
"required": false,
|
|
308
324
|
"description": ""
|
|
309
325
|
},
|
|
326
|
+
"menuTopPosition": {
|
|
327
|
+
"type": {
|
|
328
|
+
"name": "string"
|
|
329
|
+
},
|
|
330
|
+
"required": false,
|
|
331
|
+
"description": ""
|
|
332
|
+
},
|
|
333
|
+
"menuLeftPosition": {
|
|
334
|
+
"type": {
|
|
335
|
+
"name": "string"
|
|
336
|
+
},
|
|
337
|
+
"required": false,
|
|
338
|
+
"description": ""
|
|
339
|
+
},
|
|
340
|
+
"menuRightPosition": {
|
|
341
|
+
"type": {
|
|
342
|
+
"name": "string"
|
|
343
|
+
},
|
|
344
|
+
"required": false,
|
|
345
|
+
"description": ""
|
|
346
|
+
},
|
|
347
|
+
"menuWidth": {
|
|
348
|
+
"type": {
|
|
349
|
+
"name": "string"
|
|
350
|
+
},
|
|
351
|
+
"required": false,
|
|
352
|
+
"description": ""
|
|
353
|
+
},
|
|
310
354
|
"customTriggerComponent": {
|
|
311
355
|
"type": {
|
|
312
356
|
"name": "node"
|
|
@@ -147,7 +147,24 @@ export var subtitleContent = function subtitleContent() {
|
|
|
147
147
|
}, "Scrum Master")))
|
|
148
148
|
}));
|
|
149
149
|
};
|
|
150
|
-
subtitleContent.storyName = "
|
|
150
|
+
subtitleContent.storyName = "Custom subtitle content";
|
|
151
|
+
export var localTime = function localTime() {
|
|
152
|
+
return /*#__PURE__*/React.createElement(Spacer, {
|
|
153
|
+
my: 4
|
|
154
|
+
}, /*#__PURE__*/React.createElement(Avatar, {
|
|
155
|
+
sizing: "large",
|
|
156
|
+
title: /*#__PURE__*/React.createElement(StyledLink, {
|
|
157
|
+
href: "#"
|
|
158
|
+
}, "Ayden Lundgre"),
|
|
159
|
+
initials: "AL",
|
|
160
|
+
image: "https://uploads-ssl.webflow.com/5f4852427e784b4cada3e0d0/62f1f587bc47b25676f9ed1d_bw_avatar_adam.png",
|
|
161
|
+
subtitleContent: /*#__PURE__*/React.createElement(Badge, {
|
|
162
|
+
mt: "xs"
|
|
163
|
+
}, "Senior Business Analyst"),
|
|
164
|
+
localTime: "12:03pm local time"
|
|
165
|
+
}));
|
|
166
|
+
};
|
|
167
|
+
localTime.storyName = "With local time";
|
|
151
168
|
export var inverted = function inverted() {
|
|
152
169
|
return /*#__PURE__*/React.createElement(Box, {
|
|
153
170
|
bg: "greyDarkest",
|
|
@@ -324,6 +341,11 @@ subtitleContent.__docgenInfo = {
|
|
|
324
341
|
"methods": [],
|
|
325
342
|
"displayName": "subtitleContent"
|
|
326
343
|
};
|
|
344
|
+
localTime.__docgenInfo = {
|
|
345
|
+
"description": "",
|
|
346
|
+
"methods": [],
|
|
347
|
+
"displayName": "localTime"
|
|
348
|
+
};
|
|
327
349
|
inverted.__docgenInfo = {
|
|
328
350
|
"description": "",
|
|
329
351
|
"methods": [],
|
|
@@ -6,6 +6,8 @@ import { space, layout, variant } from "styled-system";
|
|
|
6
6
|
import PropTypes from "prop-types";
|
|
7
7
|
import { H3, Text } from "../Typography";
|
|
8
8
|
import Icon from "../Icon";
|
|
9
|
+
import Popover from "../Popover";
|
|
10
|
+
import StatusDot from "../StatusDot";
|
|
9
11
|
import css from "@styled-system/css";
|
|
10
12
|
import { themeGet } from "@styled-system/theme-get";
|
|
11
13
|
var AvatarWrapper = styled("div").withConfig({
|
|
@@ -13,6 +15,7 @@ var AvatarWrapper = styled("div").withConfig({
|
|
|
13
15
|
componentId: "sc-1wtet2j-0"
|
|
14
16
|
})(layout, space, css({
|
|
15
17
|
boxSizing: "border-box",
|
|
18
|
+
position: "relative",
|
|
16
19
|
display: "flex",
|
|
17
20
|
alignItems: "center"
|
|
18
21
|
}), function (props) {
|
|
@@ -269,6 +272,10 @@ var Subtitle = styled(Text).withConfig({
|
|
|
269
272
|
}
|
|
270
273
|
});
|
|
271
274
|
});
|
|
275
|
+
var LocalTime = styled(Popover).withConfig({
|
|
276
|
+
displayName: "Avatar__LocalTime",
|
|
277
|
+
componentId: "sc-1wtet2j-6"
|
|
278
|
+
})(["position:absolute;top:0;left:0;"]);
|
|
272
279
|
|
|
273
280
|
var Avatar = function Avatar(_ref) {
|
|
274
281
|
var sizing = _ref.sizing,
|
|
@@ -280,10 +287,11 @@ var Avatar = function Avatar(_ref) {
|
|
|
280
287
|
type = _ref.type,
|
|
281
288
|
theme = _ref.theme,
|
|
282
289
|
shape = _ref.shape,
|
|
290
|
+
localTime = _ref.localTime,
|
|
283
291
|
_ref$uppercase = _ref.uppercase,
|
|
284
292
|
uppercase = _ref$uppercase === void 0 ? true : _ref$uppercase,
|
|
285
293
|
whiteInitials = _ref.whiteInitials,
|
|
286
|
-
props = _objectWithoutProperties(_ref, ["sizing", "image", "initials", "title", "subtitle", "subtitleContent", "type", "theme", "shape", "uppercase", "whiteInitials"]);
|
|
294
|
+
props = _objectWithoutProperties(_ref, ["sizing", "image", "initials", "title", "subtitle", "subtitleContent", "type", "theme", "shape", "localTime", "uppercase", "whiteInitials"]);
|
|
287
295
|
|
|
288
296
|
var hasTitle = !!title;
|
|
289
297
|
var hasSubtitle = !!subtitle;
|
|
@@ -321,7 +329,19 @@ var Avatar = function Avatar(_ref) {
|
|
|
321
329
|
}, title), hasSubtitle && /*#__PURE__*/React.createElement(Subtitle, {
|
|
322
330
|
type: type,
|
|
323
331
|
sizing: sizing
|
|
324
|
-
}, subtitle), hasSubtitleContent && subtitleContent)
|
|
332
|
+
}, subtitle), hasSubtitleContent && subtitleContent), localTime && /*#__PURE__*/React.createElement(LocalTime, {
|
|
333
|
+
direction: "topRight",
|
|
334
|
+
textAlign: "center",
|
|
335
|
+
width: "130px",
|
|
336
|
+
text: localTime
|
|
337
|
+
}, /*#__PURE__*/React.createElement(StatusDot, {
|
|
338
|
+
variant: "secondary",
|
|
339
|
+
icon: true
|
|
340
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
341
|
+
icon: ["fas", "clock"],
|
|
342
|
+
color: "white",
|
|
343
|
+
transform: "grow-2"
|
|
344
|
+
}))));
|
|
325
345
|
return theme ? /*#__PURE__*/React.createElement(ThemeProvider, {
|
|
326
346
|
theme: theme
|
|
327
347
|
}, component) : component;
|
|
@@ -358,6 +378,9 @@ Avatar.propTypes = {
|
|
|
358
378
|
/** Specifies subtitle / role */
|
|
359
379
|
subtitle: PropTypes.string,
|
|
360
380
|
|
|
381
|
+
/** Specifies local time */
|
|
382
|
+
localTime: PropTypes.string,
|
|
383
|
+
|
|
361
384
|
/** Specifies the colour theme */
|
|
362
385
|
theme: PropTypes.object
|
|
363
386
|
};
|
|
@@ -485,6 +508,13 @@ Avatar.__docgenInfo = {
|
|
|
485
508
|
"required": false,
|
|
486
509
|
"description": "Specifies subtitle / role"
|
|
487
510
|
},
|
|
511
|
+
"localTime": {
|
|
512
|
+
"type": {
|
|
513
|
+
"name": "string"
|
|
514
|
+
},
|
|
515
|
+
"required": false,
|
|
516
|
+
"description": "Specifies local time"
|
|
517
|
+
},
|
|
488
518
|
"theme": {
|
|
489
519
|
"type": {
|
|
490
520
|
"name": "object"
|
|
@@ -571,7 +571,8 @@ export default function Header(_ref) {
|
|
|
571
571
|
variant: variant
|
|
572
572
|
}, appName), currentWorkspace && /*#__PURE__*/React.createElement(Small, {
|
|
573
573
|
color: "white",
|
|
574
|
-
fontSize: "0"
|
|
574
|
+
fontSize: "0",
|
|
575
|
+
display: ["none", "none", "none", "block"]
|
|
575
576
|
}, currentWorkspace))), /*#__PURE__*/React.createElement(Spacer, {
|
|
576
577
|
ml: 4
|
|
577
578
|
}, children), searchComponent && /*#__PURE__*/React.createElement(SearchContainer, null, searchComponent), /*#__PURE__*/React.createElement(Flex, {
|