@sphereon/ui-components.ssi-react 0.1.3-next.8 → 0.1.3-next.84
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/SSIAddIcon/index.d.ts +3 -3
- package/dist/components/assets/icons/SSIArrowDownIcon/index.d.ts +3 -3
- package/dist/components/assets/icons/SSIFilterIcon/index.d.ts +3 -3
- 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/logos/SSILogo/index.d.ts +1 -1
- package/dist/components/assets/logos/SSILogo/index.js +1 -1
- package/dist/components/assets/markers/StepMarker/index.d.ts +8 -0
- package/dist/components/assets/markers/StepMarker/index.js +26 -0
- package/dist/components/buttons/SSIIconButton/index.d.ts +3 -3
- package/dist/components/buttons/SSIIconButton/index.js +5 -6
- package/dist/components/buttons/SSIPrimaryButton/index.d.ts +3 -3
- package/dist/components/buttons/SSIPrimaryButton/index.js +3 -4
- package/dist/components/buttons/SSISecondaryButton/index.d.ts +3 -3
- package/dist/components/buttons/SSISecondaryButton/index.js +3 -4
- 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 +54 -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 +4 -5
- package/dist/components/lists/SSIDropDownList/index.d.ts +1 -1
- package/dist/components/lists/SSIDropDownList/index.js +3 -3
- 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/{SSICardView → SSICredentialCardView}/index.d.ts +2 -2
- package/dist/components/views/SSICredentialCardView/index.js +24 -0
- package/dist/components/views/{SSIMiniCardView → SSICredentialMiniCardView}/index.d.ts +2 -2
- package/dist/components/views/{SSIMiniCardView → SSICredentialMiniCardView}/index.js +5 -5
- 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/SSITableViewHeader/index.d.ts +1 -1
- package/dist/components/views/SSITableView/SSITableViewHeader/index.js +3 -5
- package/dist/components/views/SSITableView/index.d.ts +1 -1
- package/dist/components/views/SSITableView/index.js +33 -16
- 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 +12 -4
- package/dist/index.js +11 -4
- package/dist/styles/components/components/ProgressStepIndicator/index.d.ts +8 -0
- package/dist/styles/components/components/ProgressStepIndicator/index.js +48 -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 +13 -0
- package/dist/styles/components/components/SSICredentialCardView/index.js +58 -0
- package/dist/styles/components/components/SSICredentialMiniCardView/index.d.ts +2 -0
- package/dist/styles/components/components/SSICredentialMiniCardView/index.js +14 -0
- package/dist/styles/components/components/SSIDropDownList/index.d.ts +1 -1
- package/dist/styles/components/components/SSIDropDownList/index.js +2 -5
- 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/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 +1 -0
- package/dist/styles/components/components/SSITabView/index.js +1 -1
- package/dist/styles/components/components/SSITableView/index.js +4 -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 +38 -0
- package/dist/styles/components/components/index.d.ts +9 -2
- package/dist/styles/components/components/index.js +9 -2
- package/dist/styles/components/fonts/index.d.ts +16 -12
- package/dist/styles/components/fonts/index.js +20 -8
- package/dist/styles/css/index.d.ts +3 -0
- package/dist/styles/css/index.js +21 -0
- package/dist/styles/index.d.ts +3 -0
- package/dist/styles/index.js +3 -0
- package/dist/types/button/index.d.ts +7 -0
- package/dist/types/button/index.js +1 -0
- package/dist/types/index.d.ts +4 -1
- package/dist/types/index.js +4 -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 +19 -0
- package/dist/types/table/index.js +6 -0
- package/dist/types/toast/index.d.ts +6 -0
- package/dist/types/toast/index.js +1 -0
- package/package.json +5 -3
- package/dist/components/labels/SSIText/index.d.ts +0 -7
- package/dist/components/labels/SSIText/index.js +0 -13
- package/dist/components/views/SSICardView/index.js +0 -24
- package/dist/styles/components/components/SSICardView/index.d.ts +0 -13
- package/dist/styles/components/components/SSICardView/index.js +0 -59
- package/dist/styles/components/components/SSIMiniCardView/index.d.ts +0 -1
- package/dist/styles/components/components/SSIMiniCardView/index.js +0 -10
- package/dist/styles/components/components/SSIText/index.d.ts +0 -3
- package/dist/types/component/index.d.ts +0 -38
- package/dist/types/component/index.js +0 -16
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ToastCustomProps } from '@sphereon/ui-components.core';
|
|
3
|
+
import { ToastConfigParams } from '../../types';
|
|
4
|
+
export declare const toastConfig: {
|
|
5
|
+
ssiToastSuccess: (params: ToastConfigParams<ToastCustomProps>) => JSX.Element;
|
|
6
|
+
ssiToastError: (params: ToastConfigParams<ToastCustomProps>) => JSX.Element;
|
|
7
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { ToastType } from '@sphereon/ui-components.core';
|
|
3
|
+
import SSIToast from '../../components/messageBoxes/toasts/SSIToast';
|
|
4
|
+
export const toastConfig = {
|
|
5
|
+
ssiToastSuccess: (params) => {
|
|
6
|
+
const { title, message, onClick, props } = params;
|
|
7
|
+
return _jsx(SSIToast, { type: ToastType.SUCCESS, title: title, message: message, showBadge: props?.showBadge, onClick: onClick });
|
|
8
|
+
},
|
|
9
|
+
ssiToastError: (params) => {
|
|
10
|
+
const { title, message, onClick, props } = params;
|
|
11
|
+
return _jsx(SSIToast, { type: ToastType.ERROR, title: title, message: message, showBadge: props?.showBadge, onClick: onClick });
|
|
12
|
+
},
|
|
13
|
+
};
|
|
@@ -2,6 +2,6 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { fontColors, statusColors } from '@sphereon/ui-components.core';
|
|
3
3
|
const SSICheckmarkBadge = (props) => {
|
|
4
4
|
const { size = 15, color = fontColors.light, backgroundColor = statusColors.valid } = props;
|
|
5
|
-
return (_jsx("div", { style: { width: size,
|
|
5
|
+
return (_jsx("div", { style: { width: size, height: size }, children: _jsxs("svg", { width: "100%", height: "100%", viewBox: "0 0 15 15", fill: "none", children: [_jsx("circle", { cx: "7.5", cy: "7.5", r: "7.5", fill: backgroundColor }), _jsx("path", { d: "M5.91233 11.0361H5.9092C5.84998 11.0357 5.79144 11.0236 5.73697 11.0005C5.6825 10.9774 5.63319 10.9437 5.59192 10.9015L3.13412 8.38546C3.09155 8.34399 3.05776 8.29447 3.03473 8.23981C3.0117 8.18516 2.99989 8.12647 3 8.06722C3.00011 8.00796 3.01214 7.94932 3.03538 7.89475C3.05862 7.84018 3.09259 7.79079 3.13531 7.74947C3.17803 7.70815 3.22863 7.67575 3.28412 7.65417C3.33962 7.63259 3.3989 7.62226 3.45847 7.6238C3.51804 7.62534 3.5767 7.63871 3.63099 7.66312C3.68529 7.68754 3.73413 7.72251 3.77463 7.76597L5.91665 9.95833L10.9927 4.91088C11.077 4.82993 11.1898 4.78514 11.307 4.78615C11.4242 4.78716 11.5363 4.8339 11.6191 4.91629C11.702 4.99869 11.749 5.11015 11.75 5.22667C11.751 5.34319 11.706 5.45544 11.6246 5.53926L6.22827 10.9059C6.14448 10.9893 6.03084 11.0361 5.91233 11.0361Z", fill: color })] }) }));
|
|
6
6
|
};
|
|
7
7
|
export default SSICheckmarkBadge;
|
|
@@ -2,6 +2,6 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { fontColors, statusColors } from '@sphereon/ui-components.core';
|
|
3
3
|
const SSIExclamationMarkBadge = (props) => {
|
|
4
4
|
const { size = 15, color = fontColors.light, backgroundColor = statusColors.error } = props;
|
|
5
|
-
return (_jsx("div", { style: { width: size,
|
|
5
|
+
return (_jsx("div", { style: { width: size, height: size }, children: _jsxs("svg", { width: "100%", height: "100%", viewBox: "0 0 15 15", fill: "none", children: [_jsx("circle", { cx: "7.5", cy: "7.5", r: "7.5", fill: backgroundColor }), _jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M6.78571 3.48218C6.78571 3.33429 6.94559 3.21429 7.14279 3.21429H7.8572C8.05439 3.21429 8.21428 3.33429 8.21428 3.48218V9.37504C8.21428 9.52293 8.05439 9.64283 7.8572 9.64283H7.14279C6.94559 9.64283 6.78571 9.52292 6.78571 9.37504V3.48218ZM6.78571 10.9822C6.78571 10.8342 6.94559 10.7143 7.14279 10.7143H7.8572C8.05439 10.7143 8.21428 10.8342 8.21428 10.9822V11.5178C8.21428 11.6657 8.05439 11.7857 7.8572 11.7857H7.14279C6.94559 11.7857 6.78571 11.6657 6.78571 11.5178V10.9822Z", fill: color })] }) }));
|
|
6
6
|
};
|
|
7
7
|
export default SSIExclamationMarkBadge;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { CSSProperties, FC } from 'react';
|
|
2
|
-
|
|
2
|
+
type Props = {
|
|
3
3
|
size?: number;
|
|
4
4
|
color?: string;
|
|
5
5
|
style?: CSSProperties;
|
|
6
|
-
}
|
|
7
|
-
declare const SSIAddIcon: FC<
|
|
6
|
+
};
|
|
7
|
+
declare const SSIAddIcon: FC<Props>;
|
|
8
8
|
export default SSIAddIcon;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { CSSProperties, FC } from 'react';
|
|
2
|
-
|
|
2
|
+
type Props = {
|
|
3
3
|
width?: number;
|
|
4
4
|
height?: number;
|
|
5
5
|
color?: string;
|
|
6
6
|
style?: CSSProperties;
|
|
7
|
-
}
|
|
8
|
-
declare const SSIArrowDownIcon: FC<
|
|
7
|
+
};
|
|
8
|
+
declare const SSIArrowDownIcon: FC<Props>;
|
|
9
9
|
export default SSIArrowDownIcon;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { CSSProperties, FC } from 'react';
|
|
2
|
-
|
|
2
|
+
type Props = {
|
|
3
3
|
width?: number;
|
|
4
4
|
height?: number;
|
|
5
5
|
color?: string;
|
|
6
6
|
style?: CSSProperties;
|
|
7
|
-
}
|
|
8
|
-
declare const SSIFilterIcon: FC<
|
|
7
|
+
};
|
|
8
|
+
declare const SSIFilterIcon: FC<Props>;
|
|
9
9
|
export default SSIFilterIcon;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { fontColors, getInitials, profileColors } from '@sphereon/ui-components.core';
|
|
3
|
-
import { SSIProfileIconContainerStyled as Container } from '../../../../styles
|
|
4
|
-
import { SSITextH2Styled as ProfileIconText } from '../../../../styles/components';
|
|
3
|
+
import { SSIProfileIconContainerStyled as Container, SSITextH2Styled as ProfileIconText } from '../../../../styles';
|
|
5
4
|
const ProfileIcon = (props) => {
|
|
6
5
|
const { fontColor = fontColors.light, backgroundColor = profileColors['100'], fullName } = props;
|
|
7
6
|
return (_jsx(Container, { style: { backgroundColor }, children: _jsx(ProfileIconText, { style: { color: fontColor }, children: getInitials(fullName) }) }));
|
|
@@ -5,7 +5,7 @@ const SSILogo = (props) => {
|
|
|
5
5
|
const { logo, color = logoColors.default, size = 32, style } = props;
|
|
6
6
|
return logo ? (_jsx("div", { style: {
|
|
7
7
|
...style,
|
|
8
|
-
|
|
8
|
+
...(logo?.dimensions && { aspectRatio: calculateAspectRatio(logo?.dimensions.width, logo?.dimensions.height) }),
|
|
9
9
|
height: size,
|
|
10
10
|
background: `url(${logo.uri})`,
|
|
11
11
|
backgroundSize: 'cover',
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { StepMarkerActiveContainerStyled as ActiveContainer, StepMarkerActiveOuterContainerStyled as ActiveOuterContainer, StepMarkerGradientContainerStyled as GradientContainer, SSITextH1SemiBoldLightStyled as StepNumberText, StepMarkerInactiveContainerStyled as InactiveContainer, } from '../../../../styles';
|
|
3
|
+
import { StepStatus } from '../../../../types';
|
|
4
|
+
const getCurrentMarkerElement = (stepNumber) => {
|
|
5
|
+
return _jsx(ActiveContainer, { children: _jsx(ActiveOuterContainer, { children: _jsx(GradientContainer, { children: _jsx(StepNumberText, { children: stepNumber }) }) }) });
|
|
6
|
+
};
|
|
7
|
+
const getNextMarkerElement = (stepNumber) => {
|
|
8
|
+
return _jsx(InactiveContainer, { children: _jsx(StepNumberText, { children: stepNumber }) });
|
|
9
|
+
};
|
|
10
|
+
const getCompletedMarkerElement = (stepNumber) => {
|
|
11
|
+
return _jsx(GradientContainer, { children: _jsx(StepNumberText, { children: stepNumber }) });
|
|
12
|
+
};
|
|
13
|
+
const StepMarker = (props) => {
|
|
14
|
+
const { stepNumber, status = StepStatus.NEXT } = props;
|
|
15
|
+
switch (status) {
|
|
16
|
+
case StepStatus.CURRENT:
|
|
17
|
+
return getCurrentMarkerElement(stepNumber);
|
|
18
|
+
case StepStatus.COMPLETED:
|
|
19
|
+
return getCompletedMarkerElement(stepNumber);
|
|
20
|
+
case StepStatus.NEXT:
|
|
21
|
+
return getNextMarkerElement(stepNumber);
|
|
22
|
+
default:
|
|
23
|
+
return _jsx("div", {});
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
export default StepMarker;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
icon:
|
|
2
|
+
import { ButtonIcon } from '@sphereon/ui-components.core';
|
|
3
|
+
type Props = {
|
|
4
|
+
icon: ButtonIcon;
|
|
5
5
|
onClick: () => Promise<void>;
|
|
6
6
|
disabled?: boolean;
|
|
7
7
|
color?: string;
|
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { ButtonIcon, fontColors } from '@sphereon/ui-components.core';
|
|
2
3
|
import SSIAddIcon from '../../assets/icons/SSIAddIcon';
|
|
3
4
|
import SSIFilterIcon from '../../assets/icons/SSIFilterIcon';
|
|
4
5
|
import SSIArrowDownIcon from '../../assets/icons/SSIArrowDownIcon';
|
|
5
|
-
import {
|
|
6
|
-
import { SSIIconButtonContainerStyled as Container } from '../../../styles/components';
|
|
7
|
-
import { fontColors } from '@sphereon/ui-components.core';
|
|
6
|
+
import { SSIIconButtonContainerStyled as Container } from '../../../styles';
|
|
8
7
|
const SSIIconButton = (props) => {
|
|
9
8
|
const { icon, onClick, disabled = false, color = fontColors.dark } = props;
|
|
10
9
|
return _jsx(Container, { onClick: onClick, children: getIcon(icon, color) });
|
|
11
10
|
};
|
|
12
11
|
const getIcon = (icon, color) => {
|
|
13
12
|
switch (icon) {
|
|
14
|
-
case
|
|
13
|
+
case ButtonIcon.ADD:
|
|
15
14
|
return _jsx(SSIAddIcon, { color: color });
|
|
16
|
-
case
|
|
15
|
+
case ButtonIcon.FILTER:
|
|
17
16
|
return _jsx(SSIFilterIcon, { color: color });
|
|
18
|
-
case
|
|
17
|
+
case ButtonIcon.ARROW_DOWN:
|
|
19
18
|
return _jsx(SSIArrowDownIcon, { color: color });
|
|
20
19
|
default:
|
|
21
20
|
return _jsx("div", {});
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { CSSProperties, FC } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import { ButtonIcon } from '@sphereon/ui-components.core';
|
|
3
|
+
type Props = {
|
|
4
4
|
caption: string;
|
|
5
5
|
onClick: () => Promise<void>;
|
|
6
|
-
icon?:
|
|
6
|
+
icon?: ButtonIcon;
|
|
7
7
|
disabled?: boolean;
|
|
8
8
|
style?: CSSProperties;
|
|
9
9
|
};
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { fontColors } from '@sphereon/ui-components.core';
|
|
2
|
+
import { ButtonIcon, fontColors } from '@sphereon/ui-components.core';
|
|
3
3
|
import SSIAddIcon from '../../assets/icons/SSIAddIcon';
|
|
4
|
-
import { SSIPrimaryButtonContainerStyled as Container, SSITextH3LightStyled as Caption } from '../../../styles
|
|
5
|
-
import { ButtonIconsEnum } from '../../../types';
|
|
4
|
+
import { SSIPrimaryButtonContainerStyled as Container, SSITextH3LightStyled as Caption } from '../../../styles';
|
|
6
5
|
const SSIPrimaryButton = (props) => {
|
|
7
6
|
const { caption, icon, onClick, disabled = false, style = {} } = props;
|
|
8
7
|
const getIcon = (icon, color) => {
|
|
9
8
|
switch (icon) {
|
|
10
|
-
case
|
|
9
|
+
case ButtonIcon.ADD:
|
|
11
10
|
return _jsx(SSIAddIcon, { style: { ...(disabled && { opacity: 0.5 }) }, color: color });
|
|
12
11
|
default:
|
|
13
12
|
return _jsx("div", {});
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { CSSProperties, FC } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import { ButtonIcon } from '@sphereon/ui-components.core';
|
|
3
|
+
type Props = {
|
|
4
4
|
caption: string;
|
|
5
5
|
onClick: () => Promise<void>;
|
|
6
|
-
icon?:
|
|
6
|
+
icon?: ButtonIcon;
|
|
7
7
|
disabled?: boolean;
|
|
8
8
|
style?: CSSProperties;
|
|
9
9
|
};
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { gradientColors } from '@sphereon/ui-components.core';
|
|
2
|
+
import { ButtonIcon, gradientColors } from '@sphereon/ui-components.core';
|
|
3
3
|
import SSIAddIcon from '../../assets/icons/SSIAddIcon';
|
|
4
|
-
import { SSISecondaryButtonCaptionStyled as Caption, SSISecondaryButtonContainerStyled as Container
|
|
5
|
-
import { ButtonIconsEnum } from '../../../types';
|
|
4
|
+
import { SSISecondaryButtonCaptionStyled as Caption, SSISecondaryButtonContainerStyled as Container } from '../../../styles';
|
|
6
5
|
const SSISecondaryButton = (props) => {
|
|
7
6
|
const { caption, icon, onClick, disabled = false, style = {} } = props;
|
|
8
7
|
const getIcon = (icon, color) => {
|
|
9
8
|
switch (icon) {
|
|
10
|
-
case
|
|
9
|
+
case ButtonIcon.ADD:
|
|
11
10
|
return _jsx(SSIAddIcon, { style: { ...(disabled && { opacity: 0.5 }) }, color: color });
|
|
12
11
|
default:
|
|
13
12
|
return _jsx("div", {});
|
|
@@ -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, selectionElements } 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 = selectionElements.primaryBorderDark, disabled = false, initialValue = false, label, selectedColor = selectionElements.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,54 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { elements, fontColors, gradientColors } from '@sphereon/ui-components.core';
|
|
3
|
+
import StepMarker from '../../assets/markers/StepMarker';
|
|
4
|
+
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';
|
|
5
|
+
import { StepStatus } from '../../../types';
|
|
6
|
+
const getStepRowElement = (stepNumber, status, step, maxSteps) => {
|
|
7
|
+
const gridRowNumber = (stepNumber * 2) - 1;
|
|
8
|
+
return (_jsxs(_Fragment, { children: [_jsxs(StepMarkerCell, { style: { gridRow: gridRowNumber }, children: [_jsx(StepMarker, { stepNumber: stepNumber, status: status }), stepNumber < maxSteps &&
|
|
9
|
+
_jsx(StepLine, { style: {
|
|
10
|
+
...(status === StepStatus.COMPLETED && {
|
|
11
|
+
backgroundColor: elements.purple
|
|
12
|
+
})
|
|
13
|
+
} })] }), _jsxs(StepTextCell, { style: { gridRow: gridRowNumber }, children: [step.title &&
|
|
14
|
+
_jsx(TitleText, { style: {
|
|
15
|
+
...(status === StepStatus.CURRENT && {
|
|
16
|
+
background: gradientColors['100'],
|
|
17
|
+
backgroundClip: 'text',
|
|
18
|
+
WebkitBackgroundClip: 'text',
|
|
19
|
+
WebkitTextFillColor: 'transparent'
|
|
20
|
+
}),
|
|
21
|
+
...(status === StepStatus.COMPLETED && { color: fontColors.dark }),
|
|
22
|
+
...(status === StepStatus.NEXT && { color: fontColors.lightGrey })
|
|
23
|
+
}, children: step.title }), step.description &&
|
|
24
|
+
_jsx(DescriptionText, { style: { ...((status === StepStatus.CURRENT || status === StepStatus.COMPLETED) && { color: fontColors.dark }) }, children: step.description })] }), stepNumber < maxSteps &&
|
|
25
|
+
_jsx(SpacerLineCell, { style: { gridRow: gridRowNumber + 1 }, children: _jsx(StepLine, { style: {
|
|
26
|
+
...(status === StepStatus.COMPLETED && {
|
|
27
|
+
backgroundColor: elements.purple
|
|
28
|
+
})
|
|
29
|
+
} }) })] }));
|
|
30
|
+
};
|
|
31
|
+
const getStepStatus = (stepNumber, activeStep) => {
|
|
32
|
+
if (stepNumber < activeStep) {
|
|
33
|
+
return StepStatus.COMPLETED;
|
|
34
|
+
}
|
|
35
|
+
else if (stepNumber > activeStep) {
|
|
36
|
+
return StepStatus.NEXT;
|
|
37
|
+
}
|
|
38
|
+
else if (stepNumber === activeStep) {
|
|
39
|
+
return StepStatus.CURRENT;
|
|
40
|
+
}
|
|
41
|
+
throw new Error('Unable to determine step status');
|
|
42
|
+
};
|
|
43
|
+
const getStepElements = (activeStep, steps) => {
|
|
44
|
+
return steps.map((step, index) => {
|
|
45
|
+
const stepNumber = index + 1;
|
|
46
|
+
const stepStatus = getStepStatus(stepNumber, activeStep);
|
|
47
|
+
return getStepRowElement(stepNumber, stepStatus, step, steps.length);
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
const ProgressStepIndicator = (props) => {
|
|
51
|
+
const { activeStep, steps = [], style } = props;
|
|
52
|
+
return _jsx(Container, { style: style, children: _jsx(GridContainer, { children: getStepElements(activeStep, steps) }) });
|
|
53
|
+
};
|
|
54
|
+
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 { elements } from '@sphereon/ui-components.core';
|
|
4
|
+
const SSIActivityIndicator = (props) => {
|
|
5
|
+
const { size = 80, color = elements.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,11 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import { SSITypeLabelContainerStyled as Container } from '../../../styles
|
|
4
|
-
import { backgroundColors, gradientColors } from '@sphereon/ui-components.core';
|
|
2
|
+
import { backgroundColors, gradientColors, LabelType } from '@sphereon/ui-components.core';
|
|
3
|
+
import { SSITypeLabelContainerStyled as Container } from '../../../styles';
|
|
5
4
|
const getBackground = (type) => {
|
|
6
5
|
switch (type) {
|
|
7
|
-
case
|
|
6
|
+
case LabelType.ISSUER:
|
|
8
7
|
return gradientColors['200'];
|
|
9
|
-
case
|
|
8
|
+
case LabelType.VERIFIER:
|
|
10
9
|
return gradientColors['100'];
|
|
11
10
|
default:
|
|
12
11
|
return backgroundColors.primaryLight;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import { ButtonIcon } from '@sphereon/ui-components.core';
|
|
3
4
|
import SSIIconButton from '../../buttons/SSIIconButton';
|
|
4
|
-
import {
|
|
5
|
-
import { SSIDropDownListContainerStyled as Container, SSITextH3Styled as LabelCaption, SSIDropDownListSelectedValueStyled as SelectedValue, } from '../../../styles/components';
|
|
5
|
+
import { SSIDropDownListContainerStyled as Container, SSITextH3Styled as LabelCaption, SSIDropDownListSelectedValueStyled as SelectedValue, } from '../../../styles';
|
|
6
6
|
const SSIDropDownList = (props) => {
|
|
7
7
|
const { initialValue, label } = props;
|
|
8
8
|
const [value, setValue] = React.useState(initialValue);
|
|
9
|
-
return (_jsxs(Container, { children: [label && _jsx(LabelCaption, { children: label }), _jsx(SelectedValue, { children: value }), _jsx(SSIIconButton, { icon:
|
|
9
|
+
return (_jsxs(Container, { children: [label && _jsx(LabelCaption, { children: label }), _jsx(SelectedValue, { children: value }), _jsx(SSIIconButton, { icon: ButtonIcon.ARROW_DOWN, onClick: async () => console.log('drop down clicked') })] }));
|
|
10
10
|
};
|
|
11
11
|
export default SSIDropDownList;
|
|
@@ -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,24 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { backgroundColors, credentialCardColors, Localization, toLocalDateString, } from '@sphereon/ui-components.core';
|
|
3
|
+
import SSILogo from '../../assets/logos/SSILogo';
|
|
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';
|
|
6
|
+
const SSICredentialCardView = (props) => {
|
|
7
|
+
const { header, body, footer } = props;
|
|
8
|
+
const { credentialTitle, credentialSubtitle, logo } = props.header ?? {};
|
|
9
|
+
const { issuerName, properties } = props.body ?? {};
|
|
10
|
+
const { credentialStatus, expirationDate } = props.footer ?? {};
|
|
11
|
+
const { backgroundColor = credentialCardColors.default, backgroundImage, textColor = backgroundColors.primaryLight } = props.display ?? {};
|
|
12
|
+
const getPropertyElementsFrom = (properties) => {
|
|
13
|
+
return properties.slice(0, 2).map((property, index) => (_jsxs(PropertyContainer, { style: {
|
|
14
|
+
...(properties.length > 1 && { width: 140 }),
|
|
15
|
+
...(index > 0 && { marginLeft: 10 }),
|
|
16
|
+
}, children: [_jsx(H4Text, { style: { color: textColor }, children: property.name }), _jsx(PropertyValueText, { style: { color: textColor }, children: property.value })] }, index)));
|
|
17
|
+
};
|
|
18
|
+
return (_jsx(Container, { style: { backgroundColor }, children: _jsx(BackgroundImage, { style: {
|
|
19
|
+
...(backgroundImage?.uri && { background: `url(${backgroundImage.uri})`, backgroundSize: 'cover' }),
|
|
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
|
+
? `${Localization.translate('credential_card_expires_message')} ${toLocalDateString(expirationDate)}`
|
|
22
|
+
: Localization.translate('credential_status_never_expires_date_label') }), credentialStatus && (_jsx(StatusContainer, { children: credentialStatus && _jsx(SSIStatusLabel, { status: credentialStatus, color: textColor }) }))] }))] }) }) }));
|
|
23
|
+
};
|
|
24
|
+
export default SSICredentialCardView;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { credentialCardColors } from '@sphereon/ui-components.core';
|
|
3
|
-
import { SSIMiniCardViewContainerStyled as Container } from '../../../styles/components';
|
|
4
3
|
import SSILogo from '../../assets/logos/SSILogo';
|
|
5
|
-
|
|
4
|
+
import { SSICredentialMiniCardViewContainerStyled as Container, SSICredentialMiniCardViewBackgroundImageStyled as BackgroundImage, } from '../../../styles';
|
|
5
|
+
const SSICredentialMiniCardView = (props) => {
|
|
6
6
|
const { backgroundColor = credentialCardColors.default, backgroundImage, logo, logoColor, style } = props;
|
|
7
|
-
return (_jsx(Container, { style: { ...style, backgroundColor }, children: _jsx(
|
|
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 SSICredentialMiniCardView;
|