@sphereon/ui-components.ssi-react 0.1.3-next.13 → 0.1.3-next.20

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.
Files changed (24) hide show
  1. package/dist/components/assets/logos/SSILogo/index.d.ts +1 -1
  2. package/dist/components/assets/logos/SSILogo/index.js +1 -1
  3. package/dist/components/fields/SSICheckbox/index.d.ts +15 -0
  4. package/dist/components/fields/SSICheckbox/index.js +24 -0
  5. package/dist/components/views/{SSICardView → SSICredentialCardView}/index.d.ts +2 -2
  6. package/dist/components/views/SSICredentialCardView/index.js +25 -0
  7. package/dist/components/views/{SSIMiniCardView → SSICredentialMiniCardView}/index.d.ts +2 -2
  8. package/dist/components/views/{SSIMiniCardView → SSICredentialMiniCardView}/index.js +5 -4
  9. package/dist/index.d.ts +4 -3
  10. package/dist/index.js +4 -3
  11. package/dist/styles/components/components/SSICheckbox/index.d.ts +4 -0
  12. package/dist/styles/components/components/SSICheckbox/index.js +25 -0
  13. package/dist/styles/components/components/SSICredentialCardView/index.d.ts +13 -0
  14. package/dist/styles/components/components/SSICredentialCardView/index.js +58 -0
  15. package/dist/styles/components/components/SSICredentialMiniCardView/index.d.ts +2 -0
  16. package/dist/styles/components/components/SSICredentialMiniCardView/index.js +14 -0
  17. package/dist/styles/components/components/index.d.ts +3 -2
  18. package/dist/styles/components/components/index.js +3 -2
  19. package/package.json +3 -3
  20. package/dist/components/views/SSICardView/index.js +0 -24
  21. package/dist/styles/components/components/SSICardView/index.d.ts +0 -13
  22. package/dist/styles/components/components/SSICardView/index.js +0 -59
  23. package/dist/styles/components/components/SSIMiniCardView/index.d.ts +0 -2
  24. package/dist/styles/components/components/SSIMiniCardView/index.js +0 -14
@@ -1,5 +1,5 @@
1
- import { ImageAttributes } from '@sphereon/ui-components.core';
2
1
  import { CSSProperties, FC } from 'react';
2
+ import { ImageAttributes } from '@sphereon/ui-components.core';
3
3
  type Props = {
4
4
  logo?: ImageAttributes;
5
5
  size?: number;
@@ -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
- aspectRatio: logo?.dimensions && calculateAspectRatio(logo?.dimensions.width, logo?.dimensions.height),
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,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,24 @@
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 &&
20
+ (typeof label === 'string'
21
+ ? _jsx(LabelCaption, { style: { color: labelColor }, children: label })
22
+ : label)] }));
23
+ };
24
+ export default SSICheckbox;
@@ -28,5 +28,5 @@ type Props = {
28
28
  footer?: CardFooter;
29
29
  display?: CardDisplay;
30
30
  };
31
- declare const SSICardView: FC<Props>;
32
- export default SSICardView;
31
+ declare const SSICredentialCardView: FC<Props>;
32
+ export default SSICredentialCardView;
@@ -0,0 +1,25 @@
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/components';
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) &&
21
+ _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
22
+ ? `${Localization.translate('credential_card_expires_message')} ${toLocalDateString(expirationDate)}`
23
+ : Localization.translate('credential_status_never_expires_date_label') }), credentialStatus && (_jsx(StatusContainer, { children: credentialStatus && _jsx(SSIStatusLabel, { status: credentialStatus, color: textColor }) }))] }))] }) }) }));
24
+ };
25
+ export default SSICredentialCardView;
@@ -7,5 +7,5 @@ type Props = {
7
7
  logoColor?: string;
8
8
  style?: CSSProperties;
9
9
  };
10
- declare const SSIMiniCardView: FC<Props>;
11
- export default SSIMiniCardView;
10
+ declare const SSICredentialMiniCardView: FC<Props>;
11
+ export default SSICredentialMiniCardView;
@@ -1,11 +1,12 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { credentialCardColors } from '@sphereon/ui-components.core';
3
- import { SSIMiniCardViewContainerStyled as Container, SSIMiniCardViewBackgroundImageStyled as BackgroundImage, } from '../../../styles/components';
4
3
  import SSILogo from '../../assets/logos/SSILogo';
