@sphereon/ui-components.ssi-react 0.1.3-unstable.14 → 0.1.3-unstable.145
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/@config/toasts/index.d.ts +7 -0
- package/dist/@config/toasts/index.js +13 -0
- package/dist/components/assets/badges/SSICheckmarkBadge/index.js +1 -1
- package/dist/components/assets/badges/SSIExclamationMarkBadge/index.js +1 -1
- package/dist/components/assets/icons/CrossIcon/index.d.ts +8 -0
- package/dist/components/assets/icons/CrossIcon/index.js +7 -0
- package/dist/components/assets/icons/DeleteIcon/index.d.ts +9 -0
- package/dist/components/assets/icons/DeleteIcon/index.js +7 -0
- package/dist/components/assets/icons/DocumentIcon/index.d.ts +9 -0
- package/dist/components/assets/icons/DocumentIcon/index.js +7 -0
- package/dist/components/assets/icons/ImageIcon/index.d.ts +9 -0
- package/dist/components/assets/icons/ImageIcon/index.js +7 -0
- package/dist/components/assets/icons/MeatBallsIcon/index.d.ts +9 -0
- package/dist/components/assets/icons/MeatBallsIcon/index.js +7 -0
- package/dist/components/assets/icons/SSIAddIcon/index.d.ts +3 -3
- package/dist/components/assets/icons/SSIAddIcon/index.js +2 -2
- package/dist/components/assets/icons/SSIArrowDownIcon/index.d.ts +3 -3
- package/dist/components/assets/icons/SSIArrowDownIcon/index.js +2 -2
- package/dist/components/assets/icons/SSIFilterIcon/index.d.ts +3 -3
- package/dist/components/assets/icons/SSIFilterIcon/index.js +2 -2
- package/dist/components/assets/icons/SSIProfileIcon/index.d.ts +1 -1
- package/dist/components/assets/icons/SSIProfileIcon/index.js +1 -2
- package/dist/components/assets/markers/StepMarker/index.d.ts +8 -0
- package/dist/components/assets/markers/StepMarker/index.js +26 -0
- package/dist/components/assets/placeholders/PersonPlaceholder/index.d.ts +9 -0
- package/dist/components/assets/placeholders/PersonPlaceholder/index.js +7 -0
- package/dist/components/buttons/SSIIconButton/index.d.ts +7 -6
- package/dist/components/buttons/SSIIconButton/index.js +15 -10
- package/dist/components/buttons/SSIPrimaryButton/index.d.ts +3 -3
- package/dist/components/buttons/SSIPrimaryButton/index.js +5 -6
- package/dist/components/buttons/SSISecondaryButton/index.d.ts +3 -3
- package/dist/components/buttons/SSISecondaryButton/index.js +6 -6
- package/dist/components/fields/ComboBox/index.d.ts +20 -0
- package/dist/components/fields/ComboBox/index.js +45 -0
- package/dist/components/fields/DragAndDropBox/index.d.ts +8 -0
- package/dist/components/fields/DragAndDropBox/index.js +30 -0
- package/dist/components/fields/FileSelection/index.d.ts +12 -0
- package/dist/components/fields/FileSelection/index.js +33 -0
- package/dist/components/fields/JSONForms/PassportPhotoControl/index.d.ts +5 -0
- package/dist/components/fields/JSONForms/PassportPhotoControl/index.js +37 -0
- package/dist/components/fields/SSICheckbox/index.d.ts +15 -0
- package/dist/components/fields/SSICheckbox/index.js +21 -0
- package/dist/components/fields/SSIHoverText/index.d.ts +8 -0
- package/dist/components/fields/SSIHoverText/index.js +8 -0
- package/dist/components/indicators/ProgressStepIndicator/index.d.ts +9 -0
- package/dist/components/indicators/ProgressStepIndicator/index.js +51 -0
- package/dist/components/indicators/SSIActivityIndicator/index.d.ts +10 -0
- package/dist/components/indicators/SSIActivityIndicator/index.js +8 -0
- package/dist/components/labels/SSIStatusLabel/index.d.ts +1 -1
- package/dist/components/labels/SSIStatusLabel/index.js +1 -1
- package/dist/components/labels/SSITypeLabel/index.d.ts +3 -3
- package/dist/components/labels/SSITypeLabel/index.js +5 -5
- package/dist/components/lists/DropDownList/index.d.ts +10 -0
- package/dist/components/lists/DropDownList/index.js +34 -0
- package/dist/components/lists/DropDownListItem/index.d.ts +13 -0
- package/dist/components/lists/DropDownListItem/index.js +23 -0
- package/dist/components/messageBoxes/toasts/SSIToast/index.d.ts +11 -0
- package/dist/components/messageBoxes/toasts/SSIToast/index.js +20 -0
- package/dist/components/messageBoxes/toasts/SSIToastContainer/index.d.ts +10 -0
- package/dist/components/messageBoxes/toasts/SSIToastContainer/index.js +7 -0
- package/dist/components/views/CredentialIssuanceWizardView/index.d.ts +10 -0
- package/dist/components/views/CredentialIssuanceWizardView/index.js +43 -0
- package/dist/components/views/CredentialIssuanceWizardView/styles.css +87 -0
- package/dist/components/views/{SSICredentialMiniCardView → CredentialMiniCardView}/index.d.ts +3 -3
- package/dist/components/views/{SSICredentialMiniCardView → CredentialMiniCardView}/index.js +4 -4
- package/dist/components/views/SSICredentialCardView/index.js +3 -3
- package/dist/components/views/SSITabView/SSITabViewHeader/index.d.ts +2 -2
- package/dist/components/views/SSITabView/SSITabViewHeader/index.js +1 -1
- package/dist/components/views/SSITabView/index.d.ts +2 -2
- package/dist/components/views/SSITabView/index.js +1 -1
- package/dist/components/views/SSITableView/PaginationControls/index.d.ts +8 -0
- package/dist/components/views/SSITableView/PaginationControls/index.js +9 -0
- package/dist/components/views/SSITableView/SSITableViewHeader/index.d.ts +2 -1
- package/dist/components/views/SSITableView/SSITableViewHeader/index.js +7 -7
- package/dist/components/views/SSITableView/index.d.ts +4 -1
- package/dist/components/views/SSITableView/index.js +79 -26
- package/dist/helpers/index.d.ts +1 -0
- package/dist/helpers/index.js +1 -0
- package/dist/helpers/toastHelper.d.ts +3 -0
- package/dist/helpers/toastHelper.js +14 -0
- package/dist/index.d.ts +25 -4
- package/dist/index.js +23 -4
- package/dist/renders/jsonFormsRenders.d.ts +2 -0
- package/dist/renders/jsonFormsRenders.js +6 -0
- package/dist/styles/colors.d.ts +3 -0
- package/dist/styles/colors.js +5 -0
- package/dist/styles/components/components/CredentialIssuanceWizardView/index.d.ts +9 -0
- package/dist/styles/components/components/CredentialIssuanceWizardView/index.js +55 -0
- package/dist/styles/components/components/DragAndDropBox/index.d.ts +4 -0
- package/dist/styles/components/components/DragAndDropBox/index.js +25 -0
- package/dist/styles/components/components/DropDownList/index.d.ts +3 -0
- package/dist/styles/components/components/DropDownList/index.js +21 -0
- package/dist/styles/components/components/DropDownListItem/index.d.ts +3 -0
- package/dist/styles/components/components/DropDownListItem/index.js +21 -0
- package/dist/styles/components/components/FileSelectionField/index.d.ts +10 -0
- package/dist/styles/components/components/FileSelectionField/index.js +64 -0
- package/dist/styles/components/components/Pagination/index.d.ts +5 -0
- package/dist/styles/components/components/Pagination/index.js +71 -0
- package/dist/styles/components/components/PassportPhotoControl/index.d.ts +4 -0
- package/dist/styles/components/components/PassportPhotoControl/index.js +27 -0
- package/dist/styles/components/components/ProgressStepIndicator/index.d.ts +8 -0
- package/dist/styles/components/components/ProgressStepIndicator/index.js +49 -0
- package/dist/styles/components/components/SSICheckbox/index.d.ts +4 -0
- package/dist/styles/components/components/SSICheckbox/index.js +25 -0
- package/dist/styles/components/components/SSICredentialCardView/index.d.ts +2 -2
- package/dist/styles/components/components/SSICredentialCardView/index.js +1 -1
- package/dist/styles/components/components/SSIHoverText/index.d.ts +3 -0
- package/dist/styles/components/components/{SSIText → SSIHoverText}/index.js +5 -5
- package/dist/styles/components/components/SSIIconButton/index.js +4 -2
- package/dist/styles/components/components/SSIPrimaryButton/index.js +1 -1
- package/dist/styles/components/components/SSISecondaryButton/index.d.ts +1 -1
- package/dist/styles/components/components/SSISecondaryButton/index.js +5 -10
- package/dist/styles/components/components/SSIStatusLabel/index.d.ts +1 -1
- package/dist/styles/components/components/SSIStatusLabel/index.js +2 -1
- package/dist/styles/components/components/SSITabView/index.js +1 -1
- package/dist/styles/components/components/SSITableView/index.d.ts +1 -0
- package/dist/styles/components/components/SSITableView/index.js +13 -1
- package/dist/styles/components/components/SSITableViewHeader/index.d.ts +1 -0
- package/dist/styles/components/components/SSITableViewHeader/index.js +8 -0
- package/dist/styles/components/components/SSIToast/index.d.ts +4 -0
- package/dist/styles/components/components/SSIToast/index.js +24 -0
- package/dist/styles/components/components/SSIToastContainer/index.d.ts +2 -0
- package/dist/styles/components/components/SSIToastContainer/index.js +314 -0
- package/dist/styles/components/components/StepMarker/index.d.ts +4 -0
- package/dist/styles/components/components/StepMarker/index.js +39 -0
- package/dist/styles/components/components/buttons/index.d.ts +1 -0
- package/dist/styles/components/components/buttons/index.js +4 -0
- package/dist/styles/components/components/index.d.ts +15 -1
- package/dist/styles/components/components/index.js +15 -1
- package/dist/styles/components/index.d.ts +0 -1
- package/dist/styles/components/index.js +0 -1
- package/dist/styles/css/index.d.ts +4 -0
- package/dist/styles/css/index.js +28 -0
- package/dist/styles/fonts/index.d.ts +20 -0
- package/dist/styles/fonts/index.js +64 -0
- package/dist/styles/index.d.ts +4 -0
- package/dist/styles/index.js +4 -0
- package/dist/styles/typography.js +12 -0
- package/dist/types/button/index.d.ts +8 -0
- package/dist/types/button/index.js +1 -0
- package/dist/types/field/index.d.ts +21 -0
- package/dist/types/field/index.js +10 -0
- package/dist/types/index.d.ts +6 -1
- package/dist/types/index.js +6 -1
- package/dist/types/indicator/index.d.ts +9 -0
- package/dist/types/indicator/index.js +6 -0
- package/dist/types/table/index.d.ts +31 -0
- package/dist/types/table/index.js +8 -0
- package/dist/types/toast/index.d.ts +6 -0
- package/dist/types/toast/index.js +1 -0
- package/dist/types/view/index.d.ts +13 -0
- package/dist/types/view/index.js +1 -0
- package/dist/utils/FileUtils.d.ts +1 -0
- package/dist/utils/FileUtils.js +7 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +1 -0
- package/package.json +23 -5
- package/dist/components/labels/SSIText/index.d.ts +0 -7
- package/dist/components/labels/SSIText/index.js +0 -13
- package/dist/components/lists/SSIDropDownList/index.d.ts +0 -7
- package/dist/components/lists/SSIDropDownList/index.js +0 -11
- package/dist/styles/components/components/SSIDropDownList/index.d.ts +0 -2
- package/dist/styles/components/components/SSIDropDownList/index.js +0 -15
- package/dist/styles/components/components/SSIText/index.d.ts +0 -3
- package/dist/styles/components/fonts/index.d.ts +0 -12
- package/dist/styles/components/fonts/index.js +0 -39
- package/dist/types/component/index.d.ts +0 -38
- package/dist/types/component/index.js +0 -16
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { and, isObjectControl, optionIs, rankWith, } from '@jsonforms/core';
|
|
4
|
+
import { withJsonFormsControlProps } from '@jsonforms/react';
|
|
5
|
+
import { Localization, parseBase64Uri } from '@sphereon/ui-components.core';
|
|
6
|
+
import DragAndDropBox from '../../DragAndDropBox';
|
|
7
|
+
import PersonPlaceholder from '../../../assets/placeholders/PersonPlaceholder';
|
|
8
|
+
import FileSelection from '../../FileSelection';
|
|
9
|
+
import { base64UriToFile } from '../../../../utils';
|
|
10
|
+
import { PassportPhotoControlContainerStyled as Container, PassportPhotoControlDragAndDropBoxContainerStyled as DragAndDropBoxContainer, PassportPhotoControlPassportPhotoContainerStyled as PassportPhotoContainer, PassportPhotoControlPassportPhotoImageStyled as PassportPhotoImage } from '../../../../styles';
|
|
11
|
+
import { FileSelectionFieldType } from '../../../../types';
|
|
12
|
+
const PassportPhotoControl = (props) => {
|
|
13
|
+
const { data, handleChange, path } = props;
|
|
14
|
+
const [image, setImage] = useState(data && { file: base64UriToFile(data.base64Uri, data.fileName, data.mimeType), base64Uri: data.base64Uri });
|
|
15
|
+
const onAddImage = async (file) => {
|
|
16
|
+
const reader = new FileReader();
|
|
17
|
+
reader.onload = () => {
|
|
18
|
+
const result = reader.result;
|
|
19
|
+
if (typeof result === 'string') {
|
|
20
|
+
const parsedBase64Uri = parseBase64Uri(result);
|
|
21
|
+
setImage({ file, base64Uri: result });
|
|
22
|
+
handleChange(path, { fileName: file.name, mimeType: parsedBase64Uri.mimeType, base64Uri: result });
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
reader.readAsDataURL(file);
|
|
26
|
+
};
|
|
27
|
+
const onRemoveImage = async () => {
|
|
28
|
+
setImage(undefined);
|
|
29
|
+
handleChange(path, undefined);
|
|
30
|
+
};
|
|
31
|
+
return (_jsxs(Container, { children: [_jsxs(DragAndDropBoxContainer, { children: [_jsx(DragAndDropBox, { caption: Localization.translate('drag_and_drop_upload_image_caption'), description: Localization.translate('credential_attach_image_description'), onChangeFile: onAddImage }), _jsx(PassportPhotoContainer, { children: image
|
|
32
|
+
? _jsx(PassportPhotoImage, { src: image.base64Uri, alt: Localization.translate('passport_photo_alt') })
|
|
33
|
+
: _jsx(PersonPlaceholder, {}) })] }), image &&
|
|
34
|
+
_jsx(FileSelection, { file: image.file, fileType: FileSelectionFieldType.IMAGE, onRemove: onRemoveImage })] }));
|
|
35
|
+
};
|
|
36
|
+
export const passportPhotoControlTester = rankWith(3, and(isObjectControl, optionIs('type', 'passportPhoto')));
|
|
37
|
+
export default withJsonFormsControlProps(PassportPhotoControl);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
export interface IProps {
|
|
3
|
+
onValueChange?: (isChecked: boolean) => Promise<void>;
|
|
4
|
+
initialValue?: boolean;
|
|
5
|
+
isChecked?: boolean;
|
|
6
|
+
label?: string | ReactNode;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
backgroundColor?: string;
|
|
9
|
+
borderColor?: string;
|
|
10
|
+
selectedColor?: string;
|
|
11
|
+
labelColor?: string;
|
|
12
|
+
checkmarkColor?: string;
|
|
13
|
+
}
|
|
14
|
+
declare const SSICheckbox: FC<IProps>;
|
|
15
|
+
export default SSICheckbox;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { OpacityStyleEnum, fontColors, selectionElementColors } from '@sphereon/ui-components.core';
|
|
4
|
+
import { SSICheckboxContainerStyled as Container, SSICheckboxLabelContainerStyled as LabelCaption, SSICheckboxSelectedContainerStyled as SelectedContainer, SSICheckboxUnselectedContainerStyled as UnselectedContainer, } from '../../../styles/components';
|
|
5
|
+
const SSICheckbox = (props) => {
|
|
6
|
+
const { backgroundColor, borderColor = selectionElementColors.primaryBorderDark, disabled = false, initialValue = false, label, selectedColor = selectionElementColors.primaryDark, labelColor = fontColors.light, checkmarkColor = fontColors.dark, } = props;
|
|
7
|
+
const [isChecked, setChecked] = React.useState(initialValue);
|
|
8
|
+
const value = props.isChecked !== undefined ? props.isChecked : isChecked;
|
|
9
|
+
const onValueChange = async () => {
|
|
10
|
+
const { onValueChange } = props;
|
|
11
|
+
if (disabled) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
if (onValueChange) {
|
|
15
|
+
await onValueChange(!isChecked);
|
|
16
|
+
}
|
|
17
|
+
setChecked(!isChecked);
|
|
18
|
+
};
|
|
19
|
+
return (_jsxs(Container, { onClick: onValueChange, style: { ...(disabled && { opacity: OpacityStyleEnum.DISABLED }) }, children: [value ? (_jsx(SelectedContainer, { style: { backgroundColor: selectedColor, border: `1px solid ${borderColor}` } })) : (_jsx(UnselectedContainer, { style: { backgroundColor, border: `1px solid ${borderColor}` } })), label && (typeof label === 'string' ? _jsx(LabelCaption, { style: { color: labelColor }, children: label }) : label)] }));
|
|
20
|
+
};
|
|
21
|
+
export default SSICheckbox;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { SSIHoverTextTextStyled as Text, SSIHoverTextContainerStyled as Container, SSIHoverTextTextHoverStyled as TextHover, } from '../../../styles/components';
|
|
3
|
+
const SSIHoverText = (props) => {
|
|
4
|
+
const { text, truncationLength, enableHover = true } = props;
|
|
5
|
+
const value = truncationLength ? text.substring(0, truncationLength) : text;
|
|
6
|
+
return (_jsxs(Container, { children: [_jsx(Text, { children: value }), enableHover && _jsx(TextHover, { children: text })] }));
|
|
7
|
+
};
|
|
8
|
+
export default SSIHoverText;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CSSProperties, FC } from 'react';
|
|
2
|
+
import { ProgressIndicatorStep } from '../../../types';
|
|
3
|
+
type Props = {
|
|
4
|
+
steps: Array<ProgressIndicatorStep>;
|
|
5
|
+
activeStep: number;
|
|
6
|
+
style?: CSSProperties;
|
|
7
|
+
};
|
|
8
|
+
declare const ProgressStepIndicator: FC<Props>;
|
|
9
|
+
export default ProgressStepIndicator;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { elementColors, fontColors } from '@sphereon/ui-components.core';
|
|
3
|
+
import StepMarker from '../../assets/markers/StepMarker';
|
|
4
|
+
import { gradientColors } from '../../../styles/colors';
|
|
5
|
+
import { ProgressStepIndicatorContainerStyled as Container, ProgressStepIndicatorContentGridContainerStyled as GridContainer, ProgressStepIndicatorStepMarkerCellStyled as StepMarkerCell, ProgressStepIndicatorStepLineStyled as StepLine, ProgressStepIndicatorStepTextCellStyled as StepTextCell, ProgressStepIndicatorTitleTextStyled as TitleText, ProgressStepIndicatorDescriptionTextStyled as DescriptionText, ProgressStepIndicatorSpacerLineCellStyled as SpacerLineCell, } from '../../../styles';
|
|
6
|
+
import { StepStatus } from '../../../types';
|
|
7
|
+
const getStepRowElement = (stepNumber, status, step, maxSteps) => {
|
|
8
|
+
const gridRowNumber = stepNumber * 2 - 1;
|
|
9
|
+
return (_jsxs(_Fragment, { children: [_jsxs(StepMarkerCell, { style: { gridRow: gridRowNumber }, children: [_jsx(StepMarker, { stepNumber: stepNumber, status: status }), stepNumber < maxSteps && (_jsx(StepLine, { style: {
|
|
10
|
+
...(status === StepStatus.COMPLETED && {
|
|
11
|
+
backgroundColor: elementColors.purple,
|
|
12
|
+
}),
|
|
13
|
+
} }))] }), _jsxs(StepTextCell, { style: { gridRow: gridRowNumber }, children: [step.title && (_jsx(TitleText, { style: {
|
|
14
|
+
...(status === StepStatus.CURRENT && {
|
|
15
|
+
background: gradientColors['100'],
|
|
16
|
+
backgroundClip: 'text',
|
|
17
|
+
WebkitBackgroundClip: 'text',
|
|
18
|
+
WebkitTextFillColor: 'transparent',
|
|
19
|
+
}),
|
|
20
|
+
...(status === StepStatus.COMPLETED && { color: fontColors.dark }),
|
|
21
|
+
...(status === StepStatus.NEXT && { color: fontColors.lightGrey }),
|
|
22
|
+
}, children: step.title })), step.description && (_jsx(DescriptionText, { style: { ...((status === StepStatus.CURRENT || status === StepStatus.COMPLETED) && { color: fontColors.dark }) }, children: step.description }))] }), stepNumber < maxSteps && (_jsx(SpacerLineCell, { style: { gridRow: gridRowNumber + 1 }, children: _jsx(StepLine, { style: {
|
|
23
|
+
...(status === StepStatus.COMPLETED && {
|
|
24
|
+
backgroundColor: elementColors.purple,
|
|
25
|
+
}),
|
|
26
|
+
} }) }))] }));
|
|
27
|
+
};
|
|
28
|
+
const getStepStatus = (stepNumber, activeStep) => {
|
|
29
|
+
if (stepNumber < activeStep) {
|
|
30
|
+
return StepStatus.COMPLETED;
|
|
31
|
+
}
|
|
32
|
+
else if (stepNumber > activeStep) {
|
|
33
|
+
return StepStatus.NEXT;
|
|
34
|
+
}
|
|
35
|
+
else if (stepNumber === activeStep) {
|
|
36
|
+
return StepStatus.CURRENT;
|
|
37
|
+
}
|
|
38
|
+
throw new Error('Unable to determine step status');
|
|
39
|
+
};
|
|
40
|
+
const getStepElements = (activeStep, steps) => {
|
|
41
|
+
return steps.map((step, index) => {
|
|
42
|
+
const stepNumber = index + 1;
|
|
43
|
+
const stepStatus = getStepStatus(stepNumber, activeStep);
|
|
44
|
+
return getStepRowElement(stepNumber, stepStatus, step, steps.length);
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
const ProgressStepIndicator = (props) => {
|
|
48
|
+
const { activeStep, steps = [], style } = props;
|
|
49
|
+
return (_jsx(Container, { style: style, children: _jsx(GridContainer, { children: getStepElements(activeStep, steps) }) }));
|
|
50
|
+
};
|
|
51
|
+
export default ProgressStepIndicator;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Oval } from 'react-loader-spinner';
|
|
3
|
+
import { elementColors } from '@sphereon/ui-components.core';
|
|
4
|
+
const SSIActivityIndicator = (props) => {
|
|
5
|
+
const { size = 80, color = elementColors.blue, style } = props;
|
|
6
|
+
return (_jsx(Oval, { width: size, height: size, color: color, secondaryColor: color, strokeWidth: 5, strokeWidthSecondary: 5, visible: true, wrapperStyle: style }));
|
|
7
|
+
};
|
|
8
|
+
export default SSIActivityIndicator;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { CredentialStatus, IssuerStatus, statusColors, getStatusTranslation } from '@sphereon/ui-components.core';
|
|
3
|
-
import { SSIStatusLabelBadgeContainer as BadgeContainer, SSIStatusLabelContainerStyled as Container, SSIStatusLabelStatusCaptionStyled as StatusCaption, } from '../../../styles/components';
|
|
4
3
|
import SSICheckmarkBadge from '../../../components/assets/badges/SSICheckmarkBadge';
|
|
5
4
|
import SSIExclamationMarkBadge from '../../../components/assets/badges/SSIExclamationMarkBadge';
|
|
5
|
+
import { SSIStatusLabelBadgeContainer as BadgeContainer, SSIStatusLabelContainerStyled as Container, SSIStatusLabelStatusCaptionStyled as StatusCaption, } from '../../../styles';
|
|
6
6
|
const SSIStatusLabel = (props) => {
|
|
7
7
|
const { status, color = statusColors[status], style, showIcon = false } = props;
|
|
8
8
|
return (_jsxs(Container, { style: { ...style, borderColor: color }, children: [showIcon && _jsx(BadgeContainer, { children: getStatusBadge(status, color) }), _jsx(StatusCaption, { style: { color }, children: getStatusTranslation(status) })] }));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
type:
|
|
2
|
+
import { LabelType } from '@sphereon/ui-components.core';
|
|
3
|
+
type Props = {
|
|
4
|
+
type: LabelType;
|
|
5
5
|
};
|
|
6
6
|
declare const SSITypeLabel: FC<Props>;
|
|
7
7
|
export default SSITypeLabel;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import { SSITypeLabelContainerStyled as Container } from '../../../styles
|
|
4
|
-
import {
|
|
2
|
+
import { backgroundColors, LabelType } from '@sphereon/ui-components.core';
|
|
3
|
+
import { SSITypeLabelContainerStyled as Container } from '../../../styles';
|
|
4
|
+
import { gradientColors } from '../../../styles/colors';
|
|
5
5
|
const getBackground = (type) => {
|
|
6
6
|
switch (type) {
|
|
7
|
-
case
|
|
7
|
+
case LabelType.ISSUER:
|
|
8
8
|
return gradientColors['200'];
|
|
9
|
-
case
|
|
9
|
+
case LabelType.VERIFIER:
|
|
10
10
|
return gradientColors['100'];
|
|
11
11
|
default:
|
|
12
12
|
return backgroundColors.primaryLight;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { ButtonIcon } from '@sphereon/ui-components.core';
|
|
3
|
+
import { Button } from '../../../types';
|
|
4
|
+
export type Props = {
|
|
5
|
+
icon: ButtonIcon;
|
|
6
|
+
buttons: Array<Button>;
|
|
7
|
+
showBorder?: boolean;
|
|
8
|
+
};
|
|
9
|
+
declare const DropDownList: FC<Props>;
|
|
10
|
+
export default DropDownList;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useRef, useEffect } from 'react';
|
|
3
|
+
import { borderColors } from '@sphereon/ui-components.core';
|
|
4
|
+
import DropDownListItem from '../DropDownListItem';
|
|
5
|
+
import SSIIconButton from '../../buttons/SSIIconButton';
|
|
6
|
+
import { DropDownListContainerStyled as Container, DropDownContainerStyled as DropDownContainer, DropDownListButtonStyled as ListButton, } from '../../../styles/components';
|
|
7
|
+
const DropDownList = (props) => {
|
|
8
|
+
const { icon, buttons, showBorder = false } = props;
|
|
9
|
+
const [showActionsMenu, setShowActionsMenu] = useState(false);
|
|
10
|
+
const dropdownRef = useRef(null);
|
|
11
|
+
const onMore = (event) => {
|
|
12
|
+
setShowActionsMenu(!showActionsMenu);
|
|
13
|
+
event.stopPropagation();
|
|
14
|
+
};
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
const onClickOutside = (event) => {
|
|
17
|
+
if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
|
|
18
|
+
setShowActionsMenu(false);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
document.addEventListener('mousedown', onClickOutside);
|
|
22
|
+
return () => {
|
|
23
|
+
document.removeEventListener('mousedown', onClickOutside);
|
|
24
|
+
};
|
|
25
|
+
}, [showActionsMenu]);
|
|
26
|
+
const getItems = () => {
|
|
27
|
+
return buttons.map((item, index) => {
|
|
28
|
+
const showBorder = buttons.length > 1 && index !== buttons.length - 1;
|
|
29
|
+
return (_jsx(DropDownListItem, { showBorder: showBorder, label: item.caption, onClick: item.onClick, icon: item.icon, fontColor: item.fontColor }, index));
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
return (_jsxs(Container, { ref: dropdownRef, children: [_jsx(ListButton, { children: _jsx(SSIIconButton, { icon: icon, onClick: onMore }) }), showActionsMenu && (_jsx(DropDownContainer, { style: { ...(showBorder && { borderWidth: 2, borderColor: borderColors.lightGrey, borderStyle: 'solid' }) }, children: getItems() }))] }));
|
|
33
|
+
};
|
|
34
|
+
export default DropDownList;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { ButtonIcon } from '@sphereon/ui-components.core';
|
|
3
|
+
type Props = {
|
|
4
|
+
label: string;
|
|
5
|
+
onClick: (args?: any) => Promise<void>;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
icon?: ButtonIcon;
|
|
8
|
+
fontColor?: string;
|
|
9
|
+
showBorder?: boolean;
|
|
10
|
+
borderColor?: string;
|
|
11
|
+
};
|
|
12
|
+
declare const DropDownListItem: FC<Props>;
|
|
13
|
+
export default DropDownListItem;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { DropDownListItemContainerStyled as Container, DropDownListItemIconContainerStyled as IconContainer, DropDownListItemCaptionContainerStyled as ListItemCaption, } from '../../../styles/components';
|
|
3
|
+
import DeleteIcon from '../../assets/icons/DeleteIcon';
|
|
4
|
+
import { borderColors, ButtonIcon, fontColors } from '@sphereon/ui-components.core';
|
|
5
|
+
const DropDownListItem = (props) => {
|
|
6
|
+
const { disabled, label, icon, showBorder = false, fontColor = fontColors.dark, borderColor = borderColors.light, onClick } = props;
|
|
7
|
+
const getIcon = (icon) => {
|
|
8
|
+
switch (icon) {
|
|
9
|
+
case ButtonIcon.DELETE:
|
|
10
|
+
return _jsx(DeleteIcon, { color: fontColors.dark });
|
|
11
|
+
default:
|
|
12
|
+
return _jsx("div", {});
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
const onContainerClick = async (event) => {
|
|
16
|
+
event.stopPropagation();
|
|
17
|
+
if (onClick) {
|
|
18
|
+
await onClick();
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
return (_jsxs(Container, { onClick: onContainerClick, style: { ...(showBorder && { borderBottomWidth: 2, borderBottomColor: borderColor }) }, children: [_jsx(ListItemCaption, { children: label }), icon && _jsx(IconContainer, { children: getIcon(icon) })] }));
|
|
22
|
+
};
|
|
23
|
+
export default DropDownListItem;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { ToastType } from '@sphereon/ui-components.core';
|
|
3
|
+
type Props = {
|
|
4
|
+
type: ToastType;
|
|
5
|
+
title?: string;
|
|
6
|
+
message?: string;
|
|
7
|
+
showBadge?: boolean;
|
|
8
|
+
onClick?: () => Promise<void>;
|
|
9
|
+
};
|
|
10
|
+
declare const SSIToast: FC<Props>;
|
|
11
|
+
export default SSIToast;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ToastType } from '@sphereon/ui-components.core';
|
|
3
|
+
import SSICheckmarkBadge from '../../../assets/badges/SSICheckmarkBadge';
|
|
4
|
+
import SSIExclamationMarkBadge from '../../../assets/badges/SSIExclamationMarkBadge';
|
|
5
|
+
import { SSIToastContainerStyled as Container, SSIToastMessageTextStyled as MessageText, SSIFlexDirectionRowViewStyled as MessageContainer, SSITextH2SemiBoldStyled as TitleText, SSIToastTitleContainerStyled as TitleContainer, SSIToastBadgeContainerStyled as ToastBadgeContainer, } from '../../../../styles';
|
|
6
|
+
const getBadge = (type) => {
|
|
7
|
+
switch (type) {
|
|
8
|
+
case ToastType.SUCCESS:
|
|
9
|
+
return _jsx(SSICheckmarkBadge, {});
|
|
10
|
+
case ToastType.ERROR:
|
|
11
|
+
return _jsx(SSIExclamationMarkBadge, {});
|
|
12
|
+
default:
|
|
13
|
+
return _jsx("div", {});
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
const SSIToast = (props) => {
|
|
17
|
+
const { type, title, message, showBadge = true, onClick } = props;
|
|
18
|
+
return (_jsxs(Container, { onClick: onClick, children: [title && (_jsxs(TitleContainer, { children: [showBadge && _jsx(ToastBadgeContainer, { children: getBadge(type) }), _jsx(TitleText, { children: title })] })), _jsxs(MessageContainer, { children: [!title && showBadge && _jsx(ToastBadgeContainer, { children: getBadge(type) }), message && _jsx(MessageText, { style: { ...(showBadge && { textAlign: 'center' }) }, children: message })] })] }));
|
|
19
|
+
};
|
|
20
|
+
export default SSIToast;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { ToastPosition } from 'react-toastify';
|
|
3
|
+
type Props = {
|
|
4
|
+
autoHide?: boolean;
|
|
5
|
+
visibilityTimeMs?: number;
|
|
6
|
+
position?: ToastPosition;
|
|
7
|
+
pauseOnHover?: boolean;
|
|
8
|
+
};
|
|
9
|
+
declare const SSIToastContainer: FC<Props>;
|
|
10
|
+
export default SSIToastContainer;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { SSIToastContainerContainerStyled as Container } from '../../../../styles';
|
|
3
|
+
const SSIToastContainer = (props) => {
|
|
4
|
+
const { position = 'top-right', autoHide = true, visibilityTimeMs = 6000, pauseOnHover = true } = props;
|
|
5
|
+
return (_jsx(Container, { position: position, autoClose: !autoHide ? autoHide : visibilityTimeMs, hideProgressBar: true, closeButton: false, pauseOnHover: pauseOnHover }));
|
|
6
|
+
};
|
|
7
|
+
export default SSIToastContainer;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { CredentialFormData, CredentialFormSelectionType } from '../../../types';
|
|
3
|
+
type Props = {
|
|
4
|
+
credentialTypes: Array<CredentialFormSelectionType>;
|
|
5
|
+
onSelectCredentialTypeChange?: (credentialType: CredentialFormSelectionType) => Promise<void>;
|
|
6
|
+
onCredentialFormDataChange?: (credentialFormData: CredentialFormData) => Promise<void>;
|
|
7
|
+
credentialData?: Record<any, any>;
|
|
8
|
+
};
|
|
9
|
+
declare const CredentialIssuanceWizardView: FC<Props>;
|
|
10
|
+
export default CredentialIssuanceWizardView;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { Autocomplete, TextField } from '@mui/material';
|
|
4
|
+
import { materialCells } from '@jsonforms/material-renderers';
|
|
5
|
+
import { JsonForms } from '@jsonforms/react';
|
|
6
|
+
import { Localization } from '@sphereon/ui-components.core';
|
|
7
|
+
import FileSelection from '../../fields/FileSelection';
|
|
8
|
+
import DragAndDropBox from '../../fields/DragAndDropBox';
|
|
9
|
+
import { jsonFormsMaterialRenderers } from '../../../renders/jsonFormsRenders';
|
|
10
|
+
import { CredentialIssuanceWizardViewContainerStyled as Container, CredentialIssuanceWizardViewCredentialTypeContainerStyled as CredentialTypeContainer, CredentialIssuanceWizardViewCredentialTypeTitleStyled as CredentialTypeTitle, CredentialIssuanceWizardViewFormContainerStyled as FormContainer, CredentialIssuanceWizardViewEvidenceContainerStyled as EvidenceContainer, CredentialIssuanceWizardViewEvidenceContentContainerStyled as EvidenceContentContainer, CredentialIssuanceWizardViewEvidenceTitleContainerStyled as EvidenceTitleContainer, SSITextH2SemiBoldDarkStyled as EvidenceTitle, CredentialIssuanceWizardViewEvidenceTitleOptionalStyled as EvidenceTitleOptional, SSITextH2DarkStyled as EvidenceDescription, CredentialIssuanceWizardViewEvidenceFilesContainerStyled as EvidenceFilesContainer } from '../../../styles';
|
|
11
|
+
const CredentialIssuanceWizardView = (props) => {
|
|
12
|
+
const { credentialData, credentialTypes, onSelectCredentialTypeChange, onCredentialFormDataChange } = props;
|
|
13
|
+
const [selectedCredentialType, setSelectedCredentialType] = useState(null);
|
|
14
|
+
const [credentialInput, setCredentialInput] = useState(null);
|
|
15
|
+
const [evidence, setEvidence] = useState([]);
|
|
16
|
+
const onCredentialTypeChange = (event, value) => {
|
|
17
|
+
setCredentialInput(null);
|
|
18
|
+
setEvidence([]);
|
|
19
|
+
setSelectedCredentialType(value);
|
|
20
|
+
onSelectCredentialTypeChange?.(value);
|
|
21
|
+
};
|
|
22
|
+
const onCredentialFormInputChange = (state) => {
|
|
23
|
+
setCredentialInput(state);
|
|
24
|
+
onCredentialFormDataChange?.({ ...state, evidence });
|
|
25
|
+
};
|
|
26
|
+
const onAddEvidence = async (file) => {
|
|
27
|
+
const evidenceFiles = [...evidence, file];
|
|
28
|
+
setEvidence(evidenceFiles);
|
|
29
|
+
onCredentialFormDataChange?.({ ...credentialInput, evidence: evidenceFiles });
|
|
30
|
+
};
|
|
31
|
+
const onRemoveEvidence = async (index) => {
|
|
32
|
+
evidence.splice(index, 1);
|
|
33
|
+
const evidenceFiles = [...evidence];
|
|
34
|
+
setEvidence(evidenceFiles);
|
|
35
|
+
onCredentialFormDataChange?.({ ...credentialInput, evidence: evidenceFiles });
|
|
36
|
+
};
|
|
37
|
+
const getEvidenceElements = () => {
|
|
38
|
+
return evidence.map((file, index) => _jsx(FileSelection, { file: file, onRemove: async () => onRemoveEvidence(index) }, index));
|
|
39
|
+
};
|
|
40
|
+
return (_jsxs(Container, { children: [_jsxs(CredentialTypeContainer, { children: [_jsx(CredentialTypeTitle, { children: Localization.translate('credential_issuance_wizard_title') }), _jsx(Autocomplete, { options: credentialTypes, sx: { flexGrow: 1 }, renderInput: (params) => _jsx(TextField, { ...params, label: Localization.translate('credential_issuance_wizard_credential_type_label') }), onChange: onCredentialTypeChange })] }), selectedCredentialType &&
|
|
41
|
+
_jsxs(_Fragment, { children: [_jsx(FormContainer, { children: _jsx(JsonForms, { schema: selectedCredentialType.schema, uischema: selectedCredentialType.uiSchema, data: credentialData, renderers: jsonFormsMaterialRenderers, cells: materialCells, onChange: onCredentialFormInputChange }) }), _jsx(EvidenceContainer, { children: _jsxs(EvidenceContentContainer, { children: [_jsxs("div", { children: [_jsxs(EvidenceTitleContainer, { children: [_jsx(EvidenceTitle, { children: Localization.translate('credential_issuance_wizard_evidence_title') }), _jsx(EvidenceTitleOptional, { children: Localization.translate('credential_issuance_wizard_evidence_optional_title') })] }), _jsx(EvidenceDescription, { children: Localization.translate('credential_issuance_wizard_evidence_description') })] }), _jsxs(EvidenceFilesContainer, { children: [_jsx(DragAndDropBox, { caption: Localization.translate('drag_and_drop_upload_evidence_caption'), description: Localization.translate('credential_attach_evidence_description'), onChangeFile: onAddEvidence }), getEvidenceElements()] })] }) })] })] }));
|
|
42
|
+
};
|
|
43
|
+
export default CredentialIssuanceWizardView;
|
|
@@ -0,0 +1,87 @@
|
|
|
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
|
+
.MuiInputLabel-root.MuiFormLabel-root {
|
|
10
|
+
color: #303030 !important;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.MuiTypography-h6 {
|
|
14
|
+
color: #303030 !important;
|
|
15
|
+
font-size: 16px !important;
|
|
16
|
+
font-style: normal !important;
|
|
17
|
+
font-weight: 600 !important;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.MuiGrid-container {
|
|
21
|
+
padding: 0 !important;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.MuiFormControl-root {
|
|
25
|
+
padding: 0 !important;
|
|
26
|
+
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.MuiCardContent-root {
|
|
30
|
+
padding: 0 !important;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.MuiCardHeader-root {
|
|
34
|
+
padding: 0 !important;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.MuiPaper-root {
|
|
38
|
+
margin: 0 !important;
|
|
39
|
+
background-color: #FBFBFB !important;
|
|
40
|
+
box-shadow: none !important;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.MuiCardHeader-title {
|
|
44
|
+
font-family: Poppins, serif !important;
|
|
45
|
+
font-size: 16px !important;
|
|
46
|
+
font-style: normal !important;
|
|
47
|
+
font-weight: 400 !important;
|
|
48
|
+
margin-bottom: 10px !important;
|
|
49
|
+
color: #303030 !important;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.MuiGrid-root.MuiGrid-container.MuiGrid-direction-xs-column {
|
|
53
|
+
gap: 24px !important;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.MuiFormLabel-root.MuiInputLabel-root {
|
|
57
|
+
font-family: 'Poppins', sans-serif !important;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.MuiInputBase-root.MuiOutlinedInput-root .MuiInputBase-input {
|
|
61
|
+
font-family: 'Poppins', sans-serif !important;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.MuiInputBase-root.MuiOutlinedInput-root {
|
|
65
|
+
font-family: 'Poppins', sans-serif !important;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.MuiTypography-root {
|
|
69
|
+
font-family: 'Poppins', sans-serif !important;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.MuiDateCalendar-root {
|
|
73
|
+
background-color: #ECE6F0 !important;
|
|
74
|
+
border-radius: 16px !important;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.MuiPaper-root.MuiPaper-elevation.MuiPaper-rounded.MuiPaper-elevation8.MuiPickersPopper-paper {
|
|
78
|
+
border-radius: 16px !important;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.MuiButtonBase-root.MuiPickersDay-root.Mui-selected.MuiPickersDay-dayWithMargin {
|
|
82
|
+
background-color: #7276F7 !important;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.MuiButtonBase-root.MuiPickersDay-root.MuiPickersDay-dayWithMargin:hover {
|
|
86
|
+
background-color: #B7B8D9 !important;
|
|
87
|
+
}
|
package/dist/components/views/{SSICredentialMiniCardView → CredentialMiniCardView}/index.d.ts
RENAMED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { CSSProperties, FC } from 'react';
|
|
2
2
|
import { ImageAttributes } from '@sphereon/ui-components.core';
|
|
3
|
-
type
|
|
3
|
+
export type CredentialMiniCardViewProps = {
|
|
4
4
|
backgroundImage?: ImageAttributes;
|
|
5
5
|
backgroundColor?: string;
|
|
6
6
|
logo?: ImageAttributes;
|
|
7
7
|
logoColor?: string;
|
|
8
8
|
style?: CSSProperties;
|
|
9
9
|
};
|
|
10
|
-
declare const
|
|
11
|
-
export default
|
|
10
|
+
declare const CredentialMiniCardView: FC<CredentialMiniCardViewProps>;
|
|
11
|
+
export default CredentialMiniCardView;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { credentialCardColors } from '@sphereon/ui-components.core';
|
|
3
3
|
import SSILogo from '../../assets/logos/SSILogo';
|
|
4
|
-
import { SSICredentialMiniCardViewContainerStyled as Container, SSICredentialMiniCardViewBackgroundImageStyled as BackgroundImage, } from '../../../styles
|
|
5
|
-
const
|
|
4
|
+
import { SSICredentialMiniCardViewContainerStyled as Container, SSICredentialMiniCardViewBackgroundImageStyled as BackgroundImage, } from '../../../styles';
|
|
5
|
+
const CredentialMiniCardView = (props) => {
|
|
6
6
|
const { backgroundColor = credentialCardColors.default, backgroundImage, logo, logoColor, style } = props;
|
|
7
7
|
return (_jsx(Container, { style: { ...style, backgroundColor }, children: _jsx(BackgroundImage, { style: {
|
|
8
8
|
...(backgroundImage?.uri && { background: `url(${backgroundImage.uri})`, backgroundSize: 'cover' }),
|
|
9
|
-
}, children: _jsx(SSILogo, { logo: logo, color: logoColor }) }) }));
|
|
9
|
+
}, children: (!backgroundImage || logo) && _jsx(SSILogo, { logo: logo, color: logoColor }) }) }));
|
|
10
10
|
};
|
|
11
|
-
export default
|
|
11
|
+
export default CredentialMiniCardView;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { backgroundColors, credentialCardColors, Localization, toLocalDateString } from '@sphereon/ui-components.core';
|
|
2
|
+
import { backgroundColors, credentialCardColors, Localization, toLocalDateString, } from '@sphereon/ui-components.core';
|
|
3
3
|
import SSILogo from '../../assets/logos/SSILogo';
|
|
4
4
|
import SSIStatusLabel from '../../labels/SSIStatusLabel';
|
|
5
|
-
import { SSIAlphaContainerStyled as AlphaContainer, SSICredentialCardViewContainerStyled as Container, SSICredentialCardViewBackgroundImageStyled as BackgroundImage, SSICredentialCardViewContentMainContainerStyled as ContentMainContainer, SSICredentialCardViewContentSubContainerStyled as ContentSubContainer, SSICredentialCardViewStatusContainerStyled as StatusContainer, SSICredentialCardViewCredentialSubtitleTextStyled as CredentialSubtitleText, SSICredentialCardViewCredentialTitleTextStyled as CredentialTitleText, SSITextH5LightStyled as ExpirationDateText, SSICredentialCardViewFooterContainerStyled as FooterContainer, SSITextH4LightStyled as H4Text, SSICredentialCardViewHeaderContainerStyled as HeaderContainer, SSICredentialCardViewContentIssueNameContainerStyled as IssueNameContainer, SSICredentialCardViewHeaderLogoContainerStyled as LogoContainer, SSICredentialCardViewContentPropertiesContainerStyled as PropertiesContainer, SSITextH6LightStyled as PropertyValueText, SSICredentialCardViewHeaderTitleContainerStyled as TitleContainer, SSIFlexDirectionColumnViewStyled as PropertyContainer, } from '../../../styles
|
|
5
|
+
import { SSIAlphaContainerStyled as AlphaContainer, SSICredentialCardViewContainerStyled as Container, SSICredentialCardViewBackgroundImageStyled as BackgroundImage, SSICredentialCardViewContentMainContainerStyled as ContentMainContainer, SSICredentialCardViewContentSubContainerStyled as ContentSubContainer, SSICredentialCardViewStatusContainerStyled as StatusContainer, SSICredentialCardViewCredentialSubtitleTextStyled as CredentialSubtitleText, SSICredentialCardViewCredentialTitleTextStyled as CredentialTitleText, SSITextH5LightStyled as ExpirationDateText, SSICredentialCardViewFooterContainerStyled as FooterContainer, SSITextH4LightStyled as H4Text, SSICredentialCardViewHeaderContainerStyled as HeaderContainer, SSICredentialCardViewContentIssueNameContainerStyled as IssueNameContainer, SSICredentialCardViewHeaderLogoContainerStyled as LogoContainer, SSICredentialCardViewContentPropertiesContainerStyled as PropertiesContainer, SSITextH6LightStyled as PropertyValueText, SSICredentialCardViewHeaderTitleContainerStyled as TitleContainer, SSIFlexDirectionColumnViewStyled as PropertyContainer, } from '../../../styles';
|
|
6
6
|
const SSICredentialCardView = (props) => {
|
|
7
7
|
const { header, body, footer } = props;
|
|
8
8
|
const { credentialTitle, credentialSubtitle, logo } = props.header ?? {};
|
|
@@ -17,7 +17,7 @@ const SSICredentialCardView = (props) => {
|
|
|
17
17
|
};
|
|
18
18
|
return (_jsx(Container, { style: { backgroundColor }, children: _jsx(BackgroundImage, { style: {
|
|
19
19
|
...(backgroundImage?.uri && { background: `url(${backgroundImage.uri})`, backgroundSize: 'cover' }),
|
|
20
|
-
}, children: _jsxs(AlphaContainer, { children: [header && (_jsxs(HeaderContainer, { children: [_jsx(LogoContainer, { children: _jsx(SSILogo, { logo: logo, color: textColor }) }), credentialTitle && (_jsxs(TitleContainer, { children: [_jsx(CredentialTitleText, { style: { color: textColor }, children: credentialTitle }), credentialSubtitle && _jsx(CredentialSubtitleText, { style: { color: textColor }, children: credentialSubtitle })] }))] })), body && (_jsx(ContentMainContainer, { children: _jsxs(ContentSubContainer, { children: [issuerName && (_jsx(IssueNameContainer, { children: _jsx(H4Text, { style: { color: textColor }, children: issuerName }) })), properties && _jsx(PropertiesContainer, { children: getPropertyElementsFrom(properties) })] }) })), footer && (_jsxs(FooterContainer, { children: [_jsx(ExpirationDateText, { style: { color: textColor }, children: expirationDate
|
|
20
|
+
}, children: _jsxs(AlphaContainer, { children: [header && (_jsxs(HeaderContainer, { children: [(!backgroundImage || logo) && (_jsx(LogoContainer, { children: _jsx(SSILogo, { logo: logo, color: textColor }) })), credentialTitle && (_jsxs(TitleContainer, { children: [_jsx(CredentialTitleText, { style: { color: textColor }, children: credentialTitle }), credentialSubtitle && _jsx(CredentialSubtitleText, { style: { color: textColor }, children: credentialSubtitle })] }))] })), body && (_jsx(ContentMainContainer, { children: _jsxs(ContentSubContainer, { children: [issuerName && (_jsx(IssueNameContainer, { children: _jsx(H4Text, { style: { color: textColor }, children: issuerName }) })), properties && _jsx(PropertiesContainer, { children: getPropertyElementsFrom(properties) })] }) })), footer && (_jsxs(FooterContainer, { children: [_jsx(ExpirationDateText, { style: { color: textColor }, children: expirationDate
|
|
21
21
|
? `${Localization.translate('credential_card_expires_message')} ${toLocalDateString(expirationDate)}`
|
|
22
22
|
: Localization.translate('credential_status_never_expires_date_label') }), credentialStatus && (_jsx(StatusContainer, { children: credentialStatus && _jsx(SSIStatusLabel, { status: credentialStatus, color: textColor }) }))] }))] }) }) }));
|
|
23
23
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { TabNavigationState } from '
|
|
3
|
-
|
|
2
|
+
import { TabNavigationState } from '@sphereon/ui-components.core';
|
|
3
|
+
type Props = {
|
|
4
4
|
navigationState: TabNavigationState;
|
|
5
5
|
onIndexChange: (index: number) => void;
|
|
6
6
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { SSITabViewHeaderContainerStyled as Container, SSITabViewHeaderTitleContainerStyled as TitleContainer, SSITextH3Styled as TitleCaption, } from '../../../../styles
|
|
2
|
+
import { SSITabViewHeaderContainerStyled as Container, SSITabViewHeaderTitleContainerStyled as TitleContainer, SSITextH3Styled as TitleCaption, } from '../../../../styles';
|
|
3
3
|
const SSITabViewHeader = (props) => {
|
|
4
4
|
const { navigationState, onIndexChange } = props;
|
|
5
5
|
return (_jsx(Container, { children: navigationState.routes.map((value, index) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import SSITabViewHeader from './SSITabViewHeader';
|
|
4
|
-
import { SSITabViewContainerStyled as Container } from '../../../styles
|
|
4
|
+
import { SSITabViewContainerStyled as Container } from '../../../styles';
|
|
5
5
|
const Tab = (props) => {
|
|
6
6
|
return _jsx(React.Fragment, { children: props.children });
|
|
7
7
|
};
|