orcs-design-system 3.2.44 → 3.2.46
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.
|
@@ -1,29 +1,27 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import Flex from ".";
|
|
3
3
|
import Button from "../Button";
|
|
4
|
-
import Spacer from "../Spacer";
|
|
5
4
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
5
|
export default {
|
|
7
6
|
title: "Components/Flex",
|
|
8
7
|
component: Flex
|
|
9
8
|
};
|
|
10
|
-
export const basicFlex = () => /*#__PURE__*/
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
})
|
|
9
|
+
export const basicFlex = () => /*#__PURE__*/_jsxs(Flex, {
|
|
10
|
+
gap: "r",
|
|
11
|
+
flexWrap: "wrap",
|
|
12
|
+
children: [/*#__PURE__*/_jsx(Button, {
|
|
13
|
+
children: "Button 1"
|
|
14
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
15
|
+
children: "Button 2"
|
|
16
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
17
|
+
children: "Button 3"
|
|
18
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
19
|
+
children: "Button 4"
|
|
20
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
21
|
+
children: "Button 5"
|
|
22
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
23
|
+
children: "Button 6"
|
|
24
|
+
})]
|
|
27
25
|
});
|
|
28
26
|
basicFlex.storyName = "Basic Flex";
|
|
29
27
|
basicFlex.__docgenInfo = {
|
|
@@ -13,8 +13,9 @@ const FlexWrapper = styled("div").withConfig({
|
|
|
13
13
|
componentId: "sc-1f3kfw7-0"
|
|
14
14
|
}).attrs(props => ({
|
|
15
15
|
"data-testid": props.dataTestId ? props.dataTestId : props["data-testid"] ? props["data-testid"] : null
|
|
16
|
-
}))(css({
|
|
17
|
-
boxSizing: "border-box"
|
|
16
|
+
}))(props => css({
|
|
17
|
+
boxSizing: "border-box",
|
|
18
|
+
gap: props.gap
|
|
18
19
|
}), FlexStyles);
|
|
19
20
|
const FlexItem = styled("div").withConfig({
|
|
20
21
|
displayName: "Flex__FlexItem",
|
|
@@ -25,10 +26,12 @@ const FlexItem = styled("div").withConfig({
|
|
|
25
26
|
export default function Flex(_ref) {
|
|
26
27
|
let {
|
|
27
28
|
children,
|
|
29
|
+
gap,
|
|
28
30
|
theme,
|
|
29
31
|
...props
|
|
30
32
|
} = _ref;
|
|
31
33
|
const component = /*#__PURE__*/_jsx(FlexWrapper, {
|
|
34
|
+
gap: gap,
|
|
32
35
|
...props,
|
|
33
36
|
children: children
|
|
34
37
|
});
|
|
@@ -49,6 +52,7 @@ export default function Flex(_ref) {
|
|
|
49
52
|
Flex.propTypes = {
|
|
50
53
|
/** Children of `Flex` are taken as node elements */
|
|
51
54
|
children: PropTypes.node,
|
|
55
|
+
gap: PropTypes.string,
|
|
52
56
|
theme: PropTypes.object,
|
|
53
57
|
...styledPropTypes.space,
|
|
54
58
|
...styledPropTypes.layout,
|
|
@@ -109,6 +113,13 @@ Flex.__docgenInfo = {
|
|
|
109
113
|
},
|
|
110
114
|
"required": false
|
|
111
115
|
},
|
|
116
|
+
"gap": {
|
|
117
|
+
"description": "",
|
|
118
|
+
"type": {
|
|
119
|
+
"name": "string"
|
|
120
|
+
},
|
|
121
|
+
"required": false
|
|
122
|
+
},
|
|
112
123
|
"theme": {
|
|
113
124
|
"description": "",
|
|
114
125
|
"type": {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useCallback, useMemo } from "react";
|
|
2
2
|
import { useMaterialReactTable, MaterialReactTable } from "material-react-table";
|
|
3
|
-
import { merge } from "lodash";
|
|
3
|
+
import { merge, map } from "lodash";
|
|
4
4
|
import muiStyleOverrides from "./muiStyleOverrides";
|
|
5
5
|
import getExpandColumnConfig from "./getExpandColumnConfig";
|
|
6
6
|
import { PropTypes } from "prop-types";
|
|
@@ -8,11 +8,19 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
8
8
|
const Table = _ref => {
|
|
9
9
|
let {
|
|
10
10
|
data,
|
|
11
|
-
columns,
|
|
11
|
+
columns: columnOverrides,
|
|
12
12
|
...tableConfig
|
|
13
13
|
} = _ref;
|
|
14
14
|
const otherConfig = {};
|
|
15
15
|
const columnVisibility = {};
|
|
16
|
+
const columns = useMemo(() => {
|
|
17
|
+
return tableConfig?.enableSorting ? columnOverrides : map(columnOverrides, col => {
|
|
18
|
+
return {
|
|
19
|
+
...col,
|
|
20
|
+
enableSorting: false
|
|
21
|
+
};
|
|
22
|
+
});
|
|
23
|
+
}, [columnOverrides, tableConfig?.enableSorting]);
|
|
16
24
|
const firstCol = useMemo(() => columns[0], [columns]);
|
|
17
25
|
if (tableConfig.enableExpanding) {
|
|
18
26
|
columnVisibility[firstCol.id] = false;
|
|
@@ -26,6 +34,7 @@ const Table = _ref => {
|
|
|
26
34
|
...tableConfig,
|
|
27
35
|
columns,
|
|
28
36
|
data,
|
|
37
|
+
enableExpanding: true,
|
|
29
38
|
initialState: merge({
|
|
30
39
|
density: "compact",
|
|
31
40
|
columnVisibility
|
|
@@ -1,37 +1,60 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Icon from "../Icon";
|
|
3
|
+
import Box from "../Box";
|
|
4
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
5
|
const muiStyleOverrides = {
|
|
6
|
+
muiExpandButtonProps: _ref => {
|
|
7
|
+
let {
|
|
8
|
+
row
|
|
9
|
+
} = _ref;
|
|
10
|
+
return {
|
|
11
|
+
children: row?.getIsExpanded() ? /*#__PURE__*/_jsx(Box, {
|
|
12
|
+
p: "s",
|
|
13
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
14
|
+
icon: ["fas", "chevron-down"],
|
|
15
|
+
size: "xs"
|
|
16
|
+
})
|
|
17
|
+
}) : /*#__PURE__*/_jsx(Box, {
|
|
18
|
+
p: "s",
|
|
19
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
20
|
+
icon: ["fal", "chevron-right"],
|
|
21
|
+
size: "xs"
|
|
22
|
+
})
|
|
23
|
+
})
|
|
24
|
+
};
|
|
25
|
+
},
|
|
2
26
|
muiBottomToolbarProps: {
|
|
3
27
|
sx: {
|
|
4
|
-
|
|
28
|
+
display: "none" // Remove bottom toolbar
|
|
5
29
|
}
|
|
6
30
|
},
|
|
7
31
|
muiTableHeadProps: {
|
|
8
32
|
sx: {
|
|
9
|
-
|
|
10
|
-
|
|
33
|
+
backgroundColor: "transparent",
|
|
34
|
+
// No background for header
|
|
11
35
|
"& .MuiTableCell-root": {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
borderRadius: "5px 0px 0px 5px"
|
|
36
|
+
color: "#6b7280",
|
|
37
|
+
// Subtle text color (gray tone)
|
|
38
|
+
fontWeight: "500",
|
|
39
|
+
// Slightly bold for clarity
|
|
40
|
+
padding: "0 0 6px 0",
|
|
41
|
+
// Consistent padding
|
|
42
|
+
borderBottom: "1px solid #e0e0e0",
|
|
43
|
+
// Subtle header-row separation
|
|
44
|
+
textAlign: "left",
|
|
45
|
+
// Ensure text alignment is consistent
|
|
46
|
+
lineHeight: "1.5" // Enhance readability
|
|
24
47
|
},
|
|
25
|
-
"&
|
|
26
|
-
|
|
48
|
+
"& button": {
|
|
49
|
+
display: "none" // Explicitly hide any buttons in the header
|
|
27
50
|
}
|
|
28
51
|
}
|
|
29
52
|
},
|
|
30
|
-
muiTableBodyRowProps:
|
|
53
|
+
muiTableBodyRowProps: _ref2 => {
|
|
31
54
|
let {
|
|
32
55
|
row,
|
|
33
56
|
table
|
|
34
|
-
} =
|
|
57
|
+
} = _ref2;
|
|
35
58
|
let borderBottomStyle = "solid";
|
|
36
59
|
if (row.getIsExpanded()) {
|
|
37
60
|
borderBottomStyle = "dashed";
|
|
@@ -57,9 +80,35 @@ const muiStyleOverrides = {
|
|
|
57
80
|
sx: {
|
|
58
81
|
borderCollapse: "separate !important",
|
|
59
82
|
tableLayout: "fixed",
|
|
60
|
-
|
|
83
|
+
fontFamily: "inherit",
|
|
84
|
+
fontSize: "inherit",
|
|
85
|
+
fontWeight: "normal",
|
|
86
|
+
"& th, .MuiTableCell-root": {
|
|
87
|
+
fontWeight: "normal",
|
|
88
|
+
fontSize: "inherit",
|
|
89
|
+
fontFamily: "inherit"
|
|
90
|
+
},
|
|
91
|
+
"& td": {
|
|
92
|
+
fontFamily: "inherit",
|
|
93
|
+
fontSize: "inherit",
|
|
94
|
+
fontWeight: "normal"
|
|
95
|
+
},
|
|
61
96
|
"& td, .MuiTableCell-root": {
|
|
62
|
-
|
|
97
|
+
padding: "6px 0 6px 0",
|
|
98
|
+
marginLeft: "0"
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
muiTableBodyCellProps: {
|
|
103
|
+
sx: {
|
|
104
|
+
fontWeight: "normal",
|
|
105
|
+
// Remove bold when expanded
|
|
106
|
+
// Default row cell style
|
|
107
|
+
"&.MuiTableRow-root": {
|
|
108
|
+
fontWeight: "normal" // Ensure the font is not bold by default
|
|
109
|
+
},
|
|
110
|
+
"&.expanded": {
|
|
111
|
+
fontWeight: "normal" // Remove bold when expanded
|
|
63
112
|
}
|
|
64
113
|
}
|
|
65
114
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "orcs-design-system",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.46",
|
|
4
4
|
"engines": {
|
|
5
5
|
"node": "20.12.2"
|
|
6
6
|
},
|
|
@@ -144,6 +144,7 @@
|
|
|
144
144
|
},
|
|
145
145
|
"overrides": {
|
|
146
146
|
"braces": "3.0.3",
|
|
147
|
+
"cross-spawn": "7.0.6",
|
|
147
148
|
"eslint-plugin-testing-library": "^5.11.1",
|
|
148
149
|
"jest": "$jest",
|
|
149
150
|
"nth-check": "2.1.0",
|