orcs-design-system 2.0.99 → 2.0.100
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/components/Avatar/index.js +38 -34
- package/es/components/Header/Header.stories.js +29 -22
- package/es/components/Header/index.js +328 -73
- package/es/components/Select/Select.stories.js +19 -5
- package/es/components/Select/index.js +22 -6
- package/es/components/StyledLink/index.js +14 -1
- package/es/components/TextInput/index.js +37 -8
- package/es/systemThemeCollapsed.js +8 -3
- package/es/systemtheme.js +6 -1
- package/package.json +1 -1
|
@@ -68,27 +68,29 @@ var Image = styled("img").withConfig({
|
|
|
68
68
|
componentId: "sc-1wtet2j-2"
|
|
69
69
|
})(function (props) {
|
|
70
70
|
return css({
|
|
71
|
-
width: "
|
|
72
|
-
height: "
|
|
71
|
+
width: themeGet("appScale.avatarDefault")(props),
|
|
72
|
+
height: themeGet("appScale.avatarDefault")(props),
|
|
73
73
|
flex: "0 0 auto",
|
|
74
74
|
backgroundColor: themeGet("colors.greyLighter")(props),
|
|
75
75
|
border: "0",
|
|
76
76
|
display: "block",
|
|
77
77
|
borderRadius: "50%"
|
|
78
78
|
});
|
|
79
|
-
},
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
79
|
+
}, function (props) {
|
|
80
|
+
return variant({
|
|
81
|
+
prop: "sizing",
|
|
82
|
+
variants: {
|
|
83
|
+
small: {
|
|
84
|
+
width: themeGet("appScale.avatarSmall")(props),
|
|
85
|
+
height: themeGet("appScale.avatarSmall")(props)
|
|
86
|
+
},
|
|
87
|
+
large: {
|
|
88
|
+
width: themeGet("appScale.avatarLarge")(props),
|
|
89
|
+
height: themeGet("appScale.avatarLarge")(props)
|
|
90
|
+
}
|
|
89
91
|
}
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
+
});
|
|
93
|
+
}, function (props) {
|
|
92
94
|
return variant({
|
|
93
95
|
prop: "shape",
|
|
94
96
|
variants: {
|
|
@@ -111,8 +113,8 @@ var Shape = styled("div").withConfig({
|
|
|
111
113
|
componentId: "sc-1wtet2j-3"
|
|
112
114
|
})(function (props) {
|
|
113
115
|
return css({
|
|
114
|
-
width: "
|
|
115
|
-
height: "
|
|
116
|
+
width: themeGet("appScale.avatarDefault")(props),
|
|
117
|
+
height: themeGet("appScale.avatarDefault")(props),
|
|
116
118
|
fontWeight: themeGet("fontWeights.2")(props),
|
|
117
119
|
flex: "0 0 auto",
|
|
118
120
|
backgroundColor: themeGet("colors.greyLighter")(props),
|
|
@@ -133,20 +135,22 @@ var Shape = styled("div").withConfig({
|
|
|
133
135
|
color: themeGet("colors.white")(props)
|
|
134
136
|
}
|
|
135
137
|
});
|
|
136
|
-
},
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
}
|
|
138
|
+
}, function (props) {
|
|
139
|
+
return variant({
|
|
140
|
+
prop: "sizing",
|
|
141
|
+
variants: {
|
|
142
|
+
small: {
|
|
143
|
+
width: themeGet("appScale.avatarSmall")(props),
|
|
144
|
+
height: themeGet("appScale.avatarSmall")(props)
|
|
145
|
+
},
|
|
146
|
+
large: {
|
|
147
|
+
width: themeGet("appScale.avatarLarge")(props),
|
|
148
|
+
height: themeGet("appScale.avatarLarge")(props)
|
|
149
|
+
},
|
|
150
|
+
"default": {}
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
}, function (props) {
|
|
150
154
|
return variant({
|
|
151
155
|
prop: "type",
|
|
152
156
|
variants: {
|
|
@@ -197,15 +201,15 @@ var Title = styled(H3).withConfig({
|
|
|
197
201
|
prop: "sizing",
|
|
198
202
|
variants: {
|
|
199
203
|
small: {
|
|
200
|
-
fontSize: themeGet("fontSizes.
|
|
204
|
+
fontSize: themeGet("fontSizes.2")(props),
|
|
201
205
|
"> a": {
|
|
202
|
-
fontSize: themeGet("fontSizes.
|
|
206
|
+
fontSize: themeGet("fontSizes.2")(props)
|
|
203
207
|
},
|
|
204
208
|
"> div > a": {
|
|
205
|
-
fontSize: themeGet("fontSizes.
|
|
209
|
+
fontSize: themeGet("fontSizes.2")(props)
|
|
206
210
|
},
|
|
207
211
|
"> div > div > a": {
|
|
208
|
-
fontSize: themeGet("fontSizes.
|
|
212
|
+
fontSize: themeGet("fontSizes.2")(props)
|
|
209
213
|
}
|
|
210
214
|
},
|
|
211
215
|
large: {
|
|
@@ -8,6 +8,7 @@ import { Small } from "../Typography";
|
|
|
8
8
|
import TextInput from "../TextInput";
|
|
9
9
|
import mdx from "./Header.mdx";
|
|
10
10
|
import Select from "../Select";
|
|
11
|
+
import Box from "../Box";
|
|
11
12
|
export default {
|
|
12
13
|
title: "Components/Header",
|
|
13
14
|
parameters: {
|
|
@@ -15,6 +16,11 @@ export default {
|
|
|
15
16
|
page: mdx
|
|
16
17
|
}
|
|
17
18
|
},
|
|
19
|
+
decorators: [function (storyFn) {
|
|
20
|
+
return /*#__PURE__*/React.createElement(Box, {
|
|
21
|
+
height: "500px"
|
|
22
|
+
}, storyFn());
|
|
23
|
+
}],
|
|
18
24
|
component: Header
|
|
19
25
|
};
|
|
20
26
|
export var defaultHeader = function defaultHeader() {
|
|
@@ -30,17 +36,6 @@ export var defaultHeader = function defaultHeader() {
|
|
|
30
36
|
icon: ["fas", "cog"],
|
|
31
37
|
mr: "s"
|
|
32
38
|
}), "Settings"),
|
|
33
|
-
internalAppSwitcherContent: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(StyledLink, {
|
|
34
|
-
href: "#",
|
|
35
|
-
target: "_blank"
|
|
36
|
-
}, "App 2 Name", /*#__PURE__*/React.createElement(Small, null, "This is a description of other app in suite")), /*#__PURE__*/React.createElement(StyledLink, {
|
|
37
|
-
href: "#",
|
|
38
|
-
target: "_blank"
|
|
39
|
-
}, "App 3 Name", /*#__PURE__*/React.createElement(Small, null, "This is a description of other app in suite"))),
|
|
40
|
-
externalAppSwitcherContent: /*#__PURE__*/React.createElement(StyledLink, {
|
|
41
|
-
href: "#",
|
|
42
|
-
target: "_blank"
|
|
43
|
-
}, "External App Name", /*#__PURE__*/React.createElement(Small, null, "This is a description of external 3rd party app")),
|
|
44
39
|
navToggleId: "defaultHeader"
|
|
45
40
|
}, /*#__PURE__*/React.createElement(StyledLink, {
|
|
46
41
|
href: "#",
|
|
@@ -79,13 +74,13 @@ export var headerWithSearch = function headerWithSearch() {
|
|
|
79
74
|
headerWithSearch.storyName = "Alternative Header with search";
|
|
80
75
|
export var headerWithWorkspaceSwitching = function headerWithWorkspaceSwitching() {
|
|
81
76
|
var options = [{
|
|
82
|
-
label: "A"
|
|
77
|
+
label: "Workspace A"
|
|
83
78
|
}, {
|
|
84
|
-
label: "B"
|
|
79
|
+
label: "Workspace B"
|
|
85
80
|
}]; // eslint-disable-next-line react-hooks/rules-of-hooks
|
|
86
81
|
|
|
87
82
|
var _useState = useState([{
|
|
88
|
-
label: "A"
|
|
83
|
+
label: "Workspace A"
|
|
89
84
|
}]),
|
|
90
85
|
_useState2 = _slicedToArray(_useState, 2),
|
|
91
86
|
selected = _useState2[0],
|
|
@@ -95,6 +90,7 @@ export var headerWithWorkspaceSwitching = function headerWithWorkspaceSwitching(
|
|
|
95
90
|
setSelected(value);
|
|
96
91
|
};
|
|
97
92
|
|
|
93
|
+
var currentWorkspace = "Workspace A";
|
|
98
94
|
var select = /*#__PURE__*/React.createElement(Select, {
|
|
99
95
|
id: "WorkspaceSelect",
|
|
100
96
|
"data-testid": "select-workspace-dropdown",
|
|
@@ -103,22 +99,33 @@ export var headerWithWorkspaceSwitching = function headerWithWorkspaceSwitching(
|
|
|
103
99
|
value: selected,
|
|
104
100
|
onChange: onChange,
|
|
105
101
|
height: "30px",
|
|
106
|
-
padding: "0 8px"
|
|
102
|
+
padding: "0 8px",
|
|
103
|
+
inverted: true
|
|
107
104
|
});
|
|
105
|
+
var internalAppLinks = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(StyledLink, {
|
|
106
|
+
href: "#",
|
|
107
|
+
target: "_blank"
|
|
108
|
+
}, "App 1 Name", /*#__PURE__*/React.createElement(Small, null, "This is a description of other app in suite")), /*#__PURE__*/React.createElement(StyledLink, {
|
|
109
|
+
href: "#",
|
|
110
|
+
target: "_blank"
|
|
111
|
+
}, "App 2 Name", /*#__PURE__*/React.createElement(Small, null, "This is a description of other app in suite")));
|
|
112
|
+
var externalAppLinks = /*#__PURE__*/React.createElement(StyledLink, {
|
|
113
|
+
href: "#",
|
|
114
|
+
target: "_blank"
|
|
115
|
+
}, "External App Name", /*#__PURE__*/React.createElement(Small, null, "This is a description of external 3rd party app"));
|
|
108
116
|
return /*#__PURE__*/React.createElement(Header, {
|
|
109
117
|
appName: "App Name",
|
|
118
|
+
currentWorkspace: currentWorkspace,
|
|
110
119
|
userName: "Michael",
|
|
111
120
|
avatarSource: "https://uploads-ssl.webflow.com/5f4852427e784b4cada3e0d0/62f1f587bc47b25676f9ed1d_bw_avatar_adam.png",
|
|
112
121
|
clientInfo: "Tenant: ci2153 Workspace: 20k-v5 [lb5ctx] UI_Version: 8c315c2 [4412] Backend_Version: dabc261 [3578]",
|
|
113
122
|
logoutFunction: action("clicked-logout"),
|
|
114
123
|
workspaceSwitcherContent: select,
|
|
115
|
-
navToggleId: "headerWithWorkspaceSwitching"
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
active: true
|
|
121
|
-
}, "Summary"));
|
|
124
|
+
navToggleId: "headerWithWorkspaceSwitching",
|
|
125
|
+
appSwitcher: true,
|
|
126
|
+
internalAppSwitcherContent: internalAppLinks,
|
|
127
|
+
externalAppSwitcherContent: externalAppLinks
|
|
128
|
+
});
|
|
122
129
|
};
|
|
123
130
|
headerWithWorkspaceSwitching.storyName = "Header with workspace switching";
|
|
124
131
|
defaultHeader.__docgenInfo = {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
import React, { useState, useEffect, useRef } from "react";
|
|
2
3
|
import PropTypes from "prop-types";
|
|
3
4
|
import styled, { ThemeProvider } from "styled-components";
|
|
4
5
|
import { space, layout, variant } from "styled-system";
|
|
@@ -42,7 +43,12 @@ var Bar = styled("header").withConfig({
|
|
|
42
43
|
});
|
|
43
44
|
}, variant({
|
|
44
45
|
variants: {
|
|
45
|
-
"default": {
|
|
46
|
+
"default": {
|
|
47
|
+
width: "5px",
|
|
48
|
+
height: "5px",
|
|
49
|
+
backgroundColor: "#fff",
|
|
50
|
+
transition: "all 200ms ease-in-out"
|
|
51
|
+
},
|
|
46
52
|
search: {
|
|
47
53
|
display: "grid",
|
|
48
54
|
gridGap: "r",
|
|
@@ -50,28 +56,206 @@ var Bar = styled("header").withConfig({
|
|
|
50
56
|
}
|
|
51
57
|
}
|
|
52
58
|
}), space);
|
|
59
|
+
var Switcher = styled("button").withConfig({
|
|
60
|
+
displayName: "Header__Switcher",
|
|
61
|
+
componentId: "yf04b-1"
|
|
62
|
+
})(css({
|
|
63
|
+
marginRight: "r",
|
|
64
|
+
cursor: "pointer",
|
|
65
|
+
appearance: "none",
|
|
66
|
+
border: "0",
|
|
67
|
+
background: "none",
|
|
68
|
+
padding: "0",
|
|
69
|
+
display: "grid",
|
|
70
|
+
gridGap: "3px",
|
|
71
|
+
gridTemplateRows: "5px 5px 5px",
|
|
72
|
+
gridTemplateColumns: "5px 5px 5px",
|
|
73
|
+
"&:hover > div": {
|
|
74
|
+
backgroundColor: "#0091ea"
|
|
75
|
+
}
|
|
76
|
+
}));
|
|
77
|
+
var SwitcherTopLeft = styled("div").withConfig({
|
|
78
|
+
displayName: "Header__SwitcherTopLeft",
|
|
79
|
+
componentId: "yf04b-2"
|
|
80
|
+
})(css({
|
|
81
|
+
width: "5px",
|
|
82
|
+
height: "5px",
|
|
83
|
+
backgroundColor: "#fff",
|
|
84
|
+
transition: "all 200ms ease-in-out"
|
|
85
|
+
}));
|
|
86
|
+
var SwitcherTopMiddle = styled("div").withConfig({
|
|
87
|
+
displayName: "Header__SwitcherTopMiddle",
|
|
88
|
+
componentId: "yf04b-3"
|
|
89
|
+
})(css({
|
|
90
|
+
width: "5px",
|
|
91
|
+
height: "5px",
|
|
92
|
+
backgroundColor: "#fff",
|
|
93
|
+
transition: "all 200ms ease-in-out"
|
|
94
|
+
}));
|
|
95
|
+
var SwitcherTopRight = styled("div").withConfig({
|
|
96
|
+
displayName: "Header__SwitcherTopRight",
|
|
97
|
+
componentId: "yf04b-4"
|
|
98
|
+
})(css({
|
|
99
|
+
width: "5px",
|
|
100
|
+
height: "5px",
|
|
101
|
+
backgroundColor: "#fff",
|
|
102
|
+
transition: "all 200ms ease-in-out"
|
|
103
|
+
}));
|
|
104
|
+
var SwitcherMiddleLeft = styled("div").withConfig({
|
|
105
|
+
displayName: "Header__SwitcherMiddleLeft",
|
|
106
|
+
componentId: "yf04b-5"
|
|
107
|
+
})(css({
|
|
108
|
+
width: "5px",
|
|
109
|
+
height: "5px",
|
|
110
|
+
backgroundColor: "#fff",
|
|
111
|
+
transition: "all 200ms ease-in-out"
|
|
112
|
+
}));
|
|
113
|
+
var SwitcherMiddleMiddle = styled("div").withConfig({
|
|
114
|
+
displayName: "Header__SwitcherMiddleMiddle",
|
|
115
|
+
componentId: "yf04b-6"
|
|
116
|
+
})(css({
|
|
117
|
+
width: "5px",
|
|
118
|
+
height: "5px",
|
|
119
|
+
backgroundColor: "#fff",
|
|
120
|
+
transition: "all 200ms ease-in-out"
|
|
121
|
+
}));
|
|
122
|
+
var SwitcherMiddleRight = styled("div").withConfig({
|
|
123
|
+
displayName: "Header__SwitcherMiddleRight",
|
|
124
|
+
componentId: "yf04b-7"
|
|
125
|
+
})(css({
|
|
126
|
+
width: "5px",
|
|
127
|
+
height: "5px",
|
|
128
|
+
backgroundColor: "#fff",
|
|
129
|
+
transition: "all 200ms ease-in-out"
|
|
130
|
+
}));
|
|
131
|
+
var SwitcherBottomLeft = styled("div").withConfig({
|
|
132
|
+
displayName: "Header__SwitcherBottomLeft",
|
|
133
|
+
componentId: "yf04b-8"
|
|
134
|
+
})(css({
|
|
135
|
+
width: "5px",
|
|
136
|
+
height: "5px",
|
|
137
|
+
backgroundColor: "#fff",
|
|
138
|
+
transition: "all 200ms ease-in-out"
|
|
139
|
+
}));
|
|
140
|
+
var SwitcherBottomMiddle = styled("div").withConfig({
|
|
141
|
+
displayName: "Header__SwitcherBottomMiddle",
|
|
142
|
+
componentId: "yf04b-9"
|
|
143
|
+
})(css({
|
|
144
|
+
width: "5px",
|
|
145
|
+
height: "5px",
|
|
146
|
+
backgroundColor: "#fff",
|
|
147
|
+
transition: "all 200ms ease-in-out"
|
|
148
|
+
}));
|
|
149
|
+
var SwitcherBottomRight = styled("div").withConfig({
|
|
150
|
+
displayName: "Header__SwitcherBottomRight",
|
|
151
|
+
componentId: "yf04b-10"
|
|
152
|
+
})(css({
|
|
153
|
+
width: "5px",
|
|
154
|
+
height: "5px",
|
|
155
|
+
backgroundColor: "#fff",
|
|
156
|
+
transition: "all 200ms ease-in-out"
|
|
157
|
+
}));
|
|
158
|
+
var AppsMenu = styled("div").withConfig({
|
|
159
|
+
displayName: "Header__AppsMenu",
|
|
160
|
+
componentId: "yf04b-11"
|
|
161
|
+
})(function (props) {
|
|
162
|
+
return css({
|
|
163
|
+
backgroundColor: props.lightAppSwitcher ? "white" : "black",
|
|
164
|
+
border: props.lightAppSwitcher ? "solid 1px rgba(0, 0, 0, 0.1)" : "none",
|
|
165
|
+
color: props.lightAppSwitcher ? "black" : "white",
|
|
166
|
+
width: "260px",
|
|
167
|
+
display: "inline-block",
|
|
168
|
+
position: "absolute",
|
|
169
|
+
cursor: "default",
|
|
170
|
+
top: "60px",
|
|
171
|
+
left: "60px",
|
|
172
|
+
padding: "s",
|
|
173
|
+
borderRadius: "6px",
|
|
174
|
+
opacity: "0",
|
|
175
|
+
pointerEvents: "none",
|
|
176
|
+
transform: "translate(-10px, -10px)",
|
|
177
|
+
userSelect: "none",
|
|
178
|
+
zIndex: "-1",
|
|
179
|
+
transition: "all 200ms ease-in-out",
|
|
180
|
+
boxShadow: themeGet("shadows.boxDefault")(props),
|
|
181
|
+
"[class^='StyledLink'], [class*=' StyledLink']": {
|
|
182
|
+
color: props.lightAppSwitcher ? themeGet("colors.black")(props) : themeGet("colors.white")(props),
|
|
183
|
+
display: "block",
|
|
184
|
+
fontWeight: themeGet("fontWeights.2")(props),
|
|
185
|
+
padding: "s",
|
|
186
|
+
borderRadius: themeGet("radii.2")(props),
|
|
187
|
+
"&:hover, &:focus": {
|
|
188
|
+
textDecoration: "none",
|
|
189
|
+
backgroundColor: props.lightAppSwitcher ? themeGet("colors.primaryLightest")(props) : themeGet("colors.primary")(props)
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
});
|
|
193
|
+
}, function (props) {
|
|
194
|
+
return props.isOpen ? css({
|
|
195
|
+
opacity: "1",
|
|
196
|
+
userSelect: "default",
|
|
197
|
+
zIndex: "2",
|
|
198
|
+
transform: "translate(0, 0)",
|
|
199
|
+
pointerEvents: "auto"
|
|
200
|
+
}) : null;
|
|
201
|
+
});
|
|
202
|
+
var WorkspaceSwitcher = styled("div").withConfig({
|
|
203
|
+
displayName: "Header__WorkspaceSwitcher",
|
|
204
|
+
componentId: "yf04b-12"
|
|
205
|
+
})(function (props) {
|
|
206
|
+
return css({
|
|
207
|
+
borderBottom: props.lightAppSwitcher ? "solid 1px rgba(0,0,0,0.1)" : "solid 1px rgba(255,255,255,0.3)",
|
|
208
|
+
paddingBottom: "s",
|
|
209
|
+
"[class^='Small'], [class*=' Small']": {
|
|
210
|
+
display: "block",
|
|
211
|
+
fontWeight: themeGet("fontWeights.1")(props)
|
|
212
|
+
}
|
|
213
|
+
});
|
|
214
|
+
});
|
|
215
|
+
var InternalAppSwitcher = styled("div").withConfig({
|
|
216
|
+
displayName: "Header__InternalAppSwitcher",
|
|
217
|
+
componentId: "yf04b-13"
|
|
218
|
+
})(function (props) {
|
|
219
|
+
return css({
|
|
220
|
+
borderBottom: props.lightAppSwitcher ? "solid 1px rgba(0,0,0,0.1)" : "solid 1px rgba(255,255,255,0.3)",
|
|
221
|
+
paddingBottom: "s",
|
|
222
|
+
marginTop: "s",
|
|
223
|
+
"[class^='Small'], [class*=' Small']": {
|
|
224
|
+
display: "block",
|
|
225
|
+
fontWeight: themeGet("fontWeights.1")(props)
|
|
226
|
+
}
|
|
227
|
+
});
|
|
228
|
+
});
|
|
229
|
+
var ExternalAppSwitcher = styled("div").withConfig({
|
|
230
|
+
displayName: "Header__ExternalAppSwitcher",
|
|
231
|
+
componentId: "yf04b-14"
|
|
232
|
+
})(function (props) {
|
|
233
|
+
return css({
|
|
234
|
+
marginTop: "s",
|
|
235
|
+
"[class^='Small'], [class*=' Small']": {
|
|
236
|
+
display: "block",
|
|
237
|
+
fontWeight: themeGet("fontWeights.1")(props)
|
|
238
|
+
}
|
|
239
|
+
});
|
|
240
|
+
});
|
|
53
241
|
var AppName = styled("div").withConfig({
|
|
54
242
|
displayName: "Header__AppName",
|
|
55
|
-
componentId: "yf04b-
|
|
243
|
+
componentId: "yf04b-15"
|
|
56
244
|
})(function (props) {
|
|
57
245
|
return css({
|
|
58
|
-
height: themeGet("appScale.navBarSize")(props),
|
|
59
246
|
display: "flex",
|
|
60
247
|
alignItems: "center",
|
|
61
248
|
fontSize: themeGet("fontSizes.3")(props),
|
|
62
|
-
|
|
63
|
-
color: themeGet("colors.white")(props),
|
|
64
|
-
borderRightStyle: "solid",
|
|
65
|
-
borderRightColor: "white20",
|
|
66
|
-
borderRightWidth: 1,
|
|
67
|
-
"a[class^='StyledLink'], a[class*=' StyledLink']": {
|
|
68
|
-
display: "flex",
|
|
69
|
-
alignItems: "center"
|
|
70
|
-
}
|
|
249
|
+
color: themeGet("colors.white")(props)
|
|
71
250
|
});
|
|
72
251
|
}, variant({
|
|
73
252
|
variants: {
|
|
74
|
-
"default": {
|
|
253
|
+
"default": {
|
|
254
|
+
width: "5px",
|
|
255
|
+
height: "5px",
|
|
256
|
+
backgroundColor: "#fff",
|
|
257
|
+
transition: "all 200ms ease-in-out"
|
|
258
|
+
},
|
|
75
259
|
search: {
|
|
76
260
|
border: "none",
|
|
77
261
|
pr: "0"
|
|
@@ -80,7 +264,7 @@ var AppName = styled("div").withConfig({
|
|
|
80
264
|
}), space);
|
|
81
265
|
var SearchContainer = styled("div").withConfig({
|
|
82
266
|
displayName: "Header__SearchContainer",
|
|
83
|
-
componentId: "yf04b-
|
|
267
|
+
componentId: "yf04b-16"
|
|
84
268
|
})(css({
|
|
85
269
|
gridColumn: "2 / 4",
|
|
86
270
|
"a[class^='StyledLink'], a[class*=' StyledLink']": {
|
|
@@ -89,7 +273,7 @@ var SearchContainer = styled("div").withConfig({
|
|
|
89
273
|
}), space, layout);
|
|
90
274
|
var MobileMenuToggle = styled("label").withConfig({
|
|
91
275
|
displayName: "Header__MobileMenuToggle",
|
|
92
|
-
componentId: "yf04b-
|
|
276
|
+
componentId: "yf04b-17"
|
|
93
277
|
})(function (props) {
|
|
94
278
|
return css({
|
|
95
279
|
zIndex: 4,
|
|
@@ -113,7 +297,7 @@ var MobileMenuToggle = styled("label").withConfig({
|
|
|
113
297
|
});
|
|
114
298
|
var Hamburger = styled("span").withConfig({
|
|
115
299
|
displayName: "Header__Hamburger",
|
|
116
|
-
componentId: "yf04b-
|
|
300
|
+
componentId: "yf04b-18"
|
|
117
301
|
})(function (props) {
|
|
118
302
|
return css({
|
|
119
303
|
"::before": {
|
|
@@ -155,7 +339,7 @@ var Hamburger = styled("span").withConfig({
|
|
|
155
339
|
});
|
|
156
340
|
var MobileNavToggle = styled("input").withConfig({
|
|
157
341
|
displayName: "Header__MobileNavToggle",
|
|
158
|
-
componentId: "yf04b-
|
|
342
|
+
componentId: "yf04b-19"
|
|
159
343
|
})(function (props) {
|
|
160
344
|
return css({
|
|
161
345
|
opacity: "0",
|
|
@@ -214,7 +398,7 @@ var MobileNavToggle = styled("input").withConfig({
|
|
|
214
398
|
});
|
|
215
399
|
var MobileNavMenu = styled("div").withConfig({
|
|
216
400
|
displayName: "Header__MobileNavMenu",
|
|
217
|
-
componentId: "yf04b-
|
|
401
|
+
componentId: "yf04b-20"
|
|
218
402
|
})(function (props) {
|
|
219
403
|
return css({
|
|
220
404
|
position: "fixed",
|
|
@@ -239,39 +423,9 @@ var MobileNavMenu = styled("div").withConfig({
|
|
|
239
423
|
}
|
|
240
424
|
});
|
|
241
425
|
});
|
|
242
|
-
var InternalAppSwitcher = styled("div").withConfig({
|
|
243
|
-
displayName: "Header__InternalAppSwitcher",
|
|
244
|
-
componentId: "yf04b-7"
|
|
245
|
-
})(function (props) {
|
|
246
|
-
return css({
|
|
247
|
-
borderTop: "solid 1px rgba(255,255,255,0.3)",
|
|
248
|
-
paddingTop: "s",
|
|
249
|
-
marginTop: "s",
|
|
250
|
-
"[class^='Small'], [class*=' Small']": {
|
|
251
|
-
display: "block",
|
|
252
|
-
fontWeight: themeGet("fontWeights.1")(props),
|
|
253
|
-
marginTop: "xs"
|
|
254
|
-
}
|
|
255
|
-
});
|
|
256
|
-
});
|
|
257
|
-
var ExternalAppSwitcher = styled("div").withConfig({
|
|
258
|
-
displayName: "Header__ExternalAppSwitcher",
|
|
259
|
-
componentId: "yf04b-8"
|
|
260
|
-
})(function (props) {
|
|
261
|
-
return css({
|
|
262
|
-
borderTop: "solid 1px rgba(255,255,255,0.3)",
|
|
263
|
-
paddingTop: "s",
|
|
264
|
-
marginTop: "s",
|
|
265
|
-
"[class^='Small'], [class*=' Small']": {
|
|
266
|
-
display: "block",
|
|
267
|
-
fontWeight: themeGet("fontWeights.1")(props),
|
|
268
|
-
marginTop: "xs"
|
|
269
|
-
}
|
|
270
|
-
});
|
|
271
|
-
});
|
|
272
426
|
var Theme = styled("div").withConfig({
|
|
273
427
|
displayName: "Header__Theme",
|
|
274
|
-
componentId: "yf04b-
|
|
428
|
+
componentId: "yf04b-21"
|
|
275
429
|
})(function (props) {
|
|
276
430
|
return css({
|
|
277
431
|
borderTop: "solid 1px rgba(255,255,255,0.3)",
|
|
@@ -287,14 +441,14 @@ var Theme = styled("div").withConfig({
|
|
|
287
441
|
});
|
|
288
442
|
var RightAligned = styled("div").withConfig({
|
|
289
443
|
displayName: "Header__RightAligned",
|
|
290
|
-
componentId: "yf04b-
|
|
444
|
+
componentId: "yf04b-22"
|
|
291
445
|
})(css({
|
|
292
446
|
marginLeft: "auto",
|
|
293
447
|
marginRight: "r"
|
|
294
448
|
}));
|
|
295
449
|
var Overlay = styled("label").withConfig({
|
|
296
450
|
displayName: "Header__Overlay",
|
|
297
|
-
componentId: "yf04b-
|
|
451
|
+
componentId: "yf04b-23"
|
|
298
452
|
})(function (props) {
|
|
299
453
|
return css({
|
|
300
454
|
position: "fixed",
|
|
@@ -332,7 +486,51 @@ export default function Header(_ref) {
|
|
|
332
486
|
themeSwitcherContent = _ref.themeSwitcherContent,
|
|
333
487
|
workspaceSwitcherContent = _ref.workspaceSwitcherContent,
|
|
334
488
|
_ref$navToggleId = _ref.navToggleId,
|
|
335
|
-
navToggleId = _ref$navToggleId === void 0 ? "mobileMenuToggle" : _ref$navToggleId
|
|
489
|
+
navToggleId = _ref$navToggleId === void 0 ? "mobileMenuToggle" : _ref$navToggleId,
|
|
490
|
+
currentWorkspace = _ref.currentWorkspace,
|
|
491
|
+
logo = _ref.logo,
|
|
492
|
+
appSwitcher = _ref.appSwitcher,
|
|
493
|
+
lightAppSwitcher = _ref.lightAppSwitcher;
|
|
494
|
+
|
|
495
|
+
var _useState = useState(false),
|
|
496
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
497
|
+
toggleState = _useState2[0],
|
|
498
|
+
setToggle = _useState2[1];
|
|
499
|
+
|
|
500
|
+
var switcherRef = useRef();
|
|
501
|
+
var menuRef = useRef();
|
|
502
|
+
|
|
503
|
+
var closeMenu = function closeMenu() {
|
|
504
|
+
setToggle(false);
|
|
505
|
+
};
|
|
506
|
+
|
|
507
|
+
useEffect(function () {
|
|
508
|
+
if (!toggleState) {
|
|
509
|
+
return;
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
var handleClicked = function handleClicked(event) {
|
|
513
|
+
// As the event listener is attached in capture phase, need to do this make sure the sate change are after react event cycle.
|
|
514
|
+
if (menuRef.current && !menuRef.current.contains(event.target) && switcherRef.current && !switcherRef.current.contains(event.target)) {
|
|
515
|
+
closeMenu();
|
|
516
|
+
}
|
|
517
|
+
}; // handle click to hide menu
|
|
518
|
+
// If any of the actions are using stopPropagation(), the event will stop in the react mounting root.
|
|
519
|
+
// So use capture phase to detect anything clicked.
|
|
520
|
+
|
|
521
|
+
|
|
522
|
+
document.addEventListener("click", handleClicked, true);
|
|
523
|
+
return function () {
|
|
524
|
+
// If menu closed, unregister event listener to prevent memory leaks
|
|
525
|
+
document.removeEventListener("click", handleClicked, true);
|
|
526
|
+
};
|
|
527
|
+
}, [toggleState, switcherRef]);
|
|
528
|
+
|
|
529
|
+
var onToggle = function onToggle(e) {
|
|
530
|
+
e.stopPropagation();
|
|
531
|
+
setToggle(!toggleState);
|
|
532
|
+
};
|
|
533
|
+
|
|
336
534
|
var component = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(MobileNavToggle, {
|
|
337
535
|
type: "checkbox",
|
|
338
536
|
id: navToggleId
|
|
@@ -340,9 +538,41 @@ export default function Header(_ref) {
|
|
|
340
538
|
theme: theme,
|
|
341
539
|
dataTestId: dataTestId,
|
|
342
540
|
variant: variant
|
|
541
|
+
}, /*#__PURE__*/React.createElement(Flex, {
|
|
542
|
+
alignItems: "center"
|
|
543
|
+
}, appSwitcher && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Switcher, {
|
|
544
|
+
title: "Switch to...",
|
|
545
|
+
onClick: onToggle,
|
|
546
|
+
ref: switcherRef
|
|
547
|
+
}, /*#__PURE__*/React.createElement(SwitcherTopLeft, null), /*#__PURE__*/React.createElement(SwitcherTopMiddle, null), /*#__PURE__*/React.createElement(SwitcherTopRight, null), /*#__PURE__*/React.createElement(SwitcherMiddleLeft, null), /*#__PURE__*/React.createElement(SwitcherMiddleMiddle, null), /*#__PURE__*/React.createElement(SwitcherMiddleRight, null), /*#__PURE__*/React.createElement(SwitcherBottomLeft, null), /*#__PURE__*/React.createElement(SwitcherBottomMiddle, null), /*#__PURE__*/React.createElement(SwitcherBottomRight, null)), /*#__PURE__*/React.createElement(AppsMenu, {
|
|
548
|
+
lightAppSwitcher: lightAppSwitcher,
|
|
549
|
+
isOpen: toggleState,
|
|
550
|
+
ref: menuRef
|
|
551
|
+
}, workspaceSwitcherContent && /*#__PURE__*/React.createElement(WorkspaceSwitcher, null, /*#__PURE__*/React.createElement(Small, {
|
|
552
|
+
color: lightAppSwitcher ? "black60" : "white60",
|
|
553
|
+
pb: "s",
|
|
554
|
+
display: "block"
|
|
555
|
+
}, "Change workspace:"), workspaceSwitcherContent), internalAppSwitcherContent && /*#__PURE__*/React.createElement(InternalAppSwitcher, {
|
|
556
|
+
lightAppSwitcher: lightAppSwitcher
|
|
557
|
+
}, /*#__PURE__*/React.createElement(Small, {
|
|
558
|
+
color: lightAppSwitcher ? "black60" : "white60",
|
|
559
|
+
pb: "xs",
|
|
560
|
+
display: "block"
|
|
561
|
+
}, "Switch to:"), internalAppSwitcherContent), externalAppSwitcherContent && /*#__PURE__*/React.createElement(ExternalAppSwitcher, {
|
|
562
|
+
lightAppSwitcher: lightAppSwitcher
|
|
563
|
+
}, /*#__PURE__*/React.createElement(Small, {
|
|
564
|
+
color: lightAppSwitcher ? "black60" : "white60",
|
|
565
|
+
pb: "xs",
|
|
566
|
+
display: "block"
|
|
567
|
+
}, "External apps:"), externalAppSwitcherContent))), logo && /*#__PURE__*/React.createElement(FlexItem, null, logo), /*#__PURE__*/React.createElement(Flex, {
|
|
568
|
+
flexDirection: "column",
|
|
569
|
+
justifyContent: "center"
|
|
343
570
|
}, /*#__PURE__*/React.createElement(AppName, {
|
|
344
571
|
variant: variant
|
|
345
|
-
}, appName), /*#__PURE__*/React.createElement(
|
|
572
|
+
}, appName), currentWorkspace && /*#__PURE__*/React.createElement(Small, {
|
|
573
|
+
color: "white",
|
|
574
|
+
fontSize: "0"
|
|
575
|
+
}, currentWorkspace))), /*#__PURE__*/React.createElement(Spacer, {
|
|
346
576
|
ml: 4
|
|
347
577
|
}, children), searchComponent && /*#__PURE__*/React.createElement(SearchContainer, null, searchComponent), /*#__PURE__*/React.createElement(Flex, {
|
|
348
578
|
alignItems: "center",
|
|
@@ -350,7 +580,7 @@ export default function Header(_ref) {
|
|
|
350
580
|
}, rightAlignedContent && /*#__PURE__*/React.createElement(RightAligned, null, rightAlignedContent), /*#__PURE__*/React.createElement(FlexItem, {
|
|
351
581
|
flex: "1 0 auto",
|
|
352
582
|
mr: "r",
|
|
353
|
-
display: ["none", "none", "none", "
|
|
583
|
+
display: ["none", "none", "none", "none", "flex"]
|
|
354
584
|
}, /*#__PURE__*/React.createElement(Avatar, {
|
|
355
585
|
type: "inverted",
|
|
356
586
|
sizing: "small",
|
|
@@ -371,7 +601,7 @@ export default function Header(_ref) {
|
|
|
371
601
|
pt: "s",
|
|
372
602
|
pb: "r",
|
|
373
603
|
mb: "s",
|
|
374
|
-
display: ["block", "block", "block", "
|
|
604
|
+
display: ["block", "block", "block", "block", "none"]
|
|
375
605
|
}, /*#__PURE__*/React.createElement(Avatar, {
|
|
376
606
|
type: "inverted",
|
|
377
607
|
sizing: "small",
|
|
@@ -389,27 +619,12 @@ export default function Header(_ref) {
|
|
|
389
619
|
icon: ["fas", "lock"],
|
|
390
620
|
colour: "white",
|
|
391
621
|
mr: "s"
|
|
392
|
-
}), "Logout"),
|
|
393
|
-
color: "white60",
|
|
394
|
-
px: "r",
|
|
395
|
-
py: "s",
|
|
396
|
-
display: "block"
|
|
397
|
-
}, "Switch to:"), internalAppSwitcherContent), externalAppSwitcherContent && /*#__PURE__*/React.createElement(ExternalAppSwitcher, null, /*#__PURE__*/React.createElement(Small, {
|
|
398
|
-
color: "white60",
|
|
399
|
-
px: "r",
|
|
400
|
-
py: "s",
|
|
401
|
-
display: "block"
|
|
402
|
-
}, "External apps:"), externalAppSwitcherContent), themeSwitcherContent && /*#__PURE__*/React.createElement(Theme, null, /*#__PURE__*/React.createElement(Small, {
|
|
403
|
-
color: "white60",
|
|
404
|
-
pt: "s",
|
|
405
|
-
pb: "r",
|
|
406
|
-
display: "block"
|
|
407
|
-
}, "Switch theme:"), themeSwitcherContent), workspaceSwitcherContent && /*#__PURE__*/React.createElement(Theme, null, /*#__PURE__*/React.createElement(Small, {
|
|
622
|
+
}), "Logout"), themeSwitcherContent && /*#__PURE__*/React.createElement(Theme, null, /*#__PURE__*/React.createElement(Small, {
|
|
408
623
|
color: "white60",
|
|
409
624
|
pt: "s",
|
|
410
625
|
pb: "r",
|
|
411
626
|
display: "block"
|
|
412
|
-
}, "
|
|
627
|
+
}, "Switch theme:"), themeSwitcherContent))), /*#__PURE__*/React.createElement(Overlay, {
|
|
413
628
|
htmlFor: navToggleId
|
|
414
629
|
}));
|
|
415
630
|
return theme ? /*#__PURE__*/React.createElement(ThemeProvider, {
|
|
@@ -417,9 +632,15 @@ export default function Header(_ref) {
|
|
|
417
632
|
}, component) : component;
|
|
418
633
|
}
|
|
419
634
|
Header.propTypes = {
|
|
635
|
+
/** Logo for app. Preferably an svg logo */
|
|
636
|
+
logo: PropTypes.node,
|
|
637
|
+
|
|
420
638
|
/** Text for app name. Can be a plain text string or an svg logo */
|
|
421
639
|
appName: PropTypes.node,
|
|
422
640
|
|
|
641
|
+
/** Current active workspace name. Can be a plain text string or a component */
|
|
642
|
+
currentWorkspace: PropTypes.node,
|
|
643
|
+
|
|
423
644
|
/** Text for username. */
|
|
424
645
|
userName: PropTypes.node,
|
|
425
646
|
|
|
@@ -441,6 +662,12 @@ Header.propTypes = {
|
|
|
441
662
|
/** Applies the chosen theme to the entire header. */
|
|
442
663
|
theme: PropTypes.object,
|
|
443
664
|
|
|
665
|
+
/** Specifies whether the app switcher should exist or not */
|
|
666
|
+
appSwitcher: PropTypes.bool,
|
|
667
|
+
|
|
668
|
+
/** Changes the app switcher to light theme */
|
|
669
|
+
lightAppSwitcher: PropTypes.bool,
|
|
670
|
+
|
|
444
671
|
/** Navigation links are rendered as child components. */
|
|
445
672
|
children: PropTypes.oneOfType([PropTypes.node, PropTypes.arrayOf(PropTypes.node)]),
|
|
446
673
|
|
|
@@ -483,6 +710,13 @@ Header.__docgenInfo = {
|
|
|
483
710
|
"required": false,
|
|
484
711
|
"description": ""
|
|
485
712
|
},
|
|
713
|
+
"logo": {
|
|
714
|
+
"type": {
|
|
715
|
+
"name": "node"
|
|
716
|
+
},
|
|
717
|
+
"required": false,
|
|
718
|
+
"description": "Logo for app. Preferably an svg logo"
|
|
719
|
+
},
|
|
486
720
|
"appName": {
|
|
487
721
|
"type": {
|
|
488
722
|
"name": "node"
|
|
@@ -490,6 +724,13 @@ Header.__docgenInfo = {
|
|
|
490
724
|
"required": false,
|
|
491
725
|
"description": "Text for app name. Can be a plain text string or an svg logo"
|
|
492
726
|
},
|
|
727
|
+
"currentWorkspace": {
|
|
728
|
+
"type": {
|
|
729
|
+
"name": "node"
|
|
730
|
+
},
|
|
731
|
+
"required": false,
|
|
732
|
+
"description": "Current active workspace name. Can be a plain text string or a component"
|
|
733
|
+
},
|
|
493
734
|
"userName": {
|
|
494
735
|
"type": {
|
|
495
736
|
"name": "node"
|
|
@@ -539,6 +780,20 @@ Header.__docgenInfo = {
|
|
|
539
780
|
"required": false,
|
|
540
781
|
"description": "Applies the chosen theme to the entire header."
|
|
541
782
|
},
|
|
783
|
+
"appSwitcher": {
|
|
784
|
+
"type": {
|
|
785
|
+
"name": "bool"
|
|
786
|
+
},
|
|
787
|
+
"required": false,
|
|
788
|
+
"description": "Specifies whether the app switcher should exist or not"
|
|
789
|
+
},
|
|
790
|
+
"lightAppSwitcher": {
|
|
791
|
+
"type": {
|
|
792
|
+
"name": "bool"
|
|
793
|
+
},
|
|
794
|
+
"required": false,
|
|
795
|
+
"description": "Changes the app switcher to light theme"
|
|
796
|
+
},
|
|
542
797
|
"children": {
|
|
543
798
|
"type": {
|
|
544
799
|
"name": "union",
|
|
@@ -179,13 +179,22 @@ export var withSelectedValueSelect = function withSelectedValueSelect() {
|
|
|
179
179
|
});
|
|
180
180
|
};
|
|
181
181
|
withSelectedValueSelect.storyName = "With Selected Value";
|
|
182
|
-
export var
|
|
182
|
+
export var withCreatableSelect = function withCreatableSelect() {
|
|
183
183
|
return /*#__PURE__*/React.createElement(Select, {
|
|
184
184
|
options: options,
|
|
185
|
-
selectType: "
|
|
185
|
+
selectType: "creatable",
|
|
186
186
|
isMulti: true
|
|
187
187
|
});
|
|
188
188
|
};
|
|
189
|
+
withCreatableSelect.storyName = "With Creatable";
|
|
190
|
+
export var withAsyncSelect = function withAsyncSelect() {
|
|
191
|
+
return /*#__PURE__*/React.createElement(Select, {
|
|
192
|
+
defaultOptions: options,
|
|
193
|
+
selectType: "async",
|
|
194
|
+
isMulti: true
|
|
195
|
+
});
|
|
196
|
+
};
|
|
197
|
+
withAsyncSelect.storyName = "With Async";
|
|
189
198
|
export var withGroupedOptions = function withGroupedOptions() {
|
|
190
199
|
return /*#__PURE__*/React.createElement(Select, {
|
|
191
200
|
options: groupedOptions,
|
|
@@ -193,7 +202,7 @@ export var withGroupedOptions = function withGroupedOptions() {
|
|
|
193
202
|
menuIsOpen: true
|
|
194
203
|
});
|
|
195
204
|
};
|
|
196
|
-
|
|
205
|
+
withGroupedOptions.storyName = "With Grouped Options";
|
|
197
206
|
defaultSelect.__docgenInfo = {
|
|
198
207
|
"description": "",
|
|
199
208
|
"methods": [],
|
|
@@ -229,10 +238,15 @@ withSelectedValueSelect.__docgenInfo = {
|
|
|
229
238
|
"methods": [],
|
|
230
239
|
"displayName": "withSelectedValueSelect"
|
|
231
240
|
};
|
|
232
|
-
|
|
241
|
+
withCreatableSelect.__docgenInfo = {
|
|
242
|
+
"description": "",
|
|
243
|
+
"methods": [],
|
|
244
|
+
"displayName": "withCreatableSelect"
|
|
245
|
+
};
|
|
246
|
+
withAsyncSelect.__docgenInfo = {
|
|
233
247
|
"description": "",
|
|
234
248
|
"methods": [],
|
|
235
|
-
"displayName": "
|
|
249
|
+
"displayName": "withAsyncSelect"
|
|
236
250
|
};
|
|
237
251
|
withGroupedOptions.__docgenInfo = {
|
|
238
252
|
"description": "",
|
|
@@ -9,7 +9,8 @@ import React, { forwardRef } from "react";
|
|
|
9
9
|
import PropTypes from "prop-types";
|
|
10
10
|
import styled, { ThemeProvider, useTheme } from "styled-components";
|
|
11
11
|
import { default as ReactSelect } from "react-select";
|
|
12
|
-
import
|
|
12
|
+
import AsyncSelect from "react-select/async";
|
|
13
|
+
import CreatableSelect from "react-select/creatable";
|
|
13
14
|
import { space, layout, compose } from "styled-system";
|
|
14
15
|
import { css } from "@styled-system/css";
|
|
15
16
|
import shouldForwardProp from "@styled-system/should-forward-prop";
|
|
@@ -117,7 +118,9 @@ var Select = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
117
118
|
},
|
|
118
119
|
control: function control(provided, state) {
|
|
119
120
|
return _objectSpread(_objectSpread({}, provided), {}, {
|
|
120
|
-
minHeight: props.height ? props.height : "
|
|
121
|
+
minHeight: props.height ? props.height : themeGet("appScale.inputHeightDefault")({
|
|
122
|
+
theme: theme
|
|
123
|
+
}),
|
|
121
124
|
boxShadow: "none",
|
|
122
125
|
opacity: state.isDisabled ? 0.7 : 1,
|
|
123
126
|
"&:hover": {
|
|
@@ -145,7 +148,7 @@ var Select = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
145
148
|
borderRadius: themeGet("radii.2")({
|
|
146
149
|
theme: theme
|
|
147
150
|
}),
|
|
148
|
-
fontSize: themeGet("fontSizes.
|
|
151
|
+
fontSize: themeGet("fontSizes.1")({
|
|
149
152
|
theme: theme
|
|
150
153
|
})
|
|
151
154
|
});
|
|
@@ -165,7 +168,8 @@ var Select = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
165
168
|
},
|
|
166
169
|
valueContainer: function valueContainer(provided) {
|
|
167
170
|
return _objectSpread(_objectSpread({}, provided), {}, {
|
|
168
|
-
padding: props.padding ? props.padding : "2px 4px"
|
|
171
|
+
padding: props.padding ? props.padding : "2px 4px",
|
|
172
|
+
overflow: "visible"
|
|
169
173
|
});
|
|
170
174
|
},
|
|
171
175
|
clearIndicator: function clearIndicator(provided, state) {
|
|
@@ -329,7 +333,16 @@ var Select = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
329
333
|
inverted: props.inverted,
|
|
330
334
|
bold: props.bold,
|
|
331
335
|
htmlFor: props.inputId
|
|
332
|
-
}, props.label), props.selectType === "
|
|
336
|
+
}, props.label), props.selectType === "creatable" ? /*#__PURE__*/React.createElement(CreatableSelect, _extends({
|
|
337
|
+
ref: ref,
|
|
338
|
+
styles: customStyles,
|
|
339
|
+
theme: theme,
|
|
340
|
+
inputId: props.inputId,
|
|
341
|
+
inverted: props.inverted,
|
|
342
|
+
isMulti: props.isMulti,
|
|
343
|
+
classNamePrefix: props.classNamePrefix,
|
|
344
|
+
onChange: props.onChange
|
|
345
|
+
}, props)) : props.selectType === "async" ? /*#__PURE__*/React.createElement(AsyncSelect, _extends({
|
|
333
346
|
ref: ref,
|
|
334
347
|
styles: customStyles,
|
|
335
348
|
theme: theme,
|
|
@@ -393,7 +406,7 @@ Select.propTypes = {
|
|
|
393
406
|
theme: PropTypes.object,
|
|
394
407
|
|
|
395
408
|
/** Specify if you want react-select createable option */
|
|
396
|
-
selectType: PropTypes.oneOf(["default", "createable"]),
|
|
409
|
+
selectType: PropTypes.oneOf(["default", "createable", "async"]),
|
|
397
410
|
|
|
398
411
|
/** Specify if you want to overwrite existing customStyles */
|
|
399
412
|
updateStyles: PropTypes.func
|
|
@@ -421,6 +434,9 @@ Select.__docgenInfo = {
|
|
|
421
434
|
}, {
|
|
422
435
|
"value": "\"createable\"",
|
|
423
436
|
"computed": false
|
|
437
|
+
}, {
|
|
438
|
+
"value": "\"async\"",
|
|
439
|
+
"computed": false
|
|
424
440
|
}]
|
|
425
441
|
},
|
|
426
442
|
"required": false,
|
|
@@ -185,9 +185,10 @@ var StyledLink = function StyledLink(_ref) {
|
|
|
185
185
|
bold = _ref.bold,
|
|
186
186
|
theme = _ref.theme,
|
|
187
187
|
to = _ref.to,
|
|
188
|
+
block = _ref.block,
|
|
188
189
|
target = _ref.target,
|
|
189
190
|
button = _ref.button,
|
|
190
|
-
props = _objectWithoutProperties(_ref, ["children", "active", "white", "bold", "theme", "to", "target", "button"]);
|
|
191
|
+
props = _objectWithoutProperties(_ref, ["children", "active", "white", "bold", "theme", "to", "block", "target", "button"]);
|
|
191
192
|
|
|
192
193
|
if (button) {
|
|
193
194
|
return to ? /*#__PURE__*/React.createElement(ReactButtonLink, _extends({
|
|
@@ -213,6 +214,7 @@ var StyledLink = function StyledLink(_ref) {
|
|
|
213
214
|
white: white,
|
|
214
215
|
bold: bold,
|
|
215
216
|
to: to,
|
|
217
|
+
block: block,
|
|
216
218
|
target: target
|
|
217
219
|
}, props), children) : /*#__PURE__*/React.createElement(Hyperlink, _extends({
|
|
218
220
|
theme: theme,
|
|
@@ -220,6 +222,7 @@ var StyledLink = function StyledLink(_ref) {
|
|
|
220
222
|
white: white,
|
|
221
223
|
bold: bold,
|
|
222
224
|
to: to,
|
|
225
|
+
block: block,
|
|
223
226
|
target: target
|
|
224
227
|
}, props), children);
|
|
225
228
|
};
|
|
@@ -231,6 +234,9 @@ StyledLink.propTypes = {
|
|
|
231
234
|
/** Designates the active link, eg if in a navigation menu, it is the current screen */
|
|
232
235
|
active: PropTypes.bool,
|
|
233
236
|
|
|
237
|
+
/** Specifies if link is rendered as display:block */
|
|
238
|
+
block: PropTypes.bool,
|
|
239
|
+
|
|
234
240
|
/** Renders a white link (useful for dark backgrounds) */
|
|
235
241
|
white: PropTypes.bool,
|
|
236
242
|
|
|
@@ -271,6 +277,13 @@ StyledLink.__docgenInfo = {
|
|
|
271
277
|
"required": false,
|
|
272
278
|
"description": "Designates the active link, eg if in a navigation menu, it is the current screen"
|
|
273
279
|
},
|
|
280
|
+
"block": {
|
|
281
|
+
"type": {
|
|
282
|
+
"name": "bool"
|
|
283
|
+
},
|
|
284
|
+
"required": false,
|
|
285
|
+
"description": "Specifies if link is rendered as display:block"
|
|
286
|
+
},
|
|
274
287
|
"white": {
|
|
275
288
|
"type": {
|
|
276
289
|
"name": "bool"
|
|
@@ -24,7 +24,19 @@ var IconWrapper = styled.label.withConfig({
|
|
|
24
24
|
displayName: "TextInput__IconWrapper",
|
|
25
25
|
componentId: "shde0o-0"
|
|
26
26
|
})(["svg{opacity:0.4;position:absolute;}", ";"], function (props) {
|
|
27
|
-
return props.iconLeft && !props.floating ? css(["svg{bottom:
|
|
27
|
+
return props.iconLeft && !props.floating ? css(["svg{bottom:", ";left:12px;}"], function (props) {
|
|
28
|
+
var inputHeight = themeGet("appScale.inputHeightDefault")(props);
|
|
29
|
+
return "calc(".concat(inputHeight, " / 3 - 1px)");
|
|
30
|
+
}) : props.iconLeft && props.floating ? css(["svg{bottom:", ";left:12px;}"], function (props) {
|
|
31
|
+
var inputHeight = themeGet("appScale.inputHeightDefault")(props);
|
|
32
|
+
return "calc(".concat(inputHeight, " / 2 + 3px)");
|
|
33
|
+
}) : props.iconRight && !props.floating ? css(["svg{bottom:", ";right:12px;}"], function (props) {
|
|
34
|
+
var inputHeight = themeGet("appScale.inputHeightDefault")(props);
|
|
35
|
+
return "calc(".concat(inputHeight, " / 3 - 1px)");
|
|
36
|
+
}) : props.iconRight && props.floating ? css(["svg{bottom:", ";right:12px;}"], function (props) {
|
|
37
|
+
var inputHeight = themeGet("appScale.inputHeightDefault")(props);
|
|
38
|
+
return "calc(".concat(inputHeight, " / 2 + 3px)");
|
|
39
|
+
}) : css([""]);
|
|
28
40
|
});
|
|
29
41
|
var InputStyle = css(["display:block;cursor:text;-moz-appearance:none;-webkit-appearance:none;appearance:none;font-family:\"Open Sans\",\"Helvetica Neue\",Helvetica,Arial,sans-serif;box-shadow:none;font-size:", ";z-index:1;border-radius:", ";transition:", ";background:", ";color:", ";width:", ";height:", ";padding:", ";border:1px solid ", ";", " &:hover{border:1px solid ", ";}&:focus{outline:0;box-shadow:", ";border:1px solid ", ";", ";}"], function (props) {
|
|
30
42
|
return themeGet("fontSizes.2")(props);
|
|
@@ -39,10 +51,10 @@ var InputStyle = css(["display:block;cursor:text;-moz-appearance:none;-webkit-ap
|
|
|
39
51
|
}, function (props) {
|
|
40
52
|
return props.fullWidth ? "100%" : "auto";
|
|
41
53
|
}, function (props) {
|
|
42
|
-
return props.floating ? "
|
|
54
|
+
return props.height ? props.height : props.floating ? themeGet("appScale.inputHeightLarge")(props) : themeGet("appScale.inputHeightDefault")(props);
|
|
43
55
|
}, function (props) {
|
|
44
|
-
var left = props.iconLeft ?
|
|
45
|
-
var right = props.iconRight ?
|
|
56
|
+
var left = props.iconLeft ? 36 : 10;
|
|
57
|
+
var right = props.iconRight ? 36 : 10;
|
|
46
58
|
var top = props.floating ? 25 : 5;
|
|
47
59
|
var bottom = 6;
|
|
48
60
|
return "".concat(top, "px ").concat(right, "px ").concat(bottom, "px ").concat(left, "px");
|
|
@@ -93,8 +105,11 @@ var Label = styled.label.withConfig({
|
|
|
93
105
|
}, function (props) {
|
|
94
106
|
return props.inverted ? themeGet("colors.white")(props) : props.valid ? themeGet("colors.successDark")(props) : props.invalid ? themeGet("colors.dangerDark")(props) : themeGet("colors.greyDarkest")(props);
|
|
95
107
|
}, function (props) {
|
|
96
|
-
return props.floating ? css(["padding-left:", ";cursor:text;position:absolute;top:
|
|
97
|
-
return props.iconLeft ? "
|
|
108
|
+
return props.floating ? css(["padding-left:", ";cursor:text;position:absolute;top:", ";color:", ";"], function (props) {
|
|
109
|
+
return props.iconLeft ? "37px" : "11px";
|
|
110
|
+
}, function (props) {
|
|
111
|
+
var inputHeight = themeGet("appScale.inputHeightLarge")(props);
|
|
112
|
+
return "calc(".concat(inputHeight, " / 3)");
|
|
98
113
|
}, function (props) {
|
|
99
114
|
return props.invalid ? themeGet("colors.dangerDark")(props) : props.valid ? themeGet("colors.successDark")(props) : themeGet("colors.grey")(props);
|
|
100
115
|
}) : css([""]);
|
|
@@ -113,7 +128,8 @@ var TextInput = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
113
128
|
mandatory = props.mandatory,
|
|
114
129
|
iconLeft = props.iconLeft,
|
|
115
130
|
iconRight = props.iconRight,
|
|
116
|
-
InputStyles = props.InputStyles
|
|
131
|
+
InputStyles = props.InputStyles,
|
|
132
|
+
height = props.height; // Strip numberProps from props for Input
|
|
117
133
|
|
|
118
134
|
var numberProps = props.numberProps,
|
|
119
135
|
rest = _objectWithoutProperties(props, ["numberProps"]);
|
|
@@ -138,8 +154,11 @@ var TextInput = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
138
154
|
}, label) : null, numberProps ? /*#__PURE__*/React.createElement(NumberInput, _extends({
|
|
139
155
|
getInputRef: getNumberInputRef,
|
|
140
156
|
"data-testid": props["data-testid"]
|
|
141
|
-
}, rest,
|
|
157
|
+
}, rest, {
|
|
158
|
+
height: height
|
|
159
|
+
}, numberProps)) : /*#__PURE__*/React.createElement(Input, _extends({
|
|
142
160
|
"data-testid": props["data-testid"],
|
|
161
|
+
height: height,
|
|
143
162
|
ref: ref
|
|
144
163
|
}, rest)), label && floating ? /*#__PURE__*/React.createElement(Label, {
|
|
145
164
|
floating: floating,
|
|
@@ -172,6 +191,9 @@ TextInput.propTypes = {
|
|
|
172
191
|
/** Must be used to specify a unique ID. */
|
|
173
192
|
id: PropTypes.string,
|
|
174
193
|
|
|
194
|
+
/** Can be used to set a specific height. */
|
|
195
|
+
height: PropTypes.string,
|
|
196
|
+
|
|
175
197
|
/** Specifies the text for the label. */
|
|
176
198
|
label: PropTypes.string,
|
|
177
199
|
|
|
@@ -229,6 +251,13 @@ TextInput.__docgenInfo = {
|
|
|
229
251
|
"required": false,
|
|
230
252
|
"description": "Must be used to specify a unique ID."
|
|
231
253
|
},
|
|
254
|
+
"height": {
|
|
255
|
+
"type": {
|
|
256
|
+
"name": "string"
|
|
257
|
+
},
|
|
258
|
+
"required": false,
|
|
259
|
+
"description": "Can be used to set a specific height."
|
|
260
|
+
},
|
|
232
261
|
"label": {
|
|
233
262
|
"type": {
|
|
234
263
|
"name": "string"
|
|
@@ -5,7 +5,7 @@ export var fonts = {
|
|
|
5
5
|
};
|
|
6
6
|
export var font = fonts.main;
|
|
7
7
|
export var fontFamilies = fonts;
|
|
8
|
-
export var fontSizes = ["1.1rem", "1.2rem", "1.4rem", "1.6rem", "1.8rem", "2.2rem", "2.6rem", "3.0rem", "3.4rem", "4.
|
|
8
|
+
export var fontSizes = ["1.1rem", "1.2rem", "1.4rem", "1.6rem", "1.8rem", "2.2rem", "2.6rem", "3.0rem", "3.4rem", "4.4rem", "6rem"];
|
|
9
9
|
export var fontWeights = [300, 400, 600];
|
|
10
10
|
export var lineHeights = [1, 1.5, 2]; // Z-AXIS spec
|
|
11
11
|
|
|
@@ -219,11 +219,16 @@ export var mediaQueries = {
|
|
|
219
219
|
}; // APP-SPECIFIC DIMENSIONS
|
|
220
220
|
|
|
221
221
|
export var appScale = {
|
|
222
|
-
navBarSize: "
|
|
222
|
+
navBarSize: "50px",
|
|
223
223
|
sidebarMaxWidth: "360px",
|
|
224
224
|
sidebarMaxWidthLarge: "450px",
|
|
225
225
|
sidebarMobileHeight: "50vh",
|
|
226
|
-
mobileNavMenuWidth: "250px"
|
|
226
|
+
mobileNavMenuWidth: "250px",
|
|
227
|
+
avatarSmall: "34px",
|
|
228
|
+
avatarDefault: "40px",
|
|
229
|
+
avatarLarge: "70px",
|
|
230
|
+
inputHeightDefault: "32px",
|
|
231
|
+
inputHeightLarge: "52px"
|
|
227
232
|
};
|
|
228
233
|
export default {
|
|
229
234
|
fonts: fonts,
|
package/es/systemtheme.js
CHANGED
|
@@ -222,7 +222,12 @@ export var appScale = {
|
|
|
222
222
|
sidebarMaxWidth: "360px",
|
|
223
223
|
sidebarMaxWidthLarge: "550px",
|
|
224
224
|
sidebarMobileHeight: "50vh",
|
|
225
|
-
mobileNavMenuWidth: "250px"
|
|
225
|
+
mobileNavMenuWidth: "250px",
|
|
226
|
+
avatarSmall: "38px",
|
|
227
|
+
avatarDefault: "46px",
|
|
228
|
+
avatarLarge: "80px",
|
|
229
|
+
inputHeightDefault: "38px",
|
|
230
|
+
inputHeightLarge: "58px"
|
|
226
231
|
};
|
|
227
232
|
export default {
|
|
228
233
|
fonts: fonts,
|