@sphereon/ui-components.ssi-react 0.4.1-unstable.2 → 0.4.1-unstable.21
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/dist/components/indicators/ProgressStepIndicator/index.js +4 -3
- package/dist/components/views/ContactViewItem/index.d.ts +2 -1
- package/dist/components/views/FormView/index.js +7 -11
- package/dist/components/views/FormView/styles.css +105 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/styles/css/tailwind.css +4 -1
- package/package.json +13 -6
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Fragment } from 'react';
|
|
2
3
|
import { elementColors, fontColors, Localization } from '@sphereon/ui-components.core';
|
|
3
4
|
import StepMarker from '../../assets/markers/StepMarker';
|
|
4
5
|
import { gradientColors } from '../../../styles/colors';
|
|
@@ -7,7 +8,7 @@ import { StepStatus } from '../../../types';
|
|
|
7
8
|
const getStepRowElement = (stepNumber, status, step, maxSteps) => {
|
|
8
9
|
const { title, description, required = true } = step;
|
|
9
10
|
const gridRowNumber = stepNumber * 2 - 1;
|
|
10
|
-
return (_jsxs(
|
|
11
|
+
return (_jsxs(Fragment, { children: [_jsxs(StepMarkerCell, { style: { gridRow: gridRowNumber }, children: [_jsx(StepMarker, { stepNumber: stepNumber, status: status }), stepNumber < maxSteps && (_jsx(StepLine, { style: {
|
|
11
12
|
...(status === StepStatus.COMPLETED && {
|
|
12
13
|
backgroundColor: elementColors.purple,
|
|
13
14
|
}),
|
|
@@ -24,7 +25,7 @@ const getStepRowElement = (stepNumber, status, step, maxSteps) => {
|
|
|
24
25
|
...(status === StepStatus.COMPLETED && {
|
|
25
26
|
backgroundColor: elementColors.purple,
|
|
26
27
|
}),
|
|
27
|
-
} }) }))] }));
|
|
28
|
+
} }) }))] }, stepNumber));
|
|
28
29
|
};
|
|
29
30
|
const getStepStatus = (stepNumber, activeStep) => {
|
|
30
31
|
if (stepNumber < activeStep) {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import type { IImageAttributes } from '@sphereon/ssi-sdk.data-store';
|
|
3
|
+
import { CredentialRole } from '@sphereon/ssi-types';
|
|
3
4
|
export interface Props {
|
|
4
5
|
name: string;
|
|
5
6
|
uri?: string;
|
|
@@ -14,7 +14,7 @@ const initializeDefaultValues = (schema, currentData = {}) => {
|
|
|
14
14
|
if (property.const && (!(key in result) || !result[key])) {
|
|
15
15
|
result[key] = property.const;
|
|
16
16
|
}
|
|
17
|
-
if (property.default &&
|
|
17
|
+
if (property.default !== undefined && !(key in result)) {
|
|
18
18
|
if (property.format?.startsWith('date') || property.format?.startsWith('time')) {
|
|
19
19
|
result[key] = formatDateToISO(property.default, property.format);
|
|
20
20
|
}
|
|
@@ -35,22 +35,18 @@ const initializeDefaultValues = (schema, currentData = {}) => {
|
|
|
35
35
|
const FormView = (props) => {
|
|
36
36
|
const { data, schema, uiSchema, validationMode = 'ValidateAndShow', renderers = jsonFormsMaterialRenderers, cells = materialCells, style, middleware, ajv, onFormStateChange, readonly = false, config, } = props;
|
|
37
37
|
const [formData, setFormData] = useState(data ?? {});
|
|
38
|
+
const [initialized, setInitialized] = useState(false);
|
|
38
39
|
useEffect(() => {
|
|
39
40
|
const initializedData = initializeDefaultValues(schema, formData);
|
|
40
41
|
setFormData(initializedData);
|
|
42
|
+
setInitialized(true);
|
|
41
43
|
}, [schema]);
|
|
42
44
|
const onFormStateChanged = (state) => {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
setFormData(updatedData);
|
|
46
|
-
void onFormStateChange?.({
|
|
47
|
-
...state,
|
|
48
|
-
data: updatedData,
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
else {
|
|
52
|
-
void onFormStateChange?.(state);
|
|
45
|
+
if (!initialized) {
|
|
46
|
+
return;
|
|
53
47
|
}
|
|
48
|
+
setFormData(state.data);
|
|
49
|
+
void onFormStateChange?.(state);
|
|
54
50
|
};
|
|
55
51
|
return (_jsx("div", { style: style, children: _jsx(JsonForms, { schema: schema, uischema: uiSchema, data: formData, renderers: renderers, cells: cells, onChange: onFormStateChanged, validationMode: validationMode, middleware: middleware, ajv: ajv, readonly: readonly, config: config }) }));
|
|
56
52
|
};
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
.MuiOutlinedInput-root.Mui-focused .MuiOutlinedInput-notchedOutline {
|
|
2
|
+
border-color: #7276F7 !important;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.MuiOutlinedInput-root:hover .MuiOutlinedInput-notchedOutline {
|
|
6
|
+
border-color: #7276F7 !important;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.MuiTypography-h6 {
|
|
10
|
+
font-size: 16px !important;
|
|
11
|
+
font-style: normal !important;
|
|
12
|
+
font-weight: 600 !important;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.MuiGrid-container {
|
|
16
|
+
padding: 0 !important;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.MuiFormControl-root {
|
|
20
|
+
padding: 0 !important;
|
|
21
|
+
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.MuiCardContent-root {
|
|
25
|
+
padding: 0 !important;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.MuiCardHeader-root {
|
|
29
|
+
padding: 0 !important;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.MuiPaper-root {
|
|
33
|
+
margin: 0 !important;
|
|
34
|
+
background-color: #FBFBFB !important;
|
|
35
|
+
box-shadow: none !important;
|
|
36
|
+
border-radius: 4px !important;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.MuiCardHeader-title {
|
|
40
|
+
font-family: Poppins, serif !important;
|
|
41
|
+
font-size: 16px !important;
|
|
42
|
+
font-style: normal !important;
|
|
43
|
+
font-weight: 400 !important;
|
|
44
|
+
margin-bottom: 10px !important;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.MuiGrid-root.MuiGrid-container.MuiGrid-direction-xs-column {
|
|
48
|
+
gap: 24px !important;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.MuiFormLabel-root.MuiInputLabel-root {
|
|
52
|
+
font-family: 'Poppins', sans-serif !important;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.MuiInputBase-root.MuiOutlinedInput-root .MuiInputBase-input {
|
|
56
|
+
font-family: 'Poppins', sans-serif !important;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.MuiInputBase-root.MuiOutlinedInput-root {
|
|
60
|
+
font-family: 'Poppins', sans-serif !important;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.MuiTypography-root {
|
|
64
|
+
font-family: 'Poppins', sans-serif !important;
|
|
65
|
+
color: #303030 !important;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.MuiDateCalendar-root {
|
|
69
|
+
background-color: #ECE6F0 !important;
|
|
70
|
+
border-radius: 16px !important;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.MuiPaper-root.MuiPaper-elevation.MuiPaper-rounded.MuiPaper-elevation8.MuiPickersPopper-paper {
|
|
74
|
+
border-radius: 16px !important;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.MuiButtonBase-root.MuiPickersDay-root.Mui-selected.MuiPickersDay-dayWithMargin {
|
|
78
|
+
background-color: #7276F7 !important;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.MuiButtonBase-root.MuiPickersDay-root.MuiPickersDay-dayWithMargin:hover {
|
|
82
|
+
background-color: #B7B8D9 !important;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.base-Popper-root {
|
|
86
|
+
border-radius: 4px !important;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.MuiFormGroup-root.MuiFormGroup-row {
|
|
90
|
+
display: grid !important;
|
|
91
|
+
grid-template-columns: repeat(2, 1fr) !important;
|
|
92
|
+
grid-gap: 10px !important;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.MuiGrid-root.MuiGrid-item.MuiGrid-grid-xs-true:empty {
|
|
96
|
+
display: none !important;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
textarea.MuiInputBase-input.MuiInputBase-inputMultiline {
|
|
100
|
+
min-height: 112px !important;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.MuiTabs-scroller.MuiTabs-fixed {
|
|
104
|
+
margin-bottom: 12px !important;
|
|
105
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -57,6 +57,7 @@ import RoleViewItem from './components/views/RoleViewItem';
|
|
|
57
57
|
import Listbox from './components/lists/Listbox';
|
|
58
58
|
import { Row } from '@tanstack/react-table';
|
|
59
59
|
import './styles/css/tailwind.css';
|
|
60
|
+
import './components/views/FormView/styles.css';
|
|
60
61
|
import '@sphereon/ui-components.core/dist/styles/tokens.css';
|
|
61
62
|
export * from './styles/fonts';
|
|
62
63
|
export * from './types';
|
package/dist/index.js
CHANGED
|
@@ -56,6 +56,7 @@ import RoleIconView from './components/views/RoleIconView';
|
|
|
56
56
|
import RoleViewItem from './components/views/RoleViewItem';
|
|
57
57
|
import Listbox from './components/lists/Listbox';
|
|
58
58
|
import './styles/css/tailwind.css';
|
|
59
|
+
import './components/views/FormView/styles.css';
|
|
59
60
|
import '@sphereon/ui-components.core/dist/styles/tokens.css';
|
|
60
61
|
export * from './styles/fonts';
|
|
61
62
|
export * from './types';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! tailwindcss v4.1.
|
|
1
|
+
/*! tailwindcss v4.1.12 | MIT License | https://tailwindcss.com */
|
|
2
2
|
@layer properties;
|
|
3
3
|
@layer theme, custom-base, custom-components, custom-utilities;
|
|
4
4
|
@layer theme {
|
|
@@ -145,6 +145,9 @@
|
|
|
145
145
|
::-webkit-datetime-edit, ::-webkit-datetime-edit-year-field, ::-webkit-datetime-edit-month-field, ::-webkit-datetime-edit-day-field, ::-webkit-datetime-edit-hour-field, ::-webkit-datetime-edit-minute-field, ::-webkit-datetime-edit-second-field, ::-webkit-datetime-edit-millisecond-field, ::-webkit-datetime-edit-meridiem-field {
|
|
146
146
|
padding-block: 0;
|
|
147
147
|
}
|
|
148
|
+
::-webkit-calendar-picker-indicator {
|
|
149
|
+
line-height: 1;
|
|
150
|
+
}
|
|
148
151
|
:-moz-ui-invalid {
|
|
149
152
|
box-shadow: none;
|
|
150
153
|
}
|
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.21+845e986",
|
|
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>",
|
|
@@ -13,10 +13,17 @@
|
|
|
13
13
|
"Self-sovereign identity (SSI)"
|
|
14
14
|
],
|
|
15
15
|
"scripts": {
|
|
16
|
-
"build": "
|
|
16
|
+
"build": "pnpm run copy-css && pnpm run generate-css && tsc",
|
|
17
|
+
"copy-css": "copy-files-from-to",
|
|
17
18
|
"generate-css": "tailwindcss -i ./src/styles/css/tailwind.css -o ./dist/styles/css/tailwind.css",
|
|
18
19
|
"build:clean": "tsc --build --clean && tsc --build"
|
|
19
20
|
},
|
|
21
|
+
"copyFiles": [
|
|
22
|
+
{
|
|
23
|
+
"from": "src/**/*.css",
|
|
24
|
+
"to": "dist"
|
|
25
|
+
}
|
|
26
|
+
],
|
|
20
27
|
"source": "src/index.ts",
|
|
21
28
|
"main": "dist/index.js",
|
|
22
29
|
"types": "dist/index.d.ts",
|
|
@@ -41,8 +48,9 @@
|
|
|
41
48
|
"@mui/styled-engine-sc": "^5.14.12",
|
|
42
49
|
"@mui/system": "^5.15.12",
|
|
43
50
|
"@mui/x-date-pickers": "^6.19.5",
|
|
44
|
-
"@sphereon/ssi-sdk.data-store": "
|
|
45
|
-
"@sphereon/
|
|
51
|
+
"@sphereon/ssi-sdk.data-store": "0.34.1-feature.SSISDK.45.94",
|
|
52
|
+
"@sphereon/ssi-types": "0.34.1-feature.SSISDK.45.94",
|
|
53
|
+
"@sphereon/ui-components.core": "0.4.1-unstable.21+845e986",
|
|
46
54
|
"@tanstack/react-table": "^8.9.3",
|
|
47
55
|
"react-json-tree": "^0.18.0",
|
|
48
56
|
"react-loader-spinner": "5.4.5",
|
|
@@ -55,12 +63,11 @@
|
|
|
55
63
|
"@tailwindcss/cli": "^4.1.11",
|
|
56
64
|
"@types/react": "~18.3.18",
|
|
57
65
|
"ajv": "^8.12.0",
|
|
58
|
-
"cpy-cli": "^5.0.0",
|
|
59
66
|
"tailwindcss": "^4.1.11",
|
|
60
67
|
"typescript": "4.9.5"
|
|
61
68
|
},
|
|
62
69
|
"peerDependencies": {
|
|
63
70
|
"react": ">= 18"
|
|
64
71
|
},
|
|
65
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "845e986345d4369717b586ae5d7ae4c0fa50ac51"
|
|
66
73
|
}
|