5
- const SSIMiniCardView = (props) => {
4
+ import { SSICredentialMiniCardViewContainerStyled as Container, SSICredentialMiniCardViewBackgroundImageStyled as BackgroundImage, } from '../../../styles/components';
5
+ const SSICredentialMiniCardView = (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) &&
10
+ _jsx(SSILogo, { logo: logo, color: logoColor }) }) }));
10
11
  };
11
- export default SSIMiniCardView;
12
+ export default SSICredentialMiniCardView;
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import SSIStatusLabel from './components/labels/SSIStatusLabel';
2
- import SSICardView from './components/views/SSICardView';
3
- import SSIMiniCardView from './components/views/SSIMiniCardView';
2
+ import SSICredentialCardView from './components/views/SSICredentialCardView';
3
+ import SSICredentialMiniCardView from './components/views/SSICredentialMiniCardView';
4
4
  import SSICheckmarkBadge from './components/assets/badges/SSICheckmarkBadge';
5
5
  import SSIExclamationMarkBadge from './components/assets/badges/SSIExclamationMarkBadge';
6
6
  import SSIPlaceholderLogo from './components/assets/logos/SSIPlaceholderLogo';
@@ -18,6 +18,7 @@ import SSITabView from './components/views/SSITabView';
18
18
  import SSITabViewHeader from './components/views/SSITabView/SSITabViewHeader';
19
19
  import SSIProfileIcon from './components/assets/icons/SSIProfileIcon';
20
20
  import SSISecondaryButton from './components/buttons/SSISecondaryButton';
21
+ import SSICheckbox from './components/fields/SSICheckbox';
21
22
  export * from './types';
22
23
  export * from './styles/components/fonts';
23
- export { SSICardView, SSIMiniCardView, SSIStatusLabel, SSICheckmarkBadge, SSIExclamationMarkBadge, SSIPlaceholderLogo, SSILogo, SSIAddIcon, SSIFilterIcon, SSIArrowDownIcon, SSITypeLabel, SSIIconButton, SSIPrimaryButton, SSISecondaryButton, SSIDropDownList, SSITableView, SSITableViewHeader, SSITabView, SSITabViewHeader, SSIProfileIcon, };
24
+ export { SSICredentialCardView, SSICredentialMiniCardView, SSIStatusLabel, SSICheckmarkBadge, SSIExclamationMarkBadge, SSIPlaceholderLogo, SSILogo, SSIAddIcon, SSIFilterIcon, SSIArrowDownIcon, SSITypeLabel, SSIIconButton, SSIPrimaryButton, SSISecondaryButton, SSIDropDownList, SSITableView, SSITableViewHeader, SSITabView, SSITabViewHeader, SSIProfileIcon, SSICheckbox };
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import SSIStatusLabel from './components/labels/SSIStatusLabel';
2
- import SSICardView from './components/views/SSICardView';
3
- import SSIMiniCardView from './components/views/SSIMiniCardView';
2
+ import SSICredentialCardView from './components/views/SSICredentialCardView';
3
+ import SSICredentialMiniCardView from './components/views/SSICredentialMiniCardView';
4
4
  import SSICheckmarkBadge from './components/assets/badges/SSICheckmarkBadge';
5
5
  import SSIExclamationMarkBadge from './components/assets/badges/SSIExclamationMarkBadge';
6
6
  import SSIPlaceholderLogo from './components/assets/logos/SSIPlaceholderLogo';
@@ -18,6 +18,7 @@ import SSITabView from './components/views/SSITabView';
18
18
  import SSITabViewHeader from './components/views/SSITabView/SSITabViewHeader';
19
19
  import SSIProfileIcon from './components/assets/icons/SSIProfileIcon';
20
20
  import SSISecondaryButton from './components/buttons/SSISecondaryButton';
21
+ import SSICheckbox from './components/fields/SSICheckbox';
21
22
  export * from './types';
22
23
  export * from './styles/components/fonts';
