orcs-design-system 3.3.11 → 3.3.13
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.
|
@@ -104,9 +104,10 @@ export const complexCard = () => /*#__PURE__*/_jsx(Flex, {
|
|
|
104
104
|
children: /*#__PURE__*/_jsxs(Spacer, {
|
|
105
105
|
mx: "r",
|
|
106
106
|
children: [/*#__PURE__*/_jsx(Card, {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
107
|
+
children: /*#__PURE__*/_jsxs(Flex, {
|
|
108
|
+
flexDirection: "column",
|
|
109
|
+
gap: "r",
|
|
110
|
+
alignItems: "center",
|
|
110
111
|
children: [/*#__PURE__*/_jsx(Icon, {
|
|
111
112
|
icon: ["fas", "file"],
|
|
112
113
|
size: "3x",
|
|
@@ -120,9 +121,10 @@ export const complexCard = () => /*#__PURE__*/_jsx(Flex, {
|
|
|
120
121
|
})]
|
|
121
122
|
})
|
|
122
123
|
}), /*#__PURE__*/_jsx(Card, {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
124
|
+
children: /*#__PURE__*/_jsxs(Flex, {
|
|
125
|
+
flexDirection: "column",
|
|
126
|
+
gap: "r",
|
|
127
|
+
alignItems: "center",
|
|
126
128
|
children: [/*#__PURE__*/_jsx(Icon, {
|
|
127
129
|
icon: ["fas", "eye"],
|
|
128
130
|
size: "3x",
|
|
@@ -3,14 +3,14 @@ import styled, { css, ThemeProvider } from "styled-components";
|
|
|
3
3
|
import PropTypes from "prop-types";
|
|
4
4
|
import Icon from "../Icon/";
|
|
5
5
|
import Box from "../Box/";
|
|
6
|
+
import Flex from "../Flex/";
|
|
6
7
|
import { H3, H4 } from "../Typography";
|
|
7
|
-
import { space, layout } from "styled-system";
|
|
8
8
|
import { themeGet } from "@styled-system/theme-get";
|
|
9
9
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
|
-
const Item = styled.
|
|
10
|
+
const Item = styled(Box).withConfig({
|
|
11
11
|
displayName: "Card__Item",
|
|
12
12
|
componentId: "sc-yfq75p-0"
|
|
13
|
-
})(["
|
|
13
|
+
})(["word-break:break-word;"]);
|
|
14
14
|
const ChangeIcon = styled.div.withConfig({
|
|
15
15
|
displayName: "Card__ChangeIcon",
|
|
16
16
|
componentId: "sc-yfq75p-1"
|
|
@@ -36,24 +36,34 @@ export default function Card(_ref) {
|
|
|
36
36
|
changeIcon,
|
|
37
37
|
changeValue,
|
|
38
38
|
children,
|
|
39
|
-
fluid,
|
|
40
|
-
width,
|
|
41
|
-
center,
|
|
42
39
|
theme,
|
|
40
|
+
fluid,
|
|
43
41
|
...props
|
|
44
42
|
} = _ref;
|
|
45
43
|
const component = /*#__PURE__*/_jsxs(Item, {
|
|
46
|
-
alternate: alternate,
|
|
47
44
|
colour: colour,
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
45
|
+
borderRadius: "2",
|
|
46
|
+
bg: "white",
|
|
47
|
+
height: fluid ? "100%" : "auto",
|
|
48
|
+
width: fluid ? "100%" : "auto",
|
|
49
|
+
p: "r",
|
|
50
|
+
...(colour ? {
|
|
51
|
+
borderTop: "3px solid",
|
|
52
|
+
borderTopColor: colour,
|
|
53
|
+
borderTopLeftRadius: "0",
|
|
54
|
+
borderTopRightRadius: "0"
|
|
55
|
+
} : {
|
|
56
|
+
boxBorder: "default"
|
|
57
|
+
}),
|
|
51
58
|
...props,
|
|
52
|
-
children: [!icon & !title & !subtitle ? null : /*#__PURE__*/_jsxs(
|
|
59
|
+
children: [!icon & !title & !subtitle ? null : /*#__PURE__*/_jsxs(Flex, {
|
|
53
60
|
mb: "r",
|
|
61
|
+
width: "100%",
|
|
62
|
+
alignItems: alternate ? "center" : "flex-start",
|
|
63
|
+
flexDirection: alternate ? "row" : "column",
|
|
54
64
|
children: [icon ? /*#__PURE__*/_jsx(Icon, {
|
|
55
65
|
icon: icon,
|
|
56
|
-
size: "
|
|
66
|
+
size: "1x",
|
|
57
67
|
mr: "s"
|
|
58
68
|
}) : null, title ? /*#__PURE__*/_jsx(H3, {
|
|
59
69
|
children: title
|
|
@@ -64,6 +74,7 @@ export default function Card(_ref) {
|
|
|
64
74
|
}) : null, subtitle ? /*#__PURE__*/_jsx(H4, {
|
|
65
75
|
fontSize: "1",
|
|
66
76
|
color: "greyDark",
|
|
77
|
+
ml: alternate ? "auto" : 0,
|
|
67
78
|
children: subtitle
|
|
68
79
|
}) : null]
|
|
69
80
|
}), /*#__PURE__*/_jsx(Box, {
|
|
@@ -76,26 +87,26 @@ export default function Card(_ref) {
|
|
|
76
87
|
}) : component;
|
|
77
88
|
}
|
|
78
89
|
Card.propTypes = {
|
|
79
|
-
/** Changes card styles to suit a card that holds alternate data */
|
|
80
|
-
alternate: PropTypes.bool,
|
|
81
|
-
/** Forces card to take 100% width and height of parent element */
|
|
82
|
-
fluid: PropTypes.bool,
|
|
83
90
|
/** Applies an icon to header of specified name */
|
|
84
91
|
icon: PropTypes.array,
|
|
85
92
|
/** Card title */
|
|
86
93
|
title: PropTypes.node,
|
|
87
94
|
/** Card subtitle */
|
|
88
95
|
subtitle: PropTypes.node,
|
|
89
|
-
/**
|
|
90
|
-
center: PropTypes.bool,
|
|
91
|
-
/** Can specify a width in pixels or percentages (make sure you specify units). Can also use calc (see code for example) */
|
|
96
|
+
/** Can specify a width in pixels or percentages. Can also use calc. */
|
|
92
97
|
width: PropTypes.string,
|
|
98
|
+
/** Can specify a height in pixels or percentages. Can also use calc. */
|
|
99
|
+
height: PropTypes.string,
|
|
93
100
|
/** Adds a coloured top border. Uses the system colours (eg primary, warning) */
|
|
94
101
|
colour: PropTypes.string,
|
|
95
102
|
/** Specify the icon to be used for the changeValue element. */
|
|
96
103
|
changeIcon: PropTypes.oneOf(["arrowUp", "arrowDown"]),
|
|
97
104
|
/** Adds a gray inline element to the card heading to describe change in value */
|
|
98
105
|
changeValue: PropTypes.string,
|
|
106
|
+
/** Pushes subtitle to the right of the title rather than stacked underneath */
|
|
107
|
+
alternate: PropTypes.bool,
|
|
108
|
+
/** Forces card to take 100% width and height of parent element */
|
|
109
|
+
fluid: PropTypes.bool,
|
|
99
110
|
/** Card contents. */
|
|
100
111
|
children: PropTypes.oneOfType([PropTypes.node, PropTypes.arrayOf(PropTypes.node)]),
|
|
101
112
|
/** Specifies the system design theme. */
|
|
@@ -106,20 +117,6 @@ Card.__docgenInfo = {
|
|
|
106
117
|
"methods": [],
|
|
107
118
|
"displayName": "Card",
|
|
108
119
|
"props": {
|
|
109
|
-
"alternate": {
|
|
110
|
-
"description": "Changes card styles to suit a card that holds alternate data",
|
|
111
|
-
"type": {
|
|
112
|
-
"name": "bool"
|
|
113
|
-
},
|
|
114
|
-
"required": false
|
|
115
|
-
},
|
|
116
|
-
"fluid": {
|
|
117
|
-
"description": "Forces card to take 100% width and height of parent element",
|
|
118
|
-
"type": {
|
|
119
|
-
"name": "bool"
|
|
120
|
-
},
|
|
121
|
-
"required": false
|
|
122
|
-
},
|
|
123
120
|
"icon": {
|
|
124
121
|
"description": "Applies an icon to header of specified name",
|
|
125
122
|
"type": {
|
|
@@ -141,15 +138,15 @@ Card.__docgenInfo = {
|
|
|
141
138
|
},
|
|
142
139
|
"required": false
|
|
143
140
|
},
|
|
144
|
-
"
|
|
145
|
-
"description": "
|
|
141
|
+
"width": {
|
|
142
|
+
"description": "Can specify a width in pixels or percentages. Can also use calc.",
|
|
146
143
|
"type": {
|
|
147
|
-
"name": "
|
|
144
|
+
"name": "string"
|
|
148
145
|
},
|
|
149
146
|
"required": false
|
|
150
147
|
},
|
|
151
|
-
"
|
|
152
|
-
"description": "Can specify a
|
|
148
|
+
"height": {
|
|
149
|
+
"description": "Can specify a height in pixels or percentages. Can also use calc.",
|
|
153
150
|
"type": {
|
|
154
151
|
"name": "string"
|
|
155
152
|
},
|
|
@@ -183,6 +180,20 @@ Card.__docgenInfo = {
|
|
|
183
180
|
},
|
|
184
181
|
"required": false
|
|
185
182
|
},
|
|
183
|
+
"alternate": {
|
|
184
|
+
"description": "Pushes subtitle to the right of the title rather than stacked underneath",
|
|
185
|
+
"type": {
|
|
186
|
+
"name": "bool"
|
|
187
|
+
},
|
|
188
|
+
"required": false
|
|
189
|
+
},
|
|
190
|
+
"fluid": {
|
|
191
|
+
"description": "Forces card to take 100% width and height of parent element",
|
|
192
|
+
"type": {
|
|
193
|
+
"name": "bool"
|
|
194
|
+
},
|
|
195
|
+
"required": false
|
|
196
|
+
},
|
|
186
197
|
"children": {
|
|
187
198
|
"description": "Card contents.",
|
|
188
199
|
"type": {
|
|
@@ -42,7 +42,7 @@ export const PanelWrapper = styled.div.withConfig({
|
|
|
42
42
|
export const PanelHeader = styled.button.withConfig({
|
|
43
43
|
displayName: "FloatingPanelsstyles__PanelHeader",
|
|
44
44
|
componentId: "sc-1by914f-3"
|
|
45
|
-
})(["font-family:", ";color:", ";margin-left:-1px;margin-top:-37px;border-radius:8px 8px 0 0;appearance:none;background-color:white;display:flex;align-items:center;justify-content:space-between;padding:
|
|
45
|
+
})(["font-family:", ";color:", ";margin-left:-1px;margin-top:-37px;border-radius:8px 8px 0 0;appearance:none;background-color:white;display:flex;align-items:center;justify-content:space-between;padding:8px;height:37px;position:absolute;width:", ";border:solid 1px ", ";z-index:1;cursor:pointer;user-select:none;transition:padding 0.3s ease-in-out;&:focus{outline:none;}"], themeGet("fonts.main"), themeGet("colors.greyDarkest"), panelWidth, themeGet("colors.greyLighter"));
|
|
46
46
|
export const HeaderContent = styled.div.withConfig({
|
|
47
47
|
displayName: "FloatingPanelsstyles__HeaderContent",
|
|
48
48
|
componentId: "sc-1by914f-4"
|
|
@@ -67,7 +67,7 @@ export const IconButton = styled.button.withConfig({
|
|
|
67
67
|
export const PanelContent = styled.div.withConfig({
|
|
68
68
|
displayName: "FloatingPanelsstyles__PanelContent",
|
|
69
69
|
componentId: "sc-1by914f-8"
|
|
70
|
-
})(["padding:
|
|
70
|
+
})(["padding:8px;width:inerhit;display:", ";height:", ";opacity:", ";"], _ref8 => {
|
|
71
71
|
let {
|
|
72
72
|
isExpanded
|
|
73
73
|
} = _ref8;
|
|
@@ -18,6 +18,8 @@ defaultTag.storyName = "Default";
|
|
|
18
18
|
export const Selected = () => {
|
|
19
19
|
const [selectedA, setSelectedA] = useState(true);
|
|
20
20
|
const [selectedB, setSelectedB] = useState(true);
|
|
21
|
+
const [selectedC, setSelectedC] = useState(true);
|
|
22
|
+
const [selectedD, setSelectedD] = useState(true);
|
|
21
23
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
22
24
|
children: [/*#__PURE__*/_jsx(Tag, {
|
|
23
25
|
selected: selectedA,
|
|
@@ -28,8 +30,12 @@ export const Selected = () => {
|
|
|
28
30
|
onClick: () => setSelectedB(!selectedB),
|
|
29
31
|
children: "software engineering"
|
|
30
32
|
}), /*#__PURE__*/_jsx(Tag, {
|
|
33
|
+
selected: selectedC,
|
|
34
|
+
onClick: () => setSelectedC(!selectedC),
|
|
31
35
|
children: "product design"
|
|
32
36
|
}), /*#__PURE__*/_jsx(Tag, {
|
|
37
|
+
selected: selectedD,
|
|
38
|
+
onClick: () => setSelectedD(!selectedD),
|
|
33
39
|
children: "digital transformation"
|
|
34
40
|
})]
|
|
35
41
|
});
|