@sphereon/ui-components.ssi-react 0.4.1-unstable.67 → 0.4.1-unstable.68
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,6 +1,51 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useState } from 'react';
|
|
3
3
|
import { Switch, Tooltip } from '@mui/material';
|
|
4
|
+
import { styled } from '@mui/material/styles';
|
|
5
|
+
const MaterialSwitch = styled(Switch)(({ theme }) => ({
|
|
6
|
+
width: 52,
|
|
7
|
+
height: 32,
|
|
8
|
+
padding: 0,
|
|
9
|
+
'& .MuiSwitch-switchBase': {
|
|
10
|
+
padding: 4,
|
|
11
|
+
transitionDuration: '300ms',
|
|
12
|
+
'&.Mui-checked': {
|
|
13
|
+
transform: 'translateX(20px)',
|
|
14
|
+
color: '#fff',
|
|
15
|
+
'& + .MuiSwitch-track': {
|
|
16
|
+
backgroundColor: '#6750A4',
|
|
17
|
+
opacity: 1,
|
|
18
|
+
border: 0,
|
|
19
|
+
},
|
|
20
|
+
'&.Mui-disabled + .MuiSwitch-track': {
|
|
21
|
+
opacity: 0.5,
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
'&.Mui-focusVisible .MuiSwitch-thumb': {
|
|
25
|
+
color: '#6750A4',
|
|
26
|
+
border: '6px solid #fff',
|
|
27
|
+
},
|
|
28
|
+
'&.Mui-disabled .MuiSwitch-thumb': {
|
|
29
|
+
color: theme.palette.grey[100],
|
|
30
|
+
},
|
|
31
|
+
'&.Mui-disabled + .MuiSwitch-track': {
|
|
32
|
+
opacity: 0.3,
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
'& .MuiSwitch-thumb': {
|
|
36
|
+
boxSizing: 'border-box',
|
|
37
|
+
width: 24,
|
|
38
|
+
height: 24,
|
|
39
|
+
},
|
|
40
|
+
'& .MuiSwitch-track': {
|
|
41
|
+
borderRadius: 16,
|
|
42
|
+
backgroundColor: '#E3E3E3',
|
|
43
|
+
opacity: 1,
|
|
44
|
+
transition: theme.transitions.create(['background-color'], {
|
|
45
|
+
duration: 300,
|
|
46
|
+
}),
|
|
47
|
+
},
|
|
48
|
+
}));
|
|
4
49
|
const SSISwitchItem = (props) => {
|
|
5
50
|
const { label, checked, onChange, tooltip, disabled = false } = props;
|
|
6
51
|
const [showTooltip, setShowTooltip] = useState(false);
|
|
@@ -11,16 +56,15 @@ const SSISwitchItem = (props) => {
|
|
|
11
56
|
display: 'flex',
|
|
12
57
|
flexDirection: 'row',
|
|
13
58
|
alignItems: 'center',
|
|
14
|
-
|
|
15
|
-
gap: '16px',
|
|
59
|
+
gap: '12px',
|
|
16
60
|
};
|
|
17
61
|
const labelStyle = {
|
|
18
62
|
fontSize: '14px',
|
|
19
63
|
fontWeight: 400,
|
|
20
|
-
color: '#
|
|
21
|
-
|
|
64
|
+
color: '#303030',
|
|
65
|
+
letterSpacing: '0.14px',
|
|
22
66
|
};
|
|
23
|
-
const content = (_jsxs("div", { style: containerStyle, children: [_jsx(
|
|
67
|
+
const content = (_jsxs("div", { style: containerStyle, children: [_jsx(MaterialSwitch, { checked: checked, onChange: handleChange, disabled: disabled }), _jsx("span", { style: labelStyle, children: label })] }));
|
|
24
68
|
if (tooltip) {
|
|
25
69
|
return (_jsx(Tooltip, { title: tooltip, open: showTooltip, onOpen: () => setShowTooltip(true), onClose: () => setShowTooltip(false), arrow: true, children: _jsx("div", { onMouseEnter: () => setShowTooltip(true), onMouseLeave: () => setShowTooltip(false), children: content }) }));
|
|
26
70
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sphereon/ui-components.ssi-react",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.4.1-unstable.
|
|
4
|
+
"version": "0.4.1-unstable.68+7d751f9",
|
|
5
5
|
"description": "SSI UI components for React",
|
|
6
6
|
"repository": "git@github.com:Sphereon-Opensource/UI-Components.git",
|
|
7
7
|
"author": "Sphereon <dev@sphereon.com>",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"@mui/x-date-pickers": "^6.19.5",
|
|
51
51
|
"@sphereon/ssi-sdk.data-store": "0.34.1-feature.SSISDK.45.94",
|
|
52
52
|
"@sphereon/ssi-types": "0.34.1-feature.SSISDK.45.94",
|
|
53
|
-
"@sphereon/ui-components.core": "0.4.1-unstable.
|
|
53
|
+
"@sphereon/ui-components.core": "0.4.1-unstable.68+7d751f9",
|
|
54
54
|
"@tanstack/react-table": "^8.9.3",
|
|
55
55
|
"react-dom": "npm:react-dom@18.3.1",
|
|
56
56
|
"react-json-tree": "^0.18.0",
|
|
@@ -70,5 +70,5 @@
|
|
|
70
70
|
"peerDependencies": {
|
|
71
71
|
"react": ">= 18"
|
|
72
72
|
},
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "7d751f9899d69b34817a349ad5b507853c2b82ce"
|
|
74
74
|
}
|