23
- export { SSICardView, SSIMiniCardView, SSIStatusLabel, SSICheckmarkBadge, SSIExclamationMarkBadge, SSIPlaceholderLogo, SSILogo, SSIAddIcon, SSIFilterIcon, SSIArrowDownIcon, SSITypeLabel, SSIIconButton, SSIPrimaryButton, SSISecondaryButton, SSIDropDownList, SSITableView, SSITableViewHeader, SSITabView, SSITabViewHeader, SSIProfileIcon, };
24
+ export { SSICredentialCardView, SSICredentialMiniCardView, SSIStatusLabel, SSICheckmarkBadge, SSIExclamationMarkBadge, SSIPlaceholderLogo, SSILogo, SSIAddIcon, SSIFilterIcon, SSIArrowDownIcon, SSITypeLabel, SSIIconButton, SSIPrimaryButton, SSISecondaryButton, SSIDropDownList, SSITableView, SSITableViewHeader, SSITabView, SSITabViewHeader, SSIProfileIcon, SSICheckbox };
@@ -0,0 +1,4 @@
1
+ export declare const SSICheckboxContainerStyled: import("styled-components").StyledComponent<"div", any, {}, never>;
2
+ export declare const SSICheckboxUnselectedContainerStyled: import("styled-components").StyledComponent<"div", any, {}, never>;
3
+ export declare const SSICheckboxSelectedContainerStyled: import("styled-components").StyledComponent<"div", any, {}, never>;
4
+ export declare const SSICheckboxLabelContainerStyled: import("styled-components").StyledComponent<"span", any, {}, never>;
@@ -0,0 +1,25 @@
1
+ import styled from 'styled-components';
2
+ import { SSITextH4LightStyled } from '../../fonts';
3
+ import { SSIFlexDirectionRowViewStyled } from '../../containers';
4
+ export const SSICheckboxContainerStyled = styled(SSIFlexDirectionRowViewStyled) `
5
+ align-items: center;
6
+ gap: 10px;
7
+ cursor: pointer;
8
+ `;
9
+ export const SSICheckboxUnselectedContainerStyled = styled.div `
10
+ width: 18px;
11
+ aspect-ratio: 1;
12
+ border-radius: 4px;
13
+ border-width: 1px;
14
+ `;
15
+ export const SSICheckboxSelectedContainerStyled = styled.div `
16
+ width: 18px;
17
+ aspect-ratio: 1;
18
+ border-radius: 4px;
19
+ align-items: center;
20
+ justify-content: center;
21
+ `;
22
+ export const SSICheckboxLabelContainerStyled = styled(SSITextH4LightStyled) `
23
+ display: flex;
24
+ flex-wrap: wrap;
25
+ `;
@@ -0,0 +1,13 @@
1
+ export declare const SSICredentialCardViewContainerStyled: import("styled-components").StyledComponent<"div", any, {}, never>;
2
+ export declare const SSICredentialCardViewBackgroundImageStyled: import("styled-components").StyledComponent<"div", any, {}, never>;
3
+ export declare const SSICredentialCardViewHeaderContainerStyled: import("styled-components").StyledComponent<"div", any, {}, never>;
4
+ export declare const SSICredentialCardViewHeaderLogoContainerStyled: import("styled-components").StyledComponent<"div", any, {}, never>;
5
+ export declare const SSICredentialCardViewHeaderTitleContainerStyled: import("styled-components").StyledComponent<"div", any, {}, never>;
6
+ export declare const SSICredentialCardViewContentMainContainerStyled: import("styled-components").StyledComponent<"div", any, {}, never>;
7
+ export declare const SSICredentialCardViewContentSubContainerStyled: import("styled-components").StyledComponent<"div", any, {}, never>;
8
+ export declare const SSICredentialCardViewContentIssueNameContainerStyled: import("styled-components").StyledComponent<"div", any, {}, never>;
9
+ export declare const SSICredentialCardViewContentPropertiesContainerStyled: import("styled-components").StyledComponent<"div", any, {}, never>;
10
+ export declare const SSICredentialCardViewFooterContainerStyled: import("styled-components").StyledComponent<"div", any, {}, never>;
11
+ export declare const SSICredentialCardViewCredentialTitleTextStyled: import("styled-components").StyledComponent<"span", any, {}, never>;
12
+ export declare const SSICredentialCardViewCredentialSubtitleTextStyled: import("styled-components").StyledComponent<"span", any, {}, never>;
13
+ export declare const SSICredentialCardViewStatusContainerStyled: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -0,0 +1,58 @@
1
+ import styled from 'styled-components';
2
+ import { SSIFlexDirectionColumnViewStyled, SSIFlexDirectionRowViewStyled, SSIRoundedContainerStyled } from '../../containers';
3
+ import { SSITextH4SemiBoldLightStyled, SSITextH5LightStyled } from '../../fonts';
4
+ export const SSICredentialCardViewContainerStyled = styled(SSIRoundedContainerStyled) `
5
+ width: 327px;
6
+ height: 186px;
7
+ display: flex;
8
+ flex-direction: column;
9
+ user-select: none;
10
+ `;
11
+ export const SSICredentialCardViewBackgroundImageStyled = styled(SSIFlexDirectionColumnViewStyled) `
12
+ flex-grow: 1;
13
+ `;
14
+ export const SSICredentialCardViewHeaderContainerStyled = styled(SSIFlexDirectionRowViewStyled) `
15
+ height: 32px;
16
+ margin-top: 16px;
17
+ `;
18
+ export const SSICredentialCardViewHeaderLogoContainerStyled = styled.div `
19
+ margin: 0 12px 0 9px;
20
+ `;
21
+ export const SSICredentialCardViewHeaderTitleContainerStyled = styled.div `
22
+ text-align: end;
23
+ margin: 0 13px 0 auto;
24
+ `;
25
+ export const SSICredentialCardViewContentMainContainerStyled = styled.div `
26
+ display: flex;
27
+ flex-grow: 1;
28
+ `;
29
+ export const SSICredentialCardViewContentSubContainerStyled = styled.div `
30
+ margin-top: auto;
31
+ `;
32
+ export const SSICredentialCardViewContentIssueNameContainerStyled = styled.div `
33
+ padding: 2px 9px 2px 12px;
34
+ `;
35
+ export const SSICredentialCardViewContentPropertiesContainerStyled = styled(SSIFlexDirectionRowViewStyled) `
36
+ justify-content: flex-start;
37
+ margin: 1px 0;
38
+ padding: 2px 9px 4px 12px;
39
+ `;
40
+ export const SSICredentialCardViewFooterContainerStyled = styled(SSIFlexDirectionRowViewStyled) `
41
+ margin-top: auto;
42
+ backdrop-filter: blur(3px);
43
+ background-color: rgba(255, 255, 255, 0.25);
44
+ padding: 12px;
45
+ `;
46
+ export const SSICredentialCardViewCredentialTitleTextStyled = styled(SSITextH4SemiBoldLightStyled) `
47
+ word-break: break-all;
48
+ display: -webkit-box;
49
+ -webkit-box-orient: vertical;
50
+ -webkit-line-clamp: 2;
51
+ overflow: hidden;
52
+ `;
53
+ export const SSICredentialCardViewCredentialSubtitleTextStyled = styled(SSITextH5LightStyled) `
54
+ text-align: right;
55
+ `;
56
+ export const SSICredentialCardViewStatusContainerStyled = styled.div `
57
+ margin-left: auto;
58
+ `;
@@ -0,0 +1,2 @@
1
+ export declare const SSICredentialMiniCardViewContainerStyled: import("styled-components").StyledComponent<"div", any, {}, never>;
2
+ export declare const SSICredentialMiniCardViewBackgroundImageStyled: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -0,0 +1,14 @@
1
+ import styled from 'styled-components';
2
+ import { SSIFlexDirectionColumnViewStyled } from '../../containers';
3
+ export const SSICredentialMiniCardViewContainerStyled = styled.div `
4
+ width: 75px;
5
+ height: 50px;
6
+ border-radius: 4.6px;
7
+ overflow: hidden;
8
+ display: flex;
9
+ `;
10
+ export const SSICredentialMiniCardViewBackgroundImageStyled = styled(SSIFlexDirectionColumnViewStyled) `
11
+ flex-grow: 1;
12
+ align-items: center;
13
+ justify-content: center;
14
+ `;
@@ -1,5 +1,5 @@
1
- export * from './SSICardView';
2
- export * from './SSIMiniCardView';
1
+ export * from './SSICredentialCardView';
2
+ export * from './SSICredentialMiniCardView';
3
3
  export * from './SSIStatusLabel';
