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,38 +1,34 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import HeaderSimple from ".";
|
|
3
3
|
import TextInput from "../TextInput";
|
|
4
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
5
|
export default {
|
|
5
6
|
title: "Components/HeaderSimple",
|
|
6
7
|
component: HeaderSimple
|
|
7
8
|
};
|
|
8
|
-
export
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
});
|
|
16
|
-
};
|
|
9
|
+
export const defaultHeader = () => /*#__PURE__*/_jsx(HeaderSimple, {
|
|
10
|
+
appName: "App Name",
|
|
11
|
+
userName: "Michael",
|
|
12
|
+
avatarSource: "https://api.dicebear.com/7.x/personas/svg?seed=mike",
|
|
13
|
+
avatarAlt: "Avatar for Michael",
|
|
14
|
+
currentWorskapce: "Org Design Workspace"
|
|
15
|
+
});
|
|
17
16
|
defaultHeader.storyName = "Default Header";
|
|
18
|
-
export
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
})
|
|
34
|
-
});
|
|
35
|
-
};
|
|
17
|
+
export const headerWithSearch = () => /*#__PURE__*/_jsx(HeaderSimple, {
|
|
18
|
+
variant: "search",
|
|
19
|
+
appName: "App Name",
|
|
20
|
+
userName: "Michael",
|
|
21
|
+
avatarSource: "https://api.dicebear.com/7.x/personas/svg?seed=mike",
|
|
22
|
+
avatarAlt: "Avatar for Michael",
|
|
23
|
+
currentWorskapce: "Org Design Workspace",
|
|
24
|
+
searchComponent: /*#__PURE__*/_jsx(TextInput, {
|
|
25
|
+
fullWidth: true,
|
|
26
|
+
id: "search",
|
|
27
|
+
type: "text",
|
|
28
|
+
placeholder: "Search for...",
|
|
29
|
+
iconRight: ["fas", "search"]
|
|
30
|
+
}, "search")
|
|
31
|
+
});
|
|
36
32
|
headerWithSearch.storyName = "Header with search";
|
|
37
33
|
defaultHeader.__docgenInfo = {
|
|
38
34
|
"description": "",
|
|
@@ -7,32 +7,27 @@ import Flex, { FlexItem } from "../Flex";
|
|
|
7
7
|
import { Small } from "../Typography";
|
|
8
8
|
import { css } from "@styled-system/css";
|
|
9
9
|
import { themeGet } from "@styled-system/theme-get";
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}).withConfig({
|
|
10
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
|
+
const Bar = styled("header").attrs(props => ({
|
|
12
|
+
"data-testid": props.dataTestId
|
|
13
|
+
})).withConfig({
|
|
15
14
|
displayName: "HeaderSimple__Bar",
|
|
16
15
|
componentId: "sc-1mo6hwx-0"
|
|
17
|
-
})(
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
px: 4,
|
|
31
|
-
bg: themeGet("colors.black")(props)
|
|
32
|
-
});
|
|
33
|
-
}, variant({
|
|
16
|
+
})(props => ({
|
|
17
|
+
height: themeGet("appScale.navBarSize")(props)
|
|
18
|
+
}), props => css({
|
|
19
|
+
width: "100%",
|
|
20
|
+
zIndex: 12,
|
|
21
|
+
position: "sticky",
|
|
22
|
+
top: "0",
|
|
23
|
+
display: "flex",
|
|
24
|
+
alignItems: "center",
|
|
25
|
+
py: 0,
|
|
26
|
+
px: 4,
|
|
27
|
+
bg: themeGet("colors.black")(props)
|
|
28
|
+
}), variant({
|
|
34
29
|
variants: {
|
|
35
|
-
|
|
30
|
+
default: {
|
|
36
31
|
width: "5px",
|
|
37
32
|
height: "5px",
|
|
38
33
|
backgroundColor: "#fff",
|
|
@@ -45,19 +40,17 @@ var Bar = styled("header").attrs(function (props) {
|
|
|
45
40
|
}
|
|
46
41
|
}
|
|
47
42
|
}), space);
|
|
48
|
-
|
|
43
|
+
const AppName = styled("div").withConfig({
|
|
49
44
|
displayName: "HeaderSimple__AppName",
|
|
50
45
|
componentId: "sc-1mo6hwx-1"
|
|
51
|
-
})(
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
});
|
|
58
|
-
}, variant({
|
|
46
|
+
})(props => css({
|
|
47
|
+
display: "flex",
|
|
48
|
+
alignItems: "center",
|
|
49
|
+
fontSize: themeGet("fontSizes.3")(props),
|
|
50
|
+
color: themeGet("colors.white")(props)
|
|
51
|
+
}), variant({
|
|
59
52
|
variants: {
|
|
60
|
-
|
|
53
|
+
default: {
|
|
61
54
|
width: "5px",
|
|
62
55
|
height: "5px",
|
|
63
56
|
backgroundColor: "#fff",
|
|
@@ -70,7 +63,7 @@ var AppName = styled("div").withConfig({
|
|
|
70
63
|
}
|
|
71
64
|
}
|
|
72
65
|
}), space);
|
|
73
|
-
|
|
66
|
+
const SearchContainer = styled("div").withConfig({
|
|
74
67
|
displayName: "HeaderSimple__SearchContainer",
|
|
75
68
|
componentId: "sc-1mo6hwx-2"
|
|
76
69
|
})(css({
|
|
@@ -84,41 +77,53 @@ var SearchContainer = styled("div").withConfig({
|
|
|
84
77
|
/**
|
|
85
78
|
* Header component for top of app.
|
|
86
79
|
**/
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
80
|
+
const HeaderSimple = _ref => {
|
|
81
|
+
let {
|
|
82
|
+
appName,
|
|
83
|
+
userName,
|
|
84
|
+
avatarSource,
|
|
85
|
+
avatarAlt,
|
|
86
|
+
searchComponent,
|
|
87
|
+
dataTestId,
|
|
88
|
+
variant,
|
|
89
|
+
currentWorkspace,
|
|
90
|
+
logo
|
|
91
|
+
} = _ref;
|
|
92
|
+
return /*#__PURE__*/_jsxs(Bar, {
|
|
98
93
|
dataTestId: dataTestId,
|
|
99
|
-
variant: variant
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
94
|
+
variant: variant,
|
|
95
|
+
children: [/*#__PURE__*/_jsxs(Flex, {
|
|
96
|
+
alignItems: "center",
|
|
97
|
+
children: [logo && /*#__PURE__*/_jsx(FlexItem, {
|
|
98
|
+
children: logo
|
|
99
|
+
}), /*#__PURE__*/_jsxs(Flex, {
|
|
100
|
+
flexDirection: "column",
|
|
101
|
+
justifyContent: "center",
|
|
102
|
+
children: [/*#__PURE__*/_jsx(AppName, {
|
|
103
|
+
variant: variant,
|
|
104
|
+
children: appName
|
|
105
|
+
}), currentWorkspace && /*#__PURE__*/_jsx(Small, {
|
|
106
|
+
color: "white",
|
|
107
|
+
fontSize: "0",
|
|
108
|
+
display: ["none", "none", "none", "block"],
|
|
109
|
+
children: currentWorkspace
|
|
110
|
+
})]
|
|
111
|
+
})]
|
|
112
|
+
}), searchComponent && /*#__PURE__*/_jsx(SearchContainer, {
|
|
113
|
+
children: searchComponent
|
|
114
|
+
}), /*#__PURE__*/_jsx(Flex, {
|
|
115
|
+
alignItems: "center",
|
|
116
|
+
ml: "auto",
|
|
117
|
+
display: searchComponent ? ["none", "none", "none", "flex"] : "flex",
|
|
118
|
+
children: /*#__PURE__*/_jsx(Avatar, {
|
|
119
|
+
type: "inverted",
|
|
120
|
+
sizing: "small",
|
|
121
|
+
title: userName,
|
|
122
|
+
image: avatarSource,
|
|
123
|
+
imageAlt: avatarAlt
|
|
124
|
+
})
|
|
125
|
+
})]
|
|
126
|
+
});
|
|
122
127
|
};
|
|
123
128
|
HeaderSimple.propTypes = {
|
|
124
129
|
/** Logo for app. Preferably an svg logo */
|
|
@@ -5,112 +5,113 @@ import { far } from "@fortawesome/free-regular-svg-icons";
|
|
|
5
5
|
import { fas } from "@fortawesome/free-solid-svg-icons";
|
|
6
6
|
import Box from "../Box";
|
|
7
7
|
import Flex from "../Flex";
|
|
8
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
9
|
library.add(far, fas);
|
|
9
10
|
export default {
|
|
10
11
|
title: "Components/Icon",
|
|
11
|
-
decorators: [
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}, /*#__PURE__*/React.createElement(Flex, {
|
|
12
|
+
decorators: [storyFn => /*#__PURE__*/_jsx(Box, {
|
|
13
|
+
p: "3",
|
|
14
|
+
children: /*#__PURE__*/_jsx(Flex, {
|
|
15
15
|
alignItems: "center",
|
|
16
|
-
justifyContent: "space-around"
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
justifyContent: "space-around",
|
|
17
|
+
children: storyFn()
|
|
18
|
+
})
|
|
19
|
+
})],
|
|
19
20
|
component: Icon
|
|
20
21
|
};
|
|
21
|
-
export
|
|
22
|
-
|
|
22
|
+
export const defaultIcon = () => /*#__PURE__*/_jsxs(_Fragment, {
|
|
23
|
+
children: [/*#__PURE__*/_jsx(Icon, {
|
|
23
24
|
icon: ["fas", "angle-down"],
|
|
24
25
|
title: "Down"
|
|
25
|
-
}), /*#__PURE__*/
|
|
26
|
+
}), /*#__PURE__*/_jsx(Icon, {
|
|
26
27
|
icon: ["fas", "plus"],
|
|
27
28
|
title: "Plus"
|
|
28
|
-
}), /*#__PURE__*/
|
|
29
|
+
}), /*#__PURE__*/_jsx(Icon, {
|
|
29
30
|
icon: ["far", "user"],
|
|
30
31
|
title: "User"
|
|
31
|
-
})
|
|
32
|
-
};
|
|
33
|
-
export
|
|
34
|
-
|
|
32
|
+
})]
|
|
33
|
+
});
|
|
34
|
+
export const colouredIcon = () => /*#__PURE__*/_jsxs(_Fragment, {
|
|
35
|
+
children: [/*#__PURE__*/_jsx(Icon, {
|
|
35
36
|
icon: ["fas", "angle-down"],
|
|
36
37
|
color: "primaryDark",
|
|
37
38
|
title: "Down"
|
|
38
|
-
}), /*#__PURE__*/
|
|
39
|
+
}), /*#__PURE__*/_jsx(Icon, {
|
|
39
40
|
icon: ["fas", "plus"],
|
|
40
41
|
color: "successDark",
|
|
41
42
|
title: "Plus"
|
|
42
|
-
}), /*#__PURE__*/
|
|
43
|
+
}), /*#__PURE__*/_jsx(Icon, {
|
|
43
44
|
icon: ["far", "user"],
|
|
44
45
|
color: "dangerDark",
|
|
45
46
|
title: "User"
|
|
46
|
-
})
|
|
47
|
-
};
|
|
48
|
-
export
|
|
49
|
-
|
|
47
|
+
})]
|
|
48
|
+
});
|
|
49
|
+
export const iconSize = () => /*#__PURE__*/_jsxs(_Fragment, {
|
|
50
|
+
children: [/*#__PURE__*/_jsx(Icon, {
|
|
50
51
|
icon: ["fas", "plus"],
|
|
51
52
|
size: "sm",
|
|
52
53
|
title: "Plus"
|
|
53
|
-
}), /*#__PURE__*/
|
|
54
|
+
}), /*#__PURE__*/_jsx(Icon, {
|
|
54
55
|
icon: ["fas", "plus"],
|
|
55
56
|
size: "rg",
|
|
56
57
|
title: "Plus"
|
|
57
|
-
}), /*#__PURE__*/
|
|
58
|
+
}), /*#__PURE__*/_jsx(Icon, {
|
|
58
59
|
icon: ["fas", "plus"],
|
|
59
60
|
size: "lg",
|
|
60
61
|
title: "Plus"
|
|
61
|
-
}), /*#__PURE__*/
|
|
62
|
+
}), /*#__PURE__*/_jsx(Icon, {
|
|
62
63
|
icon: ["fas", "plus"],
|
|
63
64
|
size: "2x",
|
|
64
65
|
title: "Plus"
|
|
65
|
-
})
|
|
66
|
-
};
|
|
67
|
-
export
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}, /*#__PURE__*/React.createElement(Flex, {
|
|
66
|
+
})]
|
|
67
|
+
});
|
|
68
|
+
export const invertedIcons = () => /*#__PURE__*/_jsx(Box, {
|
|
69
|
+
bg: "greyDarker",
|
|
70
|
+
width: "100%",
|
|
71
|
+
children: /*#__PURE__*/_jsxs(Flex, {
|
|
72
72
|
alignItems: "center",
|
|
73
|
-
justifyContent: "space-around"
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
|
|
73
|
+
justifyContent: "space-around",
|
|
74
|
+
children: [/*#__PURE__*/_jsx(Icon, {
|
|
75
|
+
icon: ["fas", "angle-down"],
|
|
76
|
+
inverse: true,
|
|
77
|
+
title: "Down"
|
|
78
|
+
}), /*#__PURE__*/_jsx(Icon, {
|
|
79
|
+
icon: ["fas", "plus"],
|
|
80
|
+
inverse: true,
|
|
81
|
+
title: "Plus"
|
|
82
|
+
}), /*#__PURE__*/_jsx(Icon, {
|
|
83
|
+
icon: ["far", "user"],
|
|
84
|
+
inverse: true,
|
|
85
|
+
title: "User"
|
|
86
|
+
})]
|
|
87
|
+
})
|
|
88
|
+
});
|
|
89
|
+
export const animatedIcons = () => /*#__PURE__*/_jsxs(_Fragment, {
|
|
90
|
+
children: [/*#__PURE__*/_jsx(Icon, {
|
|
90
91
|
icon: ["fas", "angle-down"],
|
|
91
92
|
spin: true,
|
|
92
93
|
title: "Spinning arrow"
|
|
93
|
-
}), /*#__PURE__*/
|
|
94
|
+
}), /*#__PURE__*/_jsx(Icon, {
|
|
94
95
|
icon: ["fas", "plus"],
|
|
95
96
|
pulse: true,
|
|
96
97
|
title: "Spinning plus"
|
|
97
|
-
})
|
|
98
|
-
};
|
|
99
|
-
export
|
|
100
|
-
|
|
98
|
+
})]
|
|
99
|
+
});
|
|
100
|
+
export const transformsAndRotations = () => /*#__PURE__*/_jsxs(_Fragment, {
|
|
101
|
+
children: [/*#__PURE__*/_jsx(Icon, {
|
|
101
102
|
icon: ["fas", "coffee"],
|
|
102
103
|
rotation: "270",
|
|
103
104
|
title: "Coffee"
|
|
104
|
-
}), /*#__PURE__*/
|
|
105
|
+
}), /*#__PURE__*/_jsx(Icon, {
|
|
105
106
|
icon: ["fas", "user"],
|
|
106
107
|
flip: "vertical",
|
|
107
108
|
title: "User"
|
|
108
|
-
}), /*#__PURE__*/
|
|
109
|
+
}), /*#__PURE__*/_jsx(Icon, {
|
|
109
110
|
icon: ["fas", "certificate"],
|
|
110
111
|
transform: "grow-8 up-10",
|
|
111
112
|
title: "Certificate"
|
|
112
|
-
})
|
|
113
|
-
};
|
|
113
|
+
})]
|
|
114
|
+
});
|
|
114
115
|
defaultIcon.__docgenInfo = {
|
|
115
116
|
"description": "",
|
|
116
117
|
"methods": [],
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["border", "mask", "fixedWidth", "inverse", "flip", "icon", "listitem", "pull", "pulse", "rotation", "size", "spin", "symbol", "transform", "color", "theme", "title"];
|
|
4
1
|
import React from "react";
|
|
5
2
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|
6
3
|
import PropTypes from "prop-types";
|
|
@@ -19,9 +16,9 @@ import { space, color, typography, compose } from "styled-system";
|
|
|
19
16
|
*
|
|
20
17
|
* To get started you can import the icons into Font Awesome library. Alternatively if you want to use their full icon set you need to purchase a PRO plan from Font awesome, and can install the full pro icon packages in your app. See the readme here for more details on how to use and install PRO: <https://github.com/orchestrated-io/orcs-design-system>
|
|
21
18
|
*/
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
20
|
+
const IconStyles = compose(space, color, typography);
|
|
21
|
+
const IconWrapper = styled("span").withConfig({
|
|
25
22
|
displayName: "Icon__IconWrapper",
|
|
26
23
|
componentId: "sc-xeqnbo-0"
|
|
27
24
|
})(css({
|
|
@@ -29,46 +26,51 @@ var IconWrapper = styled("span").withConfig({
|
|
|
29
26
|
display: "inline-block"
|
|
30
27
|
}), IconStyles);
|
|
31
28
|
export default function Icon(_ref) {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
29
|
+
let {
|
|
30
|
+
border,
|
|
31
|
+
mask,
|
|
32
|
+
fixedWidth,
|
|
33
|
+
inverse,
|
|
34
|
+
flip,
|
|
35
|
+
icon,
|
|
36
|
+
listitem,
|
|
37
|
+
pull,
|
|
38
|
+
pulse,
|
|
39
|
+
rotation,
|
|
40
|
+
size,
|
|
41
|
+
spin,
|
|
42
|
+
symbol,
|
|
43
|
+
transform,
|
|
44
|
+
color,
|
|
45
|
+
theme,
|
|
46
|
+
title,
|
|
47
|
+
...props
|
|
48
|
+
} = _ref;
|
|
49
|
+
const component = /*#__PURE__*/_jsx(IconWrapper, {
|
|
50
|
+
color: color,
|
|
51
|
+
...props,
|
|
52
|
+
children: /*#__PURE__*/_jsx(FontAwesomeIcon, {
|
|
53
|
+
border: border,
|
|
54
|
+
mask: mask,
|
|
55
|
+
fixedWidth: fixedWidth,
|
|
56
|
+
inverse: inverse,
|
|
57
|
+
flip: flip,
|
|
58
|
+
listitem: listitem,
|
|
59
|
+
pull: pull,
|
|
60
|
+
rotation: rotation,
|
|
61
|
+
icon: icon,
|
|
62
|
+
pulse: pulse,
|
|
63
|
+
size: size,
|
|
64
|
+
spin: spin,
|
|
65
|
+
symbol: symbol,
|
|
66
|
+
transform: transform,
|
|
67
|
+
title: title && "Icon-".concat(title)
|
|
68
|
+
})
|
|
69
|
+
});
|
|
70
|
+
return theme ? /*#__PURE__*/_jsx(ThemeProvider, {
|
|
71
|
+
theme: theme,
|
|
72
|
+
children: component
|
|
73
|
+
}) : component;
|
|
72
74
|
}
|
|
73
75
|
Icon.propTypes = {
|
|
74
76
|
/** Colours the icon using colours from the system colour palette */
|
|
@@ -2,56 +2,49 @@ import React from "react";
|
|
|
2
2
|
import Loading from ".";
|
|
3
3
|
import Spacer from "../Spacer";
|
|
4
4
|
import Box from "../Box";
|
|
5
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
5
6
|
export default {
|
|
6
7
|
title: "Components/Loading",
|
|
7
|
-
decorators: [
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}],
|
|
8
|
+
decorators: [storyFn => /*#__PURE__*/_jsx(Box, {
|
|
9
|
+
p: "r",
|
|
10
|
+
children: storyFn()
|
|
11
|
+
})],
|
|
12
12
|
component: Loading
|
|
13
13
|
};
|
|
14
|
-
export
|
|
15
|
-
return /*#__PURE__*/React.createElement(Loading, null);
|
|
16
|
-
};
|
|
14
|
+
export const defaultLoading = () => /*#__PURE__*/_jsx(Loading, {});
|
|
17
15
|
defaultLoading.storyName = "Default";
|
|
18
|
-
export
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
});
|
|
22
|
-
};
|
|
16
|
+
export const largeLoading = () => /*#__PURE__*/_jsx(Loading, {
|
|
17
|
+
large: true
|
|
18
|
+
});
|
|
23
19
|
largeLoading.storyName = "Large";
|
|
24
|
-
export
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}, /*#__PURE__*/React.createElement(Loading, {
|
|
20
|
+
export const centeredLoading = () => /*#__PURE__*/_jsxs(Spacer, {
|
|
21
|
+
p: "r",
|
|
22
|
+
children: [/*#__PURE__*/_jsx(Loading, {
|
|
28
23
|
centered: true
|
|
29
|
-
}), /*#__PURE__*/
|
|
24
|
+
}), /*#__PURE__*/_jsx(Loading, {
|
|
30
25
|
large: true,
|
|
31
26
|
centered: true
|
|
32
|
-
})
|
|
33
|
-
};
|
|
27
|
+
})]
|
|
28
|
+
});
|
|
34
29
|
centeredLoading.storyName = "Centered";
|
|
35
|
-
export
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
});
|
|
40
|
-
};
|
|
30
|
+
export const colouredLoading = () => /*#__PURE__*/_jsx(Loading, {
|
|
31
|
+
large: true,
|
|
32
|
+
primary: true
|
|
33
|
+
});
|
|
41
34
|
colouredLoading.storyName = "Coloured";
|
|
42
|
-
export
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
})
|
|
54
|
-
};
|
|
35
|
+
export const invertedLoading = () => /*#__PURE__*/_jsx(Box, {
|
|
36
|
+
bg: "greyDarkest",
|
|
37
|
+
p: "r",
|
|
38
|
+
children: /*#__PURE__*/_jsxs(Spacer, {
|
|
39
|
+
p: "r",
|
|
40
|
+
children: [/*#__PURE__*/_jsx(Loading, {
|
|
41
|
+
inverted: true
|
|
42
|
+
}), /*#__PURE__*/_jsx(Loading, {
|
|
43
|
+
large: true,
|
|
44
|
+
inverted: true
|
|
45
|
+
})]
|
|
46
|
+
})
|
|
47
|
+
});
|
|
55
48
|
invertedLoading.storyName = "Inverted";
|
|
56
49
|
defaultLoading.__docgenInfo = {
|
|
57
50
|
"description": "",
|