orcs-design-system 3.2.4 → 3.2.6
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.
- package/es/GlobalStyles.js +1 -31
- package/es/SystemThemeProvider.js +11 -5
- package/es/assets/Colour/Colour.stories.js +211 -0
- package/es/assets/Colour/index.js +3 -3
- package/es/components/ActionsMenu/ActionsMenu.stories.js +260 -233
- package/es/components/ActionsMenu/index.js +144 -229
- package/es/components/Avatar/Avatar.stories.js +212 -196
- package/es/components/Avatar/index.js +280 -307
- package/es/components/Badge/Badge.stories.js +71 -46
- package/es/components/Badge/index.js +71 -74
- package/es/components/Box/Box.stories.js +51 -35
- package/es/components/Box/index.js +33 -34
- package/es/components/Button/Button.stories.js +161 -145
- package/es/components/Button/ButtonLink.stories.js +152 -139
- package/es/components/Button/index.js +79 -99
- package/es/components/ButtonGroup/ButtonGroup.stories.js +43 -42
- package/es/components/ButtonGroup/ButtonGroupItem.stories.js +11 -13
- package/es/components/ButtonGroup/index.js +103 -99
- package/es/components/Card/Card.stories.js +94 -62
- package/es/components/Card/index.js +50 -71
- package/es/components/Checkbox/Checkbox.stories.js +37 -43
- package/es/components/Checkbox/index.js +61 -76
- package/es/components/DatePicker/DatePicker.stories.js +86 -118
- package/es/components/DatePicker/index.js +71 -187
- package/es/components/Divider/Divider.stories.js +39 -42
- package/es/components/Divider/index.js +21 -27
- package/es/components/Expandable/Expandable.stories.js +46 -36
- package/es/components/Expandable/index.js +55 -82
- package/es/components/Flex/Flex.stories.js +19 -5
- package/es/components/Flex/FlexItem.stories.js +10 -9
- package/es/components/Flex/index.js +34 -27
- package/es/components/Grid/Grid.stories.js +129 -55
- package/es/components/Grid/index.js +25 -24
- package/es/components/Header/Header.stories.js +101 -92
- package/es/components/Header/index.js +433 -436
- package/es/components/HeaderSimple/HeaderSimple.stories.js +23 -27
- package/es/components/HeaderSimple/index.js +73 -68
- package/es/components/Icon/Icon.stories.js +58 -57
- package/es/components/Icon/index.js +48 -46
- package/es/components/Loading/Loading.stories.js +32 -39
- package/es/components/Loading/index.js +44 -51
- package/es/components/Modal/Modal.stories.js +172 -153
- package/es/components/Modal/index.js +126 -134
- package/es/components/Notification/Notification.stories.js +59 -58
- package/es/components/Notification/index.js +123 -133
- package/es/components/Popover/Popover.stories.js +134 -102
- package/es/components/Popover/index.js +65 -111
- package/es/components/ProgressBar/ProgressBar.stories.js +36 -39
- package/es/components/ProgressBar/index.js +29 -34
- package/es/components/RadioButton/RadioButton.stories.js +32 -37
- package/es/components/RadioButton/index.js +170 -184
- package/es/components/Range/Range.stories.js +19 -19
- package/es/components/Range/index.js +35 -45
- package/es/components/Select/Select.stories.js +107 -128
- package/es/components/Select/index.js +324 -336
- package/es/components/SideNav/NavItem.js +112 -122
- package/es/components/SideNav/SideNav.stories.js +84 -57
- package/es/components/SideNav/index.js +161 -185
- package/es/components/Sidebar/Sidebar.stories.js +50 -33
- package/es/components/Sidebar/index.js +152 -155
- package/es/components/Spacer/Spacer.stories.js +35 -32
- package/es/components/Spacer/index.js +20 -20
- package/es/components/StatusDot/StatusDot.stories.js +103 -90
- package/es/components/StatusDot/index.js +36 -38
- package/es/components/StyledLink/StyledLink.stories.js +68 -69
- package/es/components/StyledLink/index.js +47 -48
- package/es/components/Table/Table.stories.js +118 -112
- package/es/components/Table/getExpandColumnConfig.js +67 -62
- package/es/components/Table/index.js +24 -27
- package/es/components/Table/muiStyleOverrides.js +10 -8
- package/es/components/Tabs/Tab.stories.js +55 -38
- package/es/components/Tabs/TabsContainer.stories.js +30 -22
- package/es/components/Tabs/index.js +95 -92
- package/es/components/Tag/Tag.stories.js +250 -220
- package/es/components/Tag/index.js +118 -190
- package/es/components/TextArea/TextArea.stories.js +76 -89
- package/es/components/TextArea/index.js +117 -115
- package/es/components/TextInput/TextInput.stories.js +41 -61
- package/es/components/TextInput/index.js +127 -171
- package/es/components/Toggle/Toggle.stories.js +63 -62
- package/es/components/Toggle/index.js +43 -77
- package/es/components/TreeNav/TreeNav.stories.js +7 -8
- package/es/components/TreeNav/index.js +72 -69
- package/es/components/Typography/Typography.stories.js +174 -0
- package/es/components/Typography/index.js +252 -308
- package/es/components.test.js +1 -1
- package/es/hooks/isVisible.js +6 -10
- package/es/hooks/keepInView.js +27 -32
- package/es/hooks/keypress.js +14 -14
- package/es/hooks/useInputFocus.js +5 -5
- package/es/hooks/usePrevious.js +3 -3
- package/es/systemThemeCollapsed.js +53 -53
- package/es/systemtheme.js +53 -53
- package/es/utils/selectUtil.js +1 -1
- package/es/utils/selectUtil.test.js +6 -6
- package/package.json +29 -38
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
1
|
import React, { useRef, useState, useImperativeHandle } from "react";
|
|
3
2
|
import PropTypes from "prop-types";
|
|
4
3
|
import { Link } from "react-router-dom";
|
|
@@ -11,136 +10,145 @@ import Icon from "../Icon";
|
|
|
11
10
|
import Box from "../Box";
|
|
12
11
|
import Button from "../Button";
|
|
13
12
|
import TextArea from "../TextArea";
|
|
13
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
14
14
|
export default {
|
|
15
15
|
title: "Components/ActionsMenu",
|
|
16
|
-
decorators: [
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}],
|
|
16
|
+
decorators: [storyFn => /*#__PURE__*/_jsx(Box, {
|
|
17
|
+
pb: "150px",
|
|
18
|
+
children: storyFn()
|
|
19
|
+
})],
|
|
21
20
|
component: ActionsMenu
|
|
22
21
|
};
|
|
23
|
-
export
|
|
24
|
-
|
|
25
|
-
href: "https://orchestrated.io/"
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
22
|
+
export const defaultActionsMenu = () => /*#__PURE__*/_jsxs(ActionsMenu, {
|
|
23
|
+
children: [/*#__PURE__*/_jsx(ActionsMenuItem, {
|
|
24
|
+
href: "https://orchestrated.io/",
|
|
25
|
+
children: "Open details page"
|
|
26
|
+
}), /*#__PURE__*/_jsx(BrowserRouter, {
|
|
27
|
+
children: /*#__PURE__*/_jsx(ActionsMenuItem, {
|
|
28
|
+
as: Link,
|
|
29
|
+
to: "/",
|
|
30
|
+
children: "Edit"
|
|
31
|
+
})
|
|
32
|
+
}), /*#__PURE__*/_jsx(ActionsMenuItem, {
|
|
33
|
+
onClick: action("clicked"),
|
|
34
|
+
children: "Remove"
|
|
35
|
+
})]
|
|
36
|
+
});
|
|
33
37
|
defaultActionsMenu.storyName = "Default";
|
|
34
|
-
export
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}, /*#__PURE__*/React.createElement(ActionsMenu, {
|
|
38
|
+
export const leftOffsetActionsMenu = () => /*#__PURE__*/_jsx(Flex, {
|
|
39
|
+
justifyContent: "flex-end",
|
|
40
|
+
children: /*#__PURE__*/_jsxs(ActionsMenu, {
|
|
38
41
|
ariaLabel: "Options Menu",
|
|
39
|
-
direction: "left"
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
42
|
+
direction: "left",
|
|
43
|
+
children: [/*#__PURE__*/_jsx(ActionsMenuItem, {
|
|
44
|
+
href: "https://orchestrated.io/",
|
|
45
|
+
children: "Open details page"
|
|
46
|
+
}), /*#__PURE__*/_jsx(BrowserRouter, {
|
|
47
|
+
children: /*#__PURE__*/_jsx(ActionsMenuItem, {
|
|
48
|
+
as: Link,
|
|
49
|
+
to: "/",
|
|
50
|
+
children: "Edit"
|
|
51
|
+
})
|
|
52
|
+
}), /*#__PURE__*/_jsx(ActionsMenuItem, {
|
|
53
|
+
onClick: action("clicked"),
|
|
54
|
+
children: "Remove"
|
|
55
|
+
})]
|
|
56
|
+
})
|
|
57
|
+
});
|
|
49
58
|
leftOffsetActionsMenu.storyName = "Left offset";
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
selectedReason = _useState4[0],
|
|
60
|
-
setSelectedReason = _useState4[1];
|
|
61
|
-
var _useState5 = useState(""),
|
|
62
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
63
|
-
otherReason = _useState6[0],
|
|
64
|
-
setOtherReason = _useState6[1];
|
|
65
|
-
var reset = function reset() {
|
|
59
|
+
const MenuItems = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
60
|
+
let {
|
|
61
|
+
closeMenu,
|
|
62
|
+
reasons
|
|
63
|
+
} = _ref;
|
|
64
|
+
const [showOther, setShowOther] = useState(false);
|
|
65
|
+
const [selectedReason, setSelectedReason] = useState(null);
|
|
66
|
+
const [otherReason, setOtherReason] = useState("");
|
|
67
|
+
const reset = () => {
|
|
66
68
|
setShowOther(false);
|
|
67
69
|
};
|
|
68
|
-
|
|
70
|
+
const resetAndCloseMenu = () => {
|
|
69
71
|
reset();
|
|
70
72
|
closeMenu();
|
|
71
73
|
};
|
|
72
|
-
useImperativeHandle(ref,
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
});
|
|
77
|
-
var clickOther = function clickOther() {
|
|
74
|
+
useImperativeHandle(ref, () => ({
|
|
75
|
+
reset
|
|
76
|
+
}));
|
|
77
|
+
const clickOther = () => {
|
|
78
78
|
setSelectedReason("other");
|
|
79
79
|
setShowOther(true);
|
|
80
80
|
};
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
resetAndCloseMenu();
|
|
87
|
-
};
|
|
81
|
+
const setReason = id => () => {
|
|
82
|
+
// TODO: Make the call to back end
|
|
83
|
+
setSelectedReason(id);
|
|
84
|
+
setOtherReason("");
|
|
85
|
+
resetAndCloseMenu();
|
|
88
86
|
};
|
|
89
|
-
|
|
87
|
+
const onOtherReasonChange = e => {
|
|
90
88
|
setOtherReason(e.target.value);
|
|
91
89
|
};
|
|
92
|
-
return /*#__PURE__*/
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
90
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
91
|
+
children: [/*#__PURE__*/_jsxs(ActionsMenuHeading, {
|
|
92
|
+
onClick: reset,
|
|
93
|
+
canClick: showOther,
|
|
94
|
+
children: [showOther && /*#__PURE__*/_jsx(Icon, {
|
|
95
|
+
icon: ["fas", "angle-left"],
|
|
96
|
+
mr: "xs"
|
|
97
|
+
}), " Select reason"]
|
|
98
|
+
}), !showOther && /*#__PURE__*/_jsx(_Fragment, {
|
|
99
|
+
children: reasons.map(_ref2 => {
|
|
100
|
+
let {
|
|
101
|
+
id,
|
|
102
|
+
label
|
|
103
|
+
} = _ref2;
|
|
104
|
+
if (id === "other") {
|
|
105
|
+
return /*#__PURE__*/_jsx(ActionsMenuItem, {
|
|
106
|
+
type: "button",
|
|
107
|
+
selected: selectedReason === id,
|
|
108
|
+
onClick: clickOther,
|
|
109
|
+
children: /*#__PURE__*/_jsxs(Flex, {
|
|
110
|
+
alignItems: "center",
|
|
111
|
+
justifyContent: "space-between",
|
|
112
|
+
children: [label, /*#__PURE__*/_jsx(Icon, {
|
|
113
|
+
icon: ["fas", "pen"],
|
|
114
|
+
size: "sm"
|
|
115
|
+
})]
|
|
116
|
+
})
|
|
117
|
+
}, id);
|
|
118
|
+
}
|
|
119
|
+
return /*#__PURE__*/_jsx(ActionsMenuItem, {
|
|
120
|
+
type: "button",
|
|
121
|
+
selected: selectedReason === id,
|
|
122
|
+
onClick: setReason(id),
|
|
123
|
+
children: label
|
|
124
|
+
}, id);
|
|
125
|
+
})
|
|
126
|
+
}), showOther && /*#__PURE__*/_jsxs(Box, {
|
|
127
|
+
id: "editableContent",
|
|
128
|
+
p: "s",
|
|
129
|
+
children: [/*#__PURE__*/_jsx(TextArea, {
|
|
130
|
+
inverted: true,
|
|
131
|
+
id: "TextArea01",
|
|
132
|
+
label: "Reason for rejection",
|
|
133
|
+
cols: "35",
|
|
134
|
+
rows: "3",
|
|
135
|
+
defaultValue: otherReason,
|
|
136
|
+
onChange: onOtherReasonChange
|
|
137
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
138
|
+
onClick: resetAndCloseMenu,
|
|
139
|
+
small: true,
|
|
140
|
+
variant: "danger",
|
|
141
|
+
mt: "s",
|
|
142
|
+
children: "Reject request"
|
|
143
|
+
})]
|
|
144
|
+
})]
|
|
145
|
+
});
|
|
138
146
|
});
|
|
139
147
|
MenuItems.propTypes = {
|
|
140
148
|
closeMenu: PropTypes.bool,
|
|
141
149
|
reasons: PropTypes.array
|
|
142
150
|
};
|
|
143
|
-
|
|
151
|
+
const Reasons = [{
|
|
144
152
|
id: "tooMany",
|
|
145
153
|
label: "Too many people"
|
|
146
154
|
}, {
|
|
@@ -153,173 +161,192 @@ var Reasons = [{
|
|
|
153
161
|
id: "other",
|
|
154
162
|
label: "Other"
|
|
155
163
|
}];
|
|
156
|
-
export
|
|
157
|
-
|
|
158
|
-
|
|
164
|
+
export const advancedActionsMenu = () => {
|
|
165
|
+
const ref = /*#__PURE__*/React.createRef(null);
|
|
166
|
+
const closeMenu = () => {
|
|
159
167
|
if (ref.current) {
|
|
160
168
|
ref.current.closeMenu();
|
|
161
169
|
}
|
|
162
170
|
};
|
|
163
|
-
return /*#__PURE__*/
|
|
164
|
-
justifyContent: "flex-end"
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
171
|
+
return /*#__PURE__*/_jsx(Flex, {
|
|
172
|
+
justifyContent: "flex-end",
|
|
173
|
+
children: /*#__PURE__*/_jsx(ActionsMenu, {
|
|
174
|
+
ref: ref,
|
|
175
|
+
direction: "left",
|
|
176
|
+
className: "ignore-onclickoutside",
|
|
177
|
+
customTriggerComponent: /*#__PURE__*/_jsx(Button, {
|
|
178
|
+
variant: "default",
|
|
179
|
+
iconOnly: true,
|
|
180
|
+
type: "button",
|
|
181
|
+
width: "30px",
|
|
182
|
+
height: "30px",
|
|
183
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
184
|
+
icon: ["fas", "pen"],
|
|
185
|
+
size: "sm"
|
|
186
|
+
})
|
|
187
|
+
}),
|
|
188
|
+
closeOnClick: false,
|
|
189
|
+
children: /*#__PURE__*/_jsx(MenuItems, {
|
|
190
|
+
closeMenu: closeMenu,
|
|
191
|
+
reasons: Reasons
|
|
192
|
+
})
|
|
193
|
+
})
|
|
194
|
+
});
|
|
184
195
|
};
|
|
185
196
|
advancedActionsMenu.storyName = "Advanced Actions Menu";
|
|
186
|
-
export
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
setToggle = _useState8[1];
|
|
192
|
-
var menuItemsRef = useRef(null);
|
|
193
|
-
var closeMenu = function closeMenu() {
|
|
197
|
+
export const customActionsMenu = () => {
|
|
198
|
+
const AdvancedActionsMenu = () => {
|
|
199
|
+
const [toggleState, setToggle] = useState(false);
|
|
200
|
+
const menuItemsRef = useRef(null);
|
|
201
|
+
const closeMenu = () => {
|
|
194
202
|
setToggle(false);
|
|
195
203
|
};
|
|
196
|
-
|
|
204
|
+
const resetAndCloseMenu = () => {
|
|
197
205
|
if (menuItemsRef.current) {
|
|
198
206
|
menuItemsRef.current.reset();
|
|
199
207
|
}
|
|
200
208
|
closeMenu();
|
|
201
209
|
};
|
|
202
|
-
|
|
210
|
+
const menuRef = useOnclickOutside(resetAndCloseMenu, {
|
|
203
211
|
disabled: !toggleState
|
|
204
212
|
});
|
|
205
|
-
|
|
213
|
+
const onToggle = e => {
|
|
206
214
|
e.stopPropagation();
|
|
207
215
|
setToggle(!toggleState);
|
|
208
216
|
};
|
|
209
|
-
return /*#__PURE__*/
|
|
210
|
-
ref: menuRef
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
217
|
+
return /*#__PURE__*/_jsx("div", {
|
|
218
|
+
ref: menuRef,
|
|
219
|
+
children: /*#__PURE__*/_jsx(Flex, {
|
|
220
|
+
justifyContent: "flex-end",
|
|
221
|
+
children: /*#__PURE__*/_jsx(ActionsMenuBody, {
|
|
222
|
+
toggleState: toggleState,
|
|
223
|
+
onToggle: onToggle,
|
|
224
|
+
direction: "left",
|
|
225
|
+
customTriggerComponent: /*#__PURE__*/_jsx(Button, {
|
|
226
|
+
variant: "danger",
|
|
227
|
+
iconOnly: true,
|
|
228
|
+
type: "button",
|
|
229
|
+
width: "30px",
|
|
230
|
+
height: "30px",
|
|
231
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
232
|
+
icon: ["fas", "times"]
|
|
233
|
+
})
|
|
234
|
+
}),
|
|
235
|
+
children: /*#__PURE__*/_jsx(MenuItems, {
|
|
236
|
+
ref: menuItemsRef,
|
|
237
|
+
closeMenu: closeMenu,
|
|
238
|
+
reasons: Reasons
|
|
239
|
+
})
|
|
240
|
+
})
|
|
241
|
+
})
|
|
242
|
+
});
|
|
231
243
|
};
|
|
232
|
-
return /*#__PURE__*/
|
|
244
|
+
return /*#__PURE__*/_jsx(AdvancedActionsMenu, {});
|
|
233
245
|
};
|
|
234
246
|
customActionsMenu.storyName = "Custom Actions Menu";
|
|
235
|
-
export
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
setToggle = _useState10[1];
|
|
241
|
-
var menuItemsRef = useRef(null);
|
|
242
|
-
var closeMenu = function closeMenu() {
|
|
247
|
+
export const textButtonActionsMenu = () => {
|
|
248
|
+
const TextButtonActionsMenu = () => {
|
|
249
|
+
const [toggleState, setToggle] = useState(false);
|
|
250
|
+
const menuItemsRef = useRef(null);
|
|
251
|
+
const closeMenu = () => {
|
|
243
252
|
setToggle(false);
|
|
244
253
|
};
|
|
245
|
-
|
|
254
|
+
const resetAndCloseMenu = () => {
|
|
246
255
|
if (menuItemsRef.current) {
|
|
247
256
|
menuItemsRef.current.reset();
|
|
248
257
|
}
|
|
249
258
|
closeMenu();
|
|
250
259
|
};
|
|
251
|
-
|
|
260
|
+
const menuRef = useOnclickOutside(resetAndCloseMenu, {
|
|
252
261
|
disabled: !toggleState
|
|
253
262
|
});
|
|
254
|
-
|
|
263
|
+
const onToggle = e => {
|
|
255
264
|
e.stopPropagation();
|
|
256
265
|
setToggle(!toggleState);
|
|
257
266
|
};
|
|
258
|
-
return /*#__PURE__*/
|
|
259
|
-
ref: menuRef
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
267
|
+
return /*#__PURE__*/_jsx("div", {
|
|
268
|
+
ref: menuRef,
|
|
269
|
+
children: /*#__PURE__*/_jsxs(ActionsMenuBody, {
|
|
270
|
+
toggleState: toggleState,
|
|
271
|
+
onToggle: onToggle,
|
|
272
|
+
menuTopPosition: "30px",
|
|
273
|
+
menuLeftPosition: "0",
|
|
274
|
+
menuWidth: "120px",
|
|
275
|
+
customTriggerComponent: /*#__PURE__*/_jsxs(Button, {
|
|
276
|
+
variant: "ghost",
|
|
277
|
+
type: "button",
|
|
278
|
+
iconRight: true,
|
|
279
|
+
small: true,
|
|
280
|
+
children: ["Contact via...", /*#__PURE__*/_jsx(Icon, {
|
|
281
|
+
icon: ["fas", "chevron-down"]
|
|
282
|
+
})]
|
|
283
|
+
}),
|
|
284
|
+
children: [/*#__PURE__*/_jsx(ActionsMenuItem, {
|
|
285
|
+
href: "#",
|
|
286
|
+
children: "Email"
|
|
287
|
+
}), /*#__PURE__*/_jsx(ActionsMenuItem, {
|
|
288
|
+
href: "#",
|
|
289
|
+
children: "Phone"
|
|
290
|
+
}), /*#__PURE__*/_jsx(ActionsMenuItem, {
|
|
291
|
+
href: "#",
|
|
292
|
+
children: "MS Teams"
|
|
293
|
+
}), /*#__PURE__*/_jsx(ActionsMenuItem, {
|
|
294
|
+
href: "#",
|
|
295
|
+
children: "Slack"
|
|
296
|
+
})]
|
|
297
|
+
})
|
|
298
|
+
});
|
|
283
299
|
};
|
|
284
|
-
return /*#__PURE__*/
|
|
300
|
+
return /*#__PURE__*/_jsx(TextButtonActionsMenu, {});
|
|
285
301
|
};
|
|
286
302
|
textButtonActionsMenu.storyName = "Text Button Actions Menu";
|
|
287
|
-
export
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
303
|
+
export const keepInViewExample = () => /*#__PURE__*/_jsxs(Flex, {
|
|
304
|
+
alignItems: "flex-end",
|
|
305
|
+
width: "100%",
|
|
306
|
+
flexDirection: "column",
|
|
307
|
+
children: [/*#__PURE__*/_jsxs(ActionsMenu, {
|
|
308
|
+
mb: "r",
|
|
309
|
+
children: [/*#__PURE__*/_jsx(ActionsMenuItem, {
|
|
310
|
+
href: "https://orchestrated.io/",
|
|
311
|
+
children: "Open details page"
|
|
312
|
+
}), /*#__PURE__*/_jsx(BrowserRouter, {
|
|
313
|
+
children: /*#__PURE__*/_jsx(ActionsMenuItem, {
|
|
314
|
+
as: Link,
|
|
315
|
+
to: "/",
|
|
316
|
+
children: "Edit"
|
|
317
|
+
})
|
|
318
|
+
}), /*#__PURE__*/_jsx(ActionsMenuItem, {
|
|
319
|
+
onClick: action("clicked"),
|
|
320
|
+
children: "Remove"
|
|
321
|
+
})]
|
|
322
|
+
}), /*#__PURE__*/_jsxs(ActionsMenu, {
|
|
302
323
|
menuTopPosition: "30px",
|
|
303
324
|
menuLeftPosition: "0",
|
|
304
325
|
menuWidth: "200px",
|
|
305
|
-
customTriggerComponent: /*#__PURE__*/
|
|
326
|
+
customTriggerComponent: /*#__PURE__*/_jsxs(Button, {
|
|
306
327
|
variant: "ghost",
|
|
307
328
|
type: "button",
|
|
308
329
|
iconRight: true,
|
|
309
|
-
small: true
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
330
|
+
small: true,
|
|
331
|
+
children: ["Contact via...", /*#__PURE__*/_jsx(Icon, {
|
|
332
|
+
icon: ["fas", "chevron-down"]
|
|
333
|
+
})]
|
|
334
|
+
}),
|
|
335
|
+
children: [/*#__PURE__*/_jsx(ActionsMenuItem, {
|
|
336
|
+
href: "#",
|
|
337
|
+
children: "Email"
|
|
338
|
+
}), /*#__PURE__*/_jsx(ActionsMenuItem, {
|
|
339
|
+
href: "#",
|
|
340
|
+
children: "Phone"
|
|
341
|
+
}), /*#__PURE__*/_jsx(ActionsMenuItem, {
|
|
342
|
+
href: "#",
|
|
343
|
+
children: "MS Teams"
|
|
344
|
+
}), /*#__PURE__*/_jsx(ActionsMenuItem, {
|
|
345
|
+
href: "#",
|
|
346
|
+
children: "Slack"
|
|
347
|
+
})]
|
|
348
|
+
})]
|
|
349
|
+
});
|
|
323
350
|
keepInViewExample.storyName = "Keep In View Example";
|
|
324
351
|
defaultActionsMenu.__docgenInfo = {
|
|
325
352
|
"description": "",
|