4
4
  export * from './SSIPrimaryButton';
5
5
  export * from './SSISecondaryButton';
@@ -10,3 +10,4 @@ export * from './SSITableViewHeader';
10
10
  export * from './SSITableView';
11
11
  export * from './SSITabViewHeader';
12
12
  export * from './SSITabView';
13
+ export * from './SSICheckbox';
@@ -1,5 +1,5 @@
1
- export * from './SSICardView';
2
- export * from './SSIMiniCardView';
1
+ export * from './SSICredentialCardView';
2
+ export * from './SSICredentialMiniCardView';
3
3
  export * from './SSIStatusLabel';
4
4
  export * from './SSIPrimaryButton';
5
5
  export * from './SSISecondaryButton';
@@ -10,3 +10,4 @@ export * from './SSITableViewHeader';
10
10
  export * from './SSITableView';
11
11
  export * from './SSITabViewHeader';
12
12
  export * from './SSITabView';
13
+ export * from './SSICheckbox';
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.1.3-next.13+433837d",
4
+ "version": "0.1.3-next.20+b81e1a1",
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>",
@@ -28,7 +28,7 @@
28
28
  "access": "public"
29
29
  },
30
30
  "dependencies": {
31
- "@sphereon/ui-components.core": "0.1.3-next.13+433837d",
31
+ "@sphereon/ui-components.core": "0.1.3-next.20+b81e1a1",
32
32
  "@tanstack/react-table": "^8.9.3",
33
33
  "styled-components": "^5.3.3"
34
34
  },
