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,72 +1,146 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import Grid, { GridItem } from "../Grid";
|
|
3
3
|
import Button from "../Button";
|
|
4
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
5
|
export default {
|
|
5
6
|
title: "Components/Grid",
|
|
6
7
|
component: Grid
|
|
7
8
|
};
|
|
8
|
-
export
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
export const basicGrid = () => /*#__PURE__*/_jsxs(Grid, {
|
|
10
|
+
children: [/*#__PURE__*/_jsx(GridItem, {
|
|
11
|
+
children: "1"
|
|
12
|
+
}), /*#__PURE__*/_jsx(GridItem, {
|
|
13
|
+
children: "2"
|
|
14
|
+
}), /*#__PURE__*/_jsx(GridItem, {
|
|
15
|
+
children: "3"
|
|
16
|
+
}), /*#__PURE__*/_jsx(GridItem, {
|
|
17
|
+
children: "4"
|
|
18
|
+
}), /*#__PURE__*/_jsx(GridItem, {
|
|
19
|
+
children: "5"
|
|
20
|
+
}), /*#__PURE__*/_jsx(GridItem, {
|
|
21
|
+
children: "6"
|
|
22
|
+
})]
|
|
23
|
+
});
|
|
11
24
|
basicGrid.storyName = "Default Grid";
|
|
12
|
-
export
|
|
13
|
-
|
|
14
|
-
bg: "grey"
|
|
15
|
-
|
|
25
|
+
export const backgroundColourGrid = () => /*#__PURE__*/_jsxs(Grid, {
|
|
26
|
+
children: [/*#__PURE__*/_jsx(GridItem, {
|
|
27
|
+
bg: "grey",
|
|
28
|
+
children: "1"
|
|
29
|
+
}), /*#__PURE__*/_jsx(GridItem, {
|
|
16
30
|
bg: "primary",
|
|
17
|
-
color: "white"
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
bg: "
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
31
|
+
color: "white",
|
|
32
|
+
children: "2"
|
|
33
|
+
}), /*#__PURE__*/_jsx(GridItem, {
|
|
34
|
+
bg: "greyLight",
|
|
35
|
+
children: "3"
|
|
36
|
+
}), /*#__PURE__*/_jsx(GridItem, {
|
|
37
|
+
bg: "greyDark",
|
|
38
|
+
children: "4"
|
|
39
|
+
}), /*#__PURE__*/_jsx(GridItem, {
|
|
40
|
+
bg: "success",
|
|
41
|
+
children: "5"
|
|
42
|
+
}), /*#__PURE__*/_jsx(GridItem, {
|
|
43
|
+
bg: "warning",
|
|
44
|
+
children: "6"
|
|
45
|
+
})]
|
|
46
|
+
});
|
|
28
47
|
backgroundColourGrid.storyName = "With background colours";
|
|
29
|
-
export
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
48
|
+
export const templateColumnsAndRows = () => /*#__PURE__*/_jsxs(Grid, {
|
|
49
|
+
gridTemplateColumns: "repeat(3, 1fr)",
|
|
50
|
+
gridTemplateRows: "repeat(2, 1fr)",
|
|
51
|
+
bg: "greyLightest",
|
|
52
|
+
children: [/*#__PURE__*/_jsx(GridItem, {
|
|
53
|
+
children: "This Grid uses repeat and fr to specify the grid structure."
|
|
54
|
+
}), /*#__PURE__*/_jsx(GridItem, {
|
|
55
|
+
children: "Fusce sit amet lorem lectus."
|
|
56
|
+
}), /*#__PURE__*/_jsx(GridItem, {
|
|
57
|
+
children: "Nullam lobortis porta iaculis. "
|
|
58
|
+
}), /*#__PURE__*/_jsx(GridItem, {
|
|
59
|
+
children: "Pellentesque fermentum elementum elit non blandit."
|
|
60
|
+
}), /*#__PURE__*/_jsx(GridItem, {
|
|
61
|
+
children: "Etiam rhoncus ultricies lorem nec imperdiet."
|
|
62
|
+
}), /*#__PURE__*/_jsx(GridItem, {
|
|
63
|
+
children: "Pellentesque. "
|
|
64
|
+
})]
|
|
65
|
+
});
|
|
36
66
|
templateColumnsAndRows.storyName = "Template columns and rows";
|
|
37
|
-
export
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
67
|
+
export const widthColumnsAndRows = () => /*#__PURE__*/_jsxs(Grid, {
|
|
68
|
+
gridTemplateColumns: "25% 200px auto",
|
|
69
|
+
gridTemplateRows: "25% 100px auto",
|
|
70
|
+
bg: "greyLighter",
|
|
71
|
+
children: [/*#__PURE__*/_jsx(GridItem, {
|
|
72
|
+
children: "This Grid uses widths and percentages to specify the grid structure."
|
|
73
|
+
}), /*#__PURE__*/_jsx(GridItem, {
|
|
74
|
+
children: "Fusce sit amet lorem lectus."
|
|
75
|
+
}), /*#__PURE__*/_jsx(GridItem, {
|
|
76
|
+
children: "Nullam lobortis porta iaculis. "
|
|
77
|
+
}), /*#__PURE__*/_jsx(GridItem, {
|
|
78
|
+
children: "Pellentesque fermentum elementum elit non blandit."
|
|
79
|
+
}), /*#__PURE__*/_jsx(GridItem, {
|
|
80
|
+
children: "Etiam rhoncus ultricies lorem nec imperdiet."
|
|
81
|
+
}), /*#__PURE__*/_jsx(GridItem, {
|
|
82
|
+
children: "Pellentesque. "
|
|
83
|
+
}), /*#__PURE__*/_jsx(GridItem, {
|
|
84
|
+
children: "Each GridItem goes down the columns first and then goes through the rows."
|
|
85
|
+
}), /*#__PURE__*/_jsx(GridItem, {
|
|
86
|
+
children: "To change this, change the value of the gridAutoFlow property. The default value is columns."
|
|
87
|
+
})]
|
|
88
|
+
});
|
|
44
89
|
widthColumnsAndRows.storyName = "Width-based columns and rows";
|
|
45
|
-
export
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
90
|
+
export const withGridItem = () => /*#__PURE__*/_jsxs(Grid, {
|
|
91
|
+
bg: "greyLightest",
|
|
92
|
+
children: [/*#__PURE__*/_jsx(GridItem, {
|
|
93
|
+
children: /*#__PURE__*/_jsx(Button, {
|
|
94
|
+
children: "Default Button"
|
|
95
|
+
})
|
|
96
|
+
}), /*#__PURE__*/_jsx(GridItem, {
|
|
97
|
+
children: /*#__PURE__*/_jsx(Button, {
|
|
98
|
+
colour: "successDark",
|
|
99
|
+
children: "Success"
|
|
100
|
+
})
|
|
101
|
+
}), /*#__PURE__*/_jsx(GridItem, {
|
|
102
|
+
children: /*#__PURE__*/_jsx(Button, {
|
|
103
|
+
fullWidth: true,
|
|
104
|
+
children: "Full width button"
|
|
105
|
+
})
|
|
106
|
+
}), /*#__PURE__*/_jsx(GridItem, {
|
|
107
|
+
children: /*#__PURE__*/_jsx("p", {
|
|
108
|
+
children: "Text-only item"
|
|
109
|
+
})
|
|
110
|
+
})]
|
|
111
|
+
});
|
|
54
112
|
withGridItem.storyName = "With GridItem";
|
|
55
|
-
export
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
113
|
+
export const textWithGridItem = () => /*#__PURE__*/_jsxs(Grid, {
|
|
114
|
+
bg: "greyLighter",
|
|
115
|
+
children: [/*#__PURE__*/_jsx(GridItem, {
|
|
116
|
+
children: "3"
|
|
117
|
+
}), /*#__PURE__*/_jsx(GridItem, {
|
|
118
|
+
children: "1"
|
|
119
|
+
}), /*#__PURE__*/_jsx(GridItem, {
|
|
120
|
+
children: "4"
|
|
121
|
+
}), /*#__PURE__*/_jsx(GridItem, {
|
|
122
|
+
children: "1"
|
|
123
|
+
}), /*#__PURE__*/_jsx(GridItem, {
|
|
124
|
+
children: "5"
|
|
125
|
+
}), /*#__PURE__*/_jsx(GridItem, {
|
|
126
|
+
children: "9"
|
|
127
|
+
})]
|
|
128
|
+
});
|
|
60
129
|
textWithGridItem.storyName = "Text with GridItem";
|
|
61
|
-
export
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
69
|
-
|
|
130
|
+
export const withoutGridItem = () => /*#__PURE__*/_jsxs(Grid, {
|
|
131
|
+
bg: "greyLightest",
|
|
132
|
+
children: [/*#__PURE__*/_jsx(Button, {
|
|
133
|
+
children: "Default Button"
|
|
134
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
135
|
+
colour: "successDark",
|
|
136
|
+
children: "Success"
|
|
137
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
138
|
+
fullWidth: true,
|
|
139
|
+
children: "Full width button"
|
|
140
|
+
}), /*#__PURE__*/_jsx("p", {
|
|
141
|
+
children: "Text-only item"
|
|
142
|
+
})]
|
|
143
|
+
});
|
|
70
144
|
withoutGridItem.storyName = "Without GridItem";
|
|
71
145
|
basicGrid.__docgenInfo = {
|
|
72
146
|
"description": "",
|
|
@@ -1,44 +1,45 @@
|
|
|
1
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
2
|
-
var _excluded = ["children", "theme"];
|
|
3
1
|
import React from "react";
|
|
4
2
|
import styled, { ThemeProvider } from "styled-components";
|
|
5
3
|
import { grid, space, layout, flex, color, compose } from "styled-system";
|
|
6
4
|
import { css } from "@styled-system/css";
|
|
7
5
|
import shouldForwardProp from "@styled-system/should-forward-prop";
|
|
8
6
|
import PropTypes from "prop-types";
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
+
const GridStyles = compose(space, layout, grid, flex, color);
|
|
9
|
+
const GridWrapper = styled("div").withConfig({
|
|
10
|
+
shouldForwardProp,
|
|
12
11
|
displayName: "Grid__GridWrapper",
|
|
13
12
|
componentId: "sc-1rlajun-0"
|
|
14
|
-
}).attrs(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
};
|
|
18
|
-
})(css({
|
|
13
|
+
}).attrs(props => ({
|
|
14
|
+
"data-testid": props.dataTestId ? props.dataTestId : props["data-testid"] ? props["data-testid"] : null
|
|
15
|
+
}))(css({
|
|
19
16
|
boxSizing: "border-box",
|
|
20
17
|
display: "grid"
|
|
21
18
|
}), GridStyles);
|
|
22
|
-
|
|
23
|
-
shouldForwardProp
|
|
19
|
+
const GridItem = styled("div").withConfig({
|
|
20
|
+
shouldForwardProp,
|
|
24
21
|
displayName: "Grid__GridItem",
|
|
25
22
|
componentId: "sc-1rlajun-1"
|
|
26
|
-
}).attrs(
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
};
|
|
30
|
-
})(css({
|
|
23
|
+
}).attrs(props => ({
|
|
24
|
+
"data-testid": props.dataTestId ? props.dataTestId : props["data-testid"] ? props["data-testid"] : null
|
|
25
|
+
}))(css({
|
|
31
26
|
boxSizing: "border-box",
|
|
32
27
|
minWidth: "0"
|
|
33
28
|
}), GridStyles);
|
|
34
29
|
export default function Grid(_ref) {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
30
|
+
let {
|
|
31
|
+
children,
|
|
32
|
+
theme,
|
|
33
|
+
...props
|
|
34
|
+
} = _ref;
|
|
35
|
+
const component = /*#__PURE__*/_jsx(GridWrapper, {
|
|
36
|
+
...props,
|
|
37
|
+
children: children
|
|
38
|
+
});
|
|
39
|
+
return theme ? /*#__PURE__*/_jsx(ThemeProvider, {
|
|
40
|
+
theme: theme,
|
|
41
|
+
children: component
|
|
42
|
+
}) : component;
|
|
42
43
|
}
|
|
43
44
|
Grid.propTypes = {
|
|
44
45
|
/** Children of `Grid` are taken as node elements */
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
1
|
import React, { useState } from "react";
|
|
3
2
|
import { action } from "@storybook/addon-actions";
|
|
4
3
|
import Header from "../Header";
|
|
@@ -8,117 +7,116 @@ import { Small } from "../Typography";
|
|
|
8
7
|
import TextInput from "../TextInput";
|
|
9
8
|
import Select from "../Select";
|
|
10
9
|
import Box from "../Box";
|
|
10
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
11
11
|
export default {
|
|
12
12
|
title: "Components/Header",
|
|
13
|
-
decorators: [
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}],
|
|
13
|
+
decorators: [storyFn => /*#__PURE__*/_jsx(Box, {
|
|
14
|
+
height: "500px",
|
|
15
|
+
children: storyFn()
|
|
16
|
+
})],
|
|
18
17
|
component: Header
|
|
19
18
|
};
|
|
20
|
-
export
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}, /*#__PURE__*/React.createElement(Icon, {
|
|
19
|
+
export const defaultHeader = () => /*#__PURE__*/_jsxs(Header, {
|
|
20
|
+
appName: "App Name",
|
|
21
|
+
userName: "Michael",
|
|
22
|
+
avatarSource: "https://uploads-ssl.webflow.com/5f4852427e784b4cada3e0d0/62f1f587bc47b25676f9ed1d_bw_avatar_adam.png",
|
|
23
|
+
clientInfo: "Tenant: ci2153 Workspace: 20k-v5 [lb5ctx] UI_Version: 8c315c2 [4412] Backend_Version: dabc261 [3578]",
|
|
24
|
+
logoutFunction: action("clicked-logout"),
|
|
25
|
+
sideMenuContent: /*#__PURE__*/_jsxs(StyledLink, {
|
|
26
|
+
href: "#",
|
|
27
|
+
children: [/*#__PURE__*/_jsx(Icon, {
|
|
30
28
|
icon: ["fas", "cog"],
|
|
31
29
|
mr: "s"
|
|
32
|
-
}), "Settings"
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
}), "Settings"]
|
|
31
|
+
}),
|
|
32
|
+
navToggleId: "defaultHeader",
|
|
33
|
+
children: [/*#__PURE__*/_jsx(StyledLink, {
|
|
35
34
|
href: "#",
|
|
36
35
|
white: true,
|
|
37
36
|
bold: true,
|
|
38
|
-
active: true
|
|
39
|
-
|
|
37
|
+
active: true,
|
|
38
|
+
children: "Summary"
|
|
39
|
+
}), /*#__PURE__*/_jsx(StyledLink, {
|
|
40
40
|
href: "#",
|
|
41
41
|
white: true,
|
|
42
|
-
bold: true
|
|
43
|
-
|
|
42
|
+
bold: true,
|
|
43
|
+
children: "Find"
|
|
44
|
+
}), /*#__PURE__*/_jsx(StyledLink, {
|
|
44
45
|
href: "#",
|
|
45
46
|
white: true,
|
|
46
|
-
bold: true
|
|
47
|
-
|
|
48
|
-
}
|
|
47
|
+
bold: true,
|
|
48
|
+
children: "Visualisation"
|
|
49
|
+
})]
|
|
50
|
+
});
|
|
49
51
|
defaultHeader.storyName = "Default Header";
|
|
50
|
-
export
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
navToggleId: "headerWithSearch"
|
|
66
|
-
});
|
|
67
|
-
};
|
|
52
|
+
export const headerWithSearch = () => /*#__PURE__*/_jsx(Header, {
|
|
53
|
+
variant: "search",
|
|
54
|
+
appName: "App Name",
|
|
55
|
+
userName: "Michael",
|
|
56
|
+
avatarSource: "https://uploads-ssl.webflow.com/5f4852427e784b4cada3e0d0/62f1f587bc47b25676f9ed1d_bw_avatar_adam.png",
|
|
57
|
+
logoutFunction: action("clicked-logout"),
|
|
58
|
+
searchComponent: /*#__PURE__*/_jsx(TextInput, {
|
|
59
|
+
fullWidth: true,
|
|
60
|
+
id: "search",
|
|
61
|
+
type: "text",
|
|
62
|
+
placeholder: "Search for...",
|
|
63
|
+
iconRight: ["fas", "search"]
|
|
64
|
+
}, "search"),
|
|
65
|
+
navToggleId: "headerWithSearch"
|
|
66
|
+
});
|
|
68
67
|
headerWithSearch.storyName = "Alternative Header with search";
|
|
69
|
-
export
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
navToggleId: "headerWithSearchAndLinks"
|
|
85
|
-
}, /*#__PURE__*/React.createElement(StyledLink, {
|
|
68
|
+
export const headerWithSearchAndLinks = () => /*#__PURE__*/_jsxs(Header, {
|
|
69
|
+
variant: "searchAndLinks",
|
|
70
|
+
appName: "App Name",
|
|
71
|
+
userName: "Michael",
|
|
72
|
+
avatarSource: "https://uploads-ssl.webflow.com/5f4852427e784b4cada3e0d0/62f1f587bc47b25676f9ed1d_bw_avatar_adam.png",
|
|
73
|
+
logoutFunction: action("clicked-logout"),
|
|
74
|
+
searchComponent: /*#__PURE__*/_jsx(TextInput, {
|
|
75
|
+
fullWidth: true,
|
|
76
|
+
id: "search",
|
|
77
|
+
type: "text",
|
|
78
|
+
placeholder: "Search for...",
|
|
79
|
+
iconRight: ["fas", "search"]
|
|
80
|
+
}, "search"),
|
|
81
|
+
navToggleId: "headerWithSearchAndLinks",
|
|
82
|
+
children: [/*#__PURE__*/_jsx(StyledLink, {
|
|
86
83
|
href: "#",
|
|
87
84
|
white: true,
|
|
88
|
-
bold: true
|
|
89
|
-
|
|
85
|
+
bold: true,
|
|
86
|
+
children: "Summary"
|
|
87
|
+
}), /*#__PURE__*/_jsx(StyledLink, {
|
|
90
88
|
href: "#",
|
|
91
89
|
white: true,
|
|
92
|
-
bold: true
|
|
93
|
-
|
|
90
|
+
bold: true,
|
|
91
|
+
children: "Teams"
|
|
92
|
+
}), /*#__PURE__*/_jsx(StyledLink, {
|
|
94
93
|
href: "#",
|
|
95
94
|
white: true,
|
|
96
|
-
bold: true
|
|
97
|
-
|
|
95
|
+
bold: true,
|
|
96
|
+
children: "People"
|
|
97
|
+
}), /*#__PURE__*/_jsx(StyledLink, {
|
|
98
98
|
href: "#",
|
|
99
99
|
white: true,
|
|
100
|
-
bold: true
|
|
101
|
-
|
|
102
|
-
}
|
|
100
|
+
bold: true,
|
|
101
|
+
children: "Reports"
|
|
102
|
+
})]
|
|
103
|
+
});
|
|
103
104
|
headerWithSearch.storyName = "Alternative Header with search";
|
|
104
|
-
export
|
|
105
|
-
|
|
105
|
+
export const headerWithWorkspaceSwitching = () => {
|
|
106
|
+
const options = [{
|
|
106
107
|
label: "Workspace A"
|
|
107
108
|
}, {
|
|
108
109
|
label: "Workspace B"
|
|
109
110
|
}];
|
|
110
111
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
selected = _useState2[0],
|
|
116
|
-
setSelected = _useState2[1];
|
|
117
|
-
var onChange = function onChange(value) {
|
|
112
|
+
const [selected, setSelected] = useState([{
|
|
113
|
+
label: "Workspace A"
|
|
114
|
+
}]);
|
|
115
|
+
const onChange = value => {
|
|
118
116
|
setSelected(value);
|
|
119
117
|
};
|
|
120
|
-
|
|
121
|
-
|
|
118
|
+
const currentWorkspace = "Workspace A";
|
|
119
|
+
const select = /*#__PURE__*/_jsx(Select, {
|
|
122
120
|
id: "WorkspaceSelect",
|
|
123
121
|
"data-testid": "select-workspace-dropdown",
|
|
124
122
|
placeholder: "Select a workspace",
|
|
@@ -129,18 +127,29 @@ export var headerWithWorkspaceSwitching = function headerWithWorkspaceSwitching(
|
|
|
129
127
|
padding: "0 8px",
|
|
130
128
|
inverted: true
|
|
131
129
|
});
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
130
|
+
const internalAppLinks = /*#__PURE__*/_jsxs(_Fragment, {
|
|
131
|
+
children: [/*#__PURE__*/_jsxs(StyledLink, {
|
|
132
|
+
href: "#",
|
|
133
|
+
target: "_blank",
|
|
134
|
+
children: ["App 1 Name", /*#__PURE__*/_jsx(Small, {
|
|
135
|
+
children: "This is a description of other app in suite"
|
|
136
|
+
})]
|
|
137
|
+
}), /*#__PURE__*/_jsxs(StyledLink, {
|
|
138
|
+
href: "#",
|
|
139
|
+
target: "_blank",
|
|
140
|
+
children: ["App 2 Name", /*#__PURE__*/_jsx(Small, {
|
|
141
|
+
children: "This is a description of other app in suite"
|
|
142
|
+
})]
|
|
143
|
+
})]
|
|
144
|
+
});
|
|
145
|
+
const externalAppLinks = /*#__PURE__*/_jsxs(StyledLink, {
|
|
140
146
|
href: "#",
|
|
141
|
-
target: "_blank"
|
|
142
|
-
|
|
143
|
-
|
|
147
|
+
target: "_blank",
|
|
148
|
+
children: ["External App Name", /*#__PURE__*/_jsx(Small, {
|
|
149
|
+
children: "This is a description of external 3rd party app"
|
|
150
|
+
})]
|
|
151
|
+
});
|
|
152
|
+
return /*#__PURE__*/_jsx(Header, {
|
|
144
153
|
appName: "App Name",
|
|
145
154
|
currentWorkspace: currentWorkspace,
|
|
146
155
|
userName: "Michael",
|