@@ -40,5 +40,5 @@
40
40
  "peerDependencies": {
41
41
  "react": ">= 16.8.0"
42
42
  },
43
- "gitHead": "433837da5d60749a8c05d7587eaf07619f74d89d"
43
+ "gitHead": "b81e1a14c8515d7154b63cef2a5a889ba9c641ff"
44
44
  }
@@ -1,24 +0,0 @@
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 { SSIAlphaContainerStyled as AlphaContainer, SSICardViewContainerStyled as Container, SSICardViewBackgroundImageStyled as BackgroundImage, SSICardViewContentMainContainerStyled as ContentMainContainer, SSICardViewContentSubContainerStyled as ContentSubContainer, SSICardViewSSICredentialStatusStyled as CredentialStatusContainer, SSICardViewCredentialSubtitleTextStyled as CredentialSubtitleText, SSICardViewCredentialTitleTextStyled as CredentialTitleText, SSITextH5LightStyled as ExpirationDateText, SSICardViewFooterContainerStyled as FooterContainer, SSITextH4LightStyled as H4Text, SSICardViewHeaderContainerStyled as HeaderContainer, SSICardViewContentIssueNameContainerStyled as IssueNameContainer, SSICardViewHeaderLogoContainerStyled as LogoContainer, SSICardViewContentPropertiesContainerStyled as PropertiesContainer, SSITextH6LightStyled as PropertyValueText, SSICardViewHeaderTitleContainerStyled as TitleContainer, SSIFlexDirectionColumnViewStyled as PropertyContainer, } from '../../../styles/components';
4
- import SSILogo from '../../assets/logos/SSILogo';
5
- import SSIStatusLabel from '../../labels/SSIStatusLabel';
6
- const SSICardView = (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: [_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(CredentialStatusContainer, { children: credentialStatus && _jsx(SSIStatusLabel, { status: credentialStatus, color: textColor }) }))] }))] }) }) }));
23
- };
24
- export default SSICardView;
@@ -1,13 +0,0 @@
1
- export declare const SSICardViewContainerStyled: import("styled-components").StyledComponent<"div", any, {}, never>;
2
- export declare const SSICardViewBackgroundImageStyled: import("styled-components").StyledComponent<"div", any, {}, never>;
3
- export declare const SSICardViewHeaderContainerStyled: import("styled-components").StyledComponent<"div", any, {}, never>;
4
- export declare const SSICardViewHeaderLogoContainerStyled: import("styled-components").StyledComponent<"div", any, {}, never>;
5
- export declare const SSICardViewHeaderTitleContainerStyled: import("styled-components").StyledComponent<"div", any, {}, never>;
6
- export declare const SSICardViewContentMainContainerStyled: import("styled-components").StyledComponent<"div", any, {}, never>;
7
- export declare const SSICardViewContentSubContainerStyled: import("styled-components").StyledComponent<"div", any, {}, never>;
8
- export declare const SSICardViewContentIssueNameContainerStyled: import("styled-components").StyledComponent<"div", any, {}, never>;
9
- export declare const SSICardViewContentPropertiesContainerStyled: import("styled-components").StyledComponent<"div", any, {}, never>;
10
- export declare const SSICardViewFooterContainerStyled: import("styled-components").StyledComponent<"div", any, {}, never>;
11
- export declare const SSICardViewCredentialTitleTextStyled: import("styled-components").StyledComponent<"span", any, {}, never>;
12
- export declare const SSICardViewCredentialSubtitleTextStyled: import("styled-components").StyledComponent<"span", any, {}, never>;
13
- export declare const SSICardViewSSICredentialStatusStyled: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -1,59 +0,0 @@
1
- import styled from 'styled-components';
2
- import { SSIFlexDirectionColumnViewStyled, SSIFlexDirectionRowViewStyled, SSIRoundedContainerStyled } from '../../containers';
3
- import { SSITextH4SemiBoldLightStyled, SSITextH5LightStyled } from '../../fonts';
4
- export const SSICardViewContainerStyled = styled(SSIRoundedContainerStyled) `
5
- width: 327px;
6
- height: 186px;
7
- display: flex;
8
- flex-direction: column;
9
- user-select: none;
10
- `;
11
- export const SSICardViewBackgroundImageStyled = styled(SSIFlexDirectionColumnViewStyled) `
12
- flex-grow: 1;
13
- `;
14
- export const SSICardViewHeaderContainerStyled = styled(SSIFlexDirectionRowViewStyled) `
15
- height: 32px;
16
- margin-top: 16px;
17
- `;
18
- export const SSICardViewHeaderLogoContainerStyled = styled.div `
19
- margin-left: 9px;
20
- margin-right: 12px;
21
- `;
22
- export const SSICardViewHeaderTitleContainerStyled = styled.div `
23
- text-align: end;
24
- margin: 0px 13px 0px auto;
25
- `;
26
- export const SSICardViewContentMainContainerStyled = styled.div `
27
- display: flex;
28
- flex-grow: 1;
29
- `;
30
- export const SSICardViewContentSubContainerStyled = styled.div `
31
- margin-top: auto;
32
- `;
33
- export const SSICardViewContentIssueNameContainerStyled = styled.div `
34
- padding: 2px 9px 2px 12px;
35
- `;
36
- export const SSICardViewContentPropertiesContainerStyled = styled(SSIFlexDirectionRowViewStyled) `
37
- justify-content: flex-start;
38
- margin: 1px 0px 1px 0px;
39
- padding: 2px 9px 4px 12px;
40
- `;
41
- export const SSICardViewFooterContainerStyled = styled(SSIFlexDirectionRowViewStyled) `
42
- margin-top: auto;
43
- backdrop-filter: blur(3px);
44
- background-color: rgba(255, 255, 255, 0.25);
45
- padding: 12px;
46
- `;
47
- export const SSICardViewCredentialTitleTextStyled = styled(SSITextH4SemiBoldLightStyled) `
48
- word-break: break-all;
49
- display: -webkit-box;
50
- -webkit-box-orient: vertical;
51
- -webkit-line-clamp: 2;
52
- overflow: hidden;
53
- `;
54
- export const SSICardViewCredentialSubtitleTextStyled = styled(SSITextH5LightStyled) `
55
- text-align: right;
56
- `;
57
- export const SSICardViewSSICredentialStatusStyled = styled.div `
58
- margin-left: auto;
59
- `;
@@ -1,2 +0,0 @@
1
- export declare const SSIMiniCardViewContainerStyled: import("styled-components").StyledComponent<"div", any, {}, never>;
2
- export declare const SSIMiniCardViewBackgroundImageStyled: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -1,14 +0,0 @@
1
- import styled from 'styled-components';
2
- import { SSIFlexDirectionColumnViewStyled } from "../../containers";
3
- export const SSIMiniCardViewContainerStyled = styled.div `
4
- width: 75px;
5
- height: 50px;
6
- border-radius: 4.6px;
7
- overflow: hidden;
8
- display: flex;
9
- `;
10
- export const SSIMiniCardViewBackgroundImageStyled = styled(SSIFlexDirectionColumnViewStyled) `
11
- flex-grow: 1;
12
- align-items: center;
13
- justify-content: center;
14
- `;