@sphereon/ui-components.ssi-react 0.1.1 → 0.1.2-unstable.3

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 (45) hide show
  1. package/dist/components/assets/icons/SSIAddIcon/index.d.ts +7 -0
  2. package/dist/components/assets/icons/SSIAddIcon/index.js +6 -0
  3. package/dist/components/assets/icons/SSIArrowDownIcon/index.d.ts +8 -0
  4. package/dist/components/assets/icons/SSIArrowDownIcon/index.js +6 -0
  5. package/dist/components/assets/icons/SSIFilterIcon/index.d.ts +8 -0
  6. package/dist/components/assets/icons/SSIFilterIcon/index.js +6 -0
  7. package/dist/components/buttons/SSIIconButton/index.d.ts +9 -0
  8. package/dist/components/buttons/SSIIconButton/index.js +23 -0
  9. package/dist/components/buttons/SSIPrimaryButton/index.d.ts +9 -0
  10. package/dist/components/buttons/SSIPrimaryButton/index.js +9 -0
  11. package/dist/components/labels/SSITypeLabel/index.d.ts +7 -0
  12. package/dist/components/labels/SSITypeLabel/index.js +19 -0
  13. package/dist/components/lists/SSIDropDownList/index.d.ts +7 -0
  14. package/dist/components/lists/SSIDropDownList/index.js +11 -0
  15. package/dist/components/views/SSITabView/SSITabViewHeader/index.d.ts +8 -0
  16. package/dist/components/views/SSITabView/SSITabViewHeader/index.js +14 -0
  17. package/dist/components/views/SSITabView/index.d.ts +7 -0
  18. package/dist/components/views/SSITabView/index.js +26 -0
  19. package/dist/components/views/SSITableView/SSITableViewHeader/index.d.ts +8 -0
  20. package/dist/components/views/SSITableView/SSITableViewHeader/index.js +12 -0
  21. package/dist/components/views/SSITableView/index.d.ts +13 -0
  22. package/dist/components/views/SSITableView/index.js +74 -0
  23. package/dist/index.d.ts +13 -1
  24. package/dist/index.js +13 -1
  25. package/dist/styles/components/components/SSIDropDownList/index.d.ts +2 -0
  26. package/dist/styles/components/components/SSIDropDownList/index.js +14 -0
  27. package/dist/styles/components/components/SSIIconButton/index.d.ts +1 -0
  28. package/dist/styles/components/components/SSIIconButton/index.js +9 -0
  29. package/dist/styles/components/components/SSIPrimaryButton/index.d.ts +2 -0
  30. package/dist/styles/components/components/SSIPrimaryButton/index.js +21 -0
  31. package/dist/styles/components/components/SSITabViewHeader/index.d.ts +2 -0
  32. package/dist/styles/components/components/SSITabViewHeader/index.js +13 -0
  33. package/dist/styles/components/components/SSITableView/index.d.ts +6 -0
  34. package/dist/styles/components/components/SSITableView/index.js +36 -0
  35. package/dist/styles/components/components/SSITableViewHeader/index.d.ts +6 -0
  36. package/dist/styles/components/components/SSITableViewHeader/index.js +33 -0
  37. package/dist/styles/components/components/SSITypeLabel/index.d.ts +1 -0
  38. package/dist/styles/components/components/SSITypeLabel/index.js +11 -0
  39. package/dist/styles/components/components/index.d.ts +7 -0
  40. package/dist/styles/components/components/index.js +7 -0
  41. package/dist/types/component/index.d.ts +37 -0
  42. package/dist/types/component/index.js +16 -0
  43. package/dist/types/index.d.ts +1 -0
  44. package/dist/types/index.js +1 -0
  45. package/package.json +4 -3
@@ -0,0 +1,7 @@
1
+ import { FC } from 'react';
2
+ export interface IProps {
3
+ size?: number;
4
+ color?: string;
5
+ }
6
+ declare const SSIAddIcon: FC<IProps>;
7
+ export default SSIAddIcon;
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ const SSIAddIcon = (props) => {
3
+ const { size = 16, color = '#303030' } = props;
4
+ return (_jsx("div", { style: { width: size, aspectRatio: 1, display: 'flex' }, children: _jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { d: "M8 0.5C7.65483 0.5 7.375 0.779833 7.375 1.125V7.37503H1.125C0.779812 7.37503 0.5 7.65484 0.5 8.00003C0.5 8.34519 0.779812 8.62502 1.125 8.62502H7.375V14.875C7.375 15.2202 7.65483 15.5 8 15.5C8.34519 15.5 8.625 15.2202 8.625 14.875V8.62502H14.875C15.2202 8.62502 15.5 8.34519 15.5 8.00003C15.5 7.65484 15.2202 7.37503 14.875 7.37503H8.625V1.125C8.625 0.779833 8.34519 0.5 8 0.5Z", fill: color, fillOpacity: "0.8" }) }) }));
5
+ };
6
+ export default SSIAddIcon;
@@ -0,0 +1,8 @@
1
+ import { FC } from 'react';
2
+ export interface IProps {
3
+ width?: number;
4
+ height?: number;
5
+ color?: string;
6
+ }
7
+ declare const SSIArrowDownIcon: FC<IProps>;
8
+ export default SSIArrowDownIcon;
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ const SSIArrowDownIcon = (props) => {
3
+ const { width = 16, height = 8, color = '#303030' } = props;
4
+ return (_jsx("div", { style: { width, height, display: 'flex' }, children: _jsx("svg", { width: "16", height: "8", viewBox: "0 0 16 8", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { d: "M8.03265 7.74886C8.14951 7.74175 8.26065 7.69465 8.34825 7.61511L15.3133 1.19499C15.367 1.1489 15.411 1.09224 15.4429 1.02837C15.4747 0.964504 15.4937 0.894731 15.4987 0.823204C15.5037 0.751676 15.4946 0.67985 15.4719 0.611995C15.4493 0.54414 15.4135 0.481647 15.3668 0.428216C15.3201 0.374784 15.2634 0.331504 15.2001 0.300961C15.1367 0.270419 15.068 0.253238 14.9981 0.250423C14.9281 0.247608 14.8583 0.259221 14.7928 0.28458C14.7273 0.309939 14.6675 0.348517 14.6168 0.398032L8 6.49492L1.38317 0.398032C1.33252 0.348517 1.27268 0.309939 1.20718 0.28458C1.14169 0.259221 1.07189 0.247597 1.00193 0.250412C0.931963 0.253227 0.863266 0.270419 0.799918 0.300961C0.736569 0.331504 0.679861 0.374784 0.633164 0.428216C0.586466 0.481647 0.550732 0.54414 0.528085 0.611995C0.505437 0.67985 0.496338 0.751676 0.501329 0.823204C0.506319 0.894731 0.525297 0.964504 0.557135 1.02837C0.588973 1.09224 0.633022 1.1489 0.686663 1.19499L7.65174 7.61511C7.70344 7.6621 7.76372 7.69811 7.82911 7.72107C7.89449 7.74403 7.96367 7.75348 8.03265 7.74886Z", fill: color, fillOpacity: "0.8" }) }) }));
5
+ };
6
+ export default SSIArrowDownIcon;
@@ -0,0 +1,8 @@
1
+ import { FC } from 'react';
2
+ export interface IProps {
3
+ width?: number;
4
+ height?: number;
5
+ color?: string;
6
+ }
7
+ declare const SSIFilterIcon: FC<IProps>;
8
+ export default SSIFilterIcon;
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ const SSIFilterIcon = (props) => {
3
+ const { height = 16, width = 18, color = '#303030' } = props;
4
+ return (_jsx("div", { style: { width, height, display: 'flex' }, children: _jsx("svg", { width: "18", height: "16", viewBox: "0 0 18 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { d: "M16.5 1.5H1.5L7.5 8.33222V13.0556L10.5 14.5V8.33222L16.5 1.5Z", stroke: color, strokeOpacity: "0.8", strokeWidth: "1.29412", strokeLinecap: "round", strokeLinejoin: "round" }) }) }));
5
+ };
6
+ export default SSIFilterIcon;
@@ -0,0 +1,9 @@
1
+ import { FC } from 'react';
2
+ import { ButtonIconsEnum } from '../../../types';
3
+ export type Props = {
4
+ icon: ButtonIconsEnum;
5
+ disabled?: boolean;
6
+ onClick: () => Promise<void>;
7
+ };
8
+ declare const SSIIconButton: FC<Props>;
9
+ export default SSIIconButton;
@@ -0,0 +1,23 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import SSIAddIcon from '../../assets/icons/SSIAddIcon';
3
+ import SSIFilterIcon from '../../assets/icons/SSIFilterIcon';
4
+ import SSIArrowDownIcon from '../../assets/icons/SSIArrowDownIcon';
5
+ import { ButtonIconsEnum } from '../../../types';
6
+ import { SSIIconButtonContainerStyled as Container } from '../../../styles/components';
7
+ const SSIIconButton = (props) => {
8
+ const { icon, onClick, disabled = false } = props;
9
+ return _jsx(Container, { onClick: onClick, children: getIcon(icon) });
10
+ };
11
+ const getIcon = (icon) => {
12
+ switch (icon) {
13
+ case ButtonIconsEnum.ADD:
14
+ return _jsx(SSIAddIcon, {});
15
+ case ButtonIconsEnum.FILTER:
16
+ return _jsx(SSIFilterIcon, {});
17
+ case ButtonIconsEnum.ARROW_DOWN:
18
+ return _jsx(SSIArrowDownIcon, {});
19
+ default:
20
+ return _jsx("div", {});
21
+ }
22
+ };
23
+ export default SSIIconButton;
@@ -0,0 +1,9 @@
1
+ import { FC } from 'react';
2
+ export type Props = {
3
+ caption: string;
4
+ onClick: () => Promise<void>;
5
+ icon?: string;
6
+ disabled?: boolean;
7
+ };
8
+ declare const SSIPrimaryButton: FC<Props>;
9
+ export default SSIPrimaryButton;
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { fontColors } from '@sphereon/ui-components.core';
3
+ import SSIAddIcon from '../../assets/icons/SSIAddIcon';
4
+ import { SSIPrimaryButtonContainerStyled as Container, SSIPrimaryButtonCaptionStyled as Caption } from '../../../styles/components';
5
+ const SSIPrimaryButton = (props) => {
6
+ const { caption, icon, onClick } = props;
7
+ return (_jsxs(Container, { onClick: onClick, children: [icon && _jsx(SSIAddIcon, { color: fontColors.light }), _jsx(Caption, { children: caption })] }));
8
+ };
9
+ export default SSIPrimaryButton;
@@ -0,0 +1,7 @@
1
+ import { FC } from 'react';
2
+ import { LabelTypeEnum } from '../../../types';
3
+ export type Props = {
4
+ type: LabelTypeEnum;
5
+ };
6
+ declare const SSITypeLabel: FC<Props>;
7
+ export default SSITypeLabel;
@@ -0,0 +1,19 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { LabelTypeEnum } from '../../../types';
3
+ import { SSITypeLabelContainerStyled as Container } from '../../../styles/components';
4
+ import { backgroundColors, gradientColors } from "@sphereon/ui-components.core";
5
+ const getBackground = (type) => {
6
+ switch (type) {
7
+ case LabelTypeEnum.ISSUER:
8
+ return gradientColors['200'];
9
+ case LabelTypeEnum.VERIFIER:
10
+ return gradientColors['100'];
11
+ default:
12
+ return backgroundColors.primaryLight;
13
+ }
14
+ };
15
+ const SSITypeLabel = (props) => {
16
+ const { type } = props;
17
+ return _jsx(Container, { style: { background: getBackground(type) }, children: type });
18
+ };
19
+ export default SSITypeLabel;
@@ -0,0 +1,7 @@
1
+ import { FC } from 'react';
2
+ export type Props = {
3
+ initialValue: string;
4
+ label?: string;
5
+ };
6
+ declare const SSIDropDownList: FC<Props>;
7
+ export default SSIDropDownList;
@@ -0,0 +1,11 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import React from 'react';
3
+ import SSIIconButton from '../../buttons/SSIIconButton';
4
+ import { ButtonIconsEnum } from '../../../types';
5
+ import { SSIDropDownListContainerStyled as Container, SSIDropDownListSelectedValueStyled as SelectedValue } from '../../../styles/components';
6
+ const SSIDropDownList = (props) => {
7
+ const { initialValue, label } = props;
8
+ const [value, setValue] = React.useState(initialValue);
9
+ return (_jsxs(Container, { children: [label && _jsx("span", { children: label }), _jsx(SelectedValue, { children: value }), _jsx(SSIIconButton, { icon: ButtonIconsEnum.ARROW_DOWN, onClick: async () => console.log('drop down clicked') })] }));
10
+ };
11
+ export default SSIDropDownList;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { TabNavigationState } from '../../../../types';
3
+ export type Props = {
4
+ navigationState: TabNavigationState;
5
+ onIndexChange: (index: number) => void;
6
+ };
7
+ declare const SSITabViewHeader: React.FC<Props>;
8
+ export default SSITabViewHeader;
@@ -0,0 +1,14 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { SSITabViewHeaderContainerStyled as Container, SSITabViewHeaderTitleContainerStyled as TitleContainer, } from "../../../../styles/components";
3
+ const SSITabViewHeader = (props) => {
4
+ const { navigationState, onIndexChange } = props;
5
+ return (_jsx(Container, { children: navigationState.routes.map((value, index) => {
6
+ const tabIndex = index + 1;
7
+ const isActiveTab = tabIndex === navigationState.index;
8
+ return (_jsx(TitleContainer, { style: {
9
+ fontWeight: !isActiveTab ? '400' : '600',
10
+ ...(isActiveTab && { borderBottom: '2px solid #7276F7', alignSelf: 'stretch' }),
11
+ }, onClick: () => onIndexChange(tabIndex), children: value.title }, tabIndex));
12
+ }) }));
13
+ };
14
+ export default SSITabViewHeader;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import { TabViewRoute } from '../../../types';
3
+ export type Props = {
4
+ routes: Array<TabViewRoute>;
5
+ };
6
+ declare const SSITabView: React.FC<Props>;
7
+ export default SSITabView;
@@ -0,0 +1,26 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import React from 'react';
3
+ import SSITabViewHeader from './SSITabViewHeader';
4
+ const Tab = (props) => {
5
+ return _jsx(React.Fragment, { children: props.children });
6
+ };
7
+ const SSITabView = (props) => {
8
+ const { routes = [] } = props;
9
+ const [activeTabIndex, setActiveTabIndex] = React.useState(1);
10
+ const [content, setContent] = React.useState();
11
+ React.useEffect(() => {
12
+ routes.forEach((route, index) => {
13
+ if (index + 1 === activeTabIndex) {
14
+ setContent(route.content);
15
+ }
16
+ });
17
+ }, [routes, activeTabIndex]);
18
+ const onTabChange = async (tabIndex) => {
19
+ setActiveTabIndex(tabIndex);
20
+ };
21
+ return (_jsxs("div", { children: [_jsx(SSITabViewHeader, { navigationState: {
22
+ routes: routes,
23
+ index: activeTabIndex,
24
+ }, onIndexChange: onTabChange }), _jsx(Tab, { children: content })] }));
25
+ };
26
+ export default SSITabView;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { Button } from '../../../../types';
3
+ export type Props = {
4
+ enableFiltering?: boolean;
5
+ actions?: Array<Button>;
6
+ };
7
+ declare const SSITableViewHeader: React.FC<Props>;
8
+ export default SSITableViewHeader;
@@ -0,0 +1,12 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Localization } from '@sphereon/ui-components.core';
3
+ import SSIIconButton from '../../../buttons/SSIIconButton';
4
+ import { ButtonIconsEnum } from '../../../../types';
5
+ import SSIDropDownList from '../../../lists/SSIDropDownList';
6
+ import SSIPrimaryButton from '../../../buttons/SSIPrimaryButton';
7
+ import { SSITableViewHeaderActionsContainerStyled as ActionsContainer, SSITableViewHeaderContainerStyled as Container, SSITableViewHeaderContentContainerStyled as ContentContainer, SSITableViewHeaderFilterCaptionStyled as FilterCaption, SSITableViewHeaderFilterContainerStyled as FilterContainer, SSITableViewHeaderShowOptionContainerStyled as ShowOptionContainer, } from '../../../../styles/components';
8
+ const SSITableViewHeader = (props) => {
9
+ const { enableFiltering = false, actions = [] } = props;
10
+ return (_jsx(Container, { children: _jsx(ContentContainer, { children: _jsxs(ActionsContainer, { children: [enableFiltering && (_jsxs(FilterContainer, { children: [_jsx(SSIIconButton, { icon: ButtonIconsEnum.FILTER, onClick: async () => console.log('add filter clicked') }), _jsx(FilterCaption, { children: Localization.translate('action_filter_caption') })] })), _jsx(ShowOptionContainer, { children: _jsx(SSIDropDownList, { label: Localization.translate('action_show_caption'), initialValue: 'Most recent' }) }), actions.map((action, index) => (_jsx(SSIPrimaryButton, { caption: action.caption, onClick: action.onClick, icon: action.icon }, index)))] }) }) }));
11
+ };
12
+ export default SSITableViewHeader;
@@ -0,0 +1,13 @@
1
+ import { ReactElement } from 'react';
2
+ import { ColumnResizeMode } from '@tanstack/react-table';
3
+ import { Button, ColumnHeader } from '../../../types';
4
+ export type Props<T> = {
5
+ data: Array<T>;
6
+ columns: Array<ColumnHeader<T>>;
7
+ enableRowSelection?: boolean;
8
+ enableFiltering?: boolean;
9
+ columnResizeMode?: ColumnResizeMode;
10
+ actions?: Array<Button>;
11
+ };
12
+ declare const SSITableView: <T extends {}>(props: Props<T>) => ReactElement;
13
+ export default SSITableView;
@@ -0,0 +1,74 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import React from 'react';
3
+ import { createColumnHelper, flexRender, getCoreRowModel, useReactTable, } from '@tanstack/react-table';
4
+ import { TableCellTypeEnum } from '../../../types';
5
+ import SSITableViewHeader from './SSITableViewHeader';
6
+ import SSITypeLabel from '../../labels/SSITypeLabel';
7
+ import { SSITableViewCellContainerStyled, SSITableViewContainerStyled, SSITableViewHeaderCellContainerStyled, SSITableViewLabelCellStyled, SSITableViewRowContainerStyled, SSITableViewTableContainerStyled } from "../../../styles/components";
8
+ function IndeterminateCheckbox({ indeterminate, className = '', ...rest }) {
9
+ const ref = React.useRef(null);
10
+ React.useEffect(() => {
11
+ if (typeof indeterminate === 'boolean') {
12
+ ref.current.indeterminate = !rest.checked && indeterminate;
13
+ }
14
+ }, [ref, indeterminate]);
15
+ return _jsx("input", { type: "checkbox", ref: ref, className: className + ' cursor-pointer', ...rest });
16
+ }
17
+ const getCellFormatting = (type, value) => {
18
+ switch (type) {
19
+ case TableCellTypeEnum.TEXT:
20
+ return _jsx("p", { children: value });
21
+ case TableCellTypeEnum.LABEL: {
22
+ const labels = Array.isArray(value) ? value.map((label) => _jsx(SSITypeLabel, { type: label })) : _jsx(SSITypeLabel, { type: value });
23
+ return _jsx(SSITableViewLabelCellStyled, { children: labels });
24
+ }
25
+ default:
26
+ return _jsx("div", {});
27
+ }
28
+ };
29
+ const SSITableView = (props) => {
30
+ const { columns, data, enableRowSelection = false, enableFiltering = false, columnResizeMode = 'onChange', actions = [] } = props;
31
+ const [rowSelection, setRowSelection] = React.useState({});
32
+ const columnHelper = createColumnHelper();
33
+ let availableColumns = columns.map((header) => columnHelper.accessor(header.accessor, {
34
+ id: header.accessor,
35
+ header: header.label,
36
+ cell: (info) => getCellFormatting(header.type, info.getValue()),
37
+ }));
38
+ if (enableRowSelection) {
39
+ availableColumns = [
40
+ {
41
+ id: 'select',
42
+ header: ({ table }) => (_jsx(IndeterminateCheckbox, { ...{
43
+ checked: table.getIsAllRowsSelected(),
44
+ indeterminate: table.getIsSomeRowsSelected(),
45
+ onChange: table.getToggleAllRowsSelectedHandler(),
46
+ } })),
47
+ cell: ({ row }) => (_jsx("div", { className: "px-1", children: _jsx(IndeterminateCheckbox, { ...{
48
+ checked: row.getIsSelected(),
49
+ disabled: !row.getCanSelect(),
50
+ indeterminate: row.getIsSomeSelected(),
51
+ onChange: row.getToggleSelectedHandler(),
52
+ } }) })),
53
+ },
54
+ ...availableColumns,
55
+ ];
56
+ }
57
+ const table = useReactTable({
58
+ state: {
59
+ rowSelection,
60
+ },
61
+ enableRowSelection,
62
+ onRowSelectionChange: setRowSelection,
63
+ data,
64
+ columns: availableColumns,
65
+ columnResizeMode,
66
+ getCoreRowModel: getCoreRowModel(),
67
+ });
68
+ return (_jsx(SSITableViewContainerStyled, { children: _jsxs("div", { className: "overflow-x-auto", children: [_jsx(SSITableViewHeader, { actions: actions, enableFiltering: enableFiltering }), _jsxs(SSITableViewTableContainerStyled, { style: { width: table.getCenterTotalSize() }, children: [_jsx("thead", { children: table.getHeaderGroups().map((headerGroup) => (_jsx(SSITableViewRowContainerStyled, { children: headerGroup.headers.map((header) => (_jsxs(SSITableViewHeaderCellContainerStyled, { colSpan: header.colSpan, style: { width: header.getSize() }, children: [header.isPlaceholder ? null : flexRender(header.column.columnDef.header, header.getContext()), _jsx("div", { className: `resizer ${header.column.getIsResizing() ? 'isResizing' : ''}`, onMouseDown: header.getResizeHandler(), onTouchStart: header.getResizeHandler(), style: {
69
+ transform: columnResizeMode === 'onEnd' && header.column.getIsResizing()
70
+ ? `translateX(${table.getState().columnSizingInfo.deltaOffset}px)`
71
+ : '',
72
+ } })] }, header.id))) }, headerGroup.id))) }), _jsx("tbody", { children: table.getRowModel().rows.map((row) => (_jsx(SSITableViewRowContainerStyled, { children: row.getVisibleCells().map((cell) => (_jsx(SSITableViewCellContainerStyled, { style: { width: cell.column.getSize() }, children: flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id))) }, row.id))) })] })] }) }));
73
+ };
74
+ export default SSITableView;
package/dist/index.d.ts CHANGED
@@ -4,4 +4,16 @@ import SSICheckmarkBadge from './components/assets/badges/SSICheckmarkBadge';
4
4
  import SSIExclamationMarkBadge from './components/assets/badges/SSIExclamationMarkBadge';
5
5
  import SSIPlaceholderLogo from './components/assets/logos/SSIPlaceholderLogo';
6
6
  import SSILogo from './components/assets/logos/SSILogo';
7
- export { SSICardView, SSIStatusLabel, SSICheckmarkBadge, SSIExclamationMarkBadge, SSIPlaceholderLogo, SSILogo };
7
+ import SSIAddIcon from './components/assets/icons/SSIAddIcon';
8
+ import SSIFilterIcon from './components/assets/icons/SSIFilterIcon';
9
+ import SSIArrowDownIcon from './components/assets/icons/SSIArrowDownIcon';
10
+ import SSITypeLabel from './components/labels/SSITypeLabel';
11
+ import SSIIconButton from './components/buttons/SSIIconButton';
12
+ import SSIPrimaryButton from './components/buttons/SSIPrimaryButton';
13
+ import SSIDropDownList from './components/lists/SSIDropDownList';
14
+ import SSITableView from './components/views/SSITableView';
15
+ import SSITableViewHeader from './components/views/SSITableView/SSITableViewHeader';
16
+ import SSITabView from './components/views/SSITabView';
17
+ import SSITabViewHeader from './components/views/SSITabView/SSITabViewHeader';
18
+ export * from './types';
19
+ export { SSICardView, SSIStatusLabel, SSICheckmarkBadge, SSIExclamationMarkBadge, SSIPlaceholderLogo, SSILogo, SSIAddIcon, SSIFilterIcon, SSIArrowDownIcon, SSITypeLabel, SSIIconButton, SSIPrimaryButton, SSIDropDownList, SSITableView, SSITableViewHeader, SSITabView, SSITabViewHeader };
package/dist/index.js CHANGED
@@ -4,4 +4,16 @@ import SSICheckmarkBadge from './components/assets/badges/SSICheckmarkBadge';
4
4
  import SSIExclamationMarkBadge from './components/assets/badges/SSIExclamationMarkBadge';
5
5
  import SSIPlaceholderLogo from './components/assets/logos/SSIPlaceholderLogo';
6
6
  import SSILogo from './components/assets/logos/SSILogo';
7
- export { SSICardView, SSIStatusLabel, SSICheckmarkBadge, SSIExclamationMarkBadge, SSIPlaceholderLogo, SSILogo };
7
+ import SSIAddIcon from './components/assets/icons/SSIAddIcon';
8
+ import SSIFilterIcon from './components/assets/icons/SSIFilterIcon';
9
+ import SSIArrowDownIcon from './components/assets/icons/SSIArrowDownIcon';
10
+ import SSITypeLabel from './components/labels/SSITypeLabel';
11
+ import SSIIconButton from './components/buttons/SSIIconButton';
12
+ import SSIPrimaryButton from './components/buttons/SSIPrimaryButton';
13
+ import SSIDropDownList from './components/lists/SSIDropDownList';
14
+ import SSITableView from './components/views/SSITableView';
15
+ import SSITableViewHeader from './components/views/SSITableView/SSITableViewHeader';
16
+ import SSITabView from './components/views/SSITabView';
17
+ import SSITabViewHeader from './components/views/SSITabView/SSITabViewHeader';
18
+ export * from './types';
19
+ export { SSICardView, SSIStatusLabel, SSICheckmarkBadge, SSIExclamationMarkBadge, SSIPlaceholderLogo, SSILogo, SSIAddIcon, SSIFilterIcon, SSIArrowDownIcon, SSITypeLabel, SSIIconButton, SSIPrimaryButton, SSIDropDownList, SSITableView, SSITableViewHeader, SSITabView, SSITabViewHeader };
@@ -0,0 +1,2 @@
1
+ export declare const SSIDropDownListContainerStyled: import("styled-components").StyledComponent<"div", any, {}, never>;
2
+ export declare const SSIDropDownListSelectedValueStyled: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -0,0 +1,14 @@
1
+ import styled from 'styled-components';
2
+ import { SSIFlexDirectionRowViewStyled } from '../../containers';
3
+ import { gradientColors } from "@sphereon/ui-components.core";
4
+ export const SSIDropDownListContainerStyled = styled(SSIFlexDirectionRowViewStyled) `
5
+ text-align: left;
6
+ align-items: center;
7
+ gap: 2px;
8
+ `;
9
+ export const SSIDropDownListSelectedValueStyled = styled.div `
10
+ background: ${gradientColors["100"]};
11
+ background-clip: text;
12
+ -webkit-background-clip: text;
13
+ -webkit-text-fill-color: transparent;
14
+ `;
@@ -0,0 +1 @@
1
+ export declare const SSIIconButtonContainerStyled: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -0,0 +1,9 @@
1
+ import styled from 'styled-components';
2
+ export const SSIIconButtonContainerStyled = styled.div `
3
+ width: 32px;
4
+ aspect-ratio: 1;
5
+ display: flex;
6
+ justify-content: center;
7
+ align-items: center;
8
+ cursor: pointer;
9
+ `;
@@ -0,0 +1,2 @@
1
+ export declare const SSIPrimaryButtonContainerStyled: import("styled-components").StyledComponent<"div", any, {}, never>;
2
+ export declare const SSIPrimaryButtonCaptionStyled: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -0,0 +1,21 @@
1
+ import styled from 'styled-components';
2
+ import { SSIRoundedContainerStyled } from '../../containers';
3
+ import { fontColors, gradientColors } from "@sphereon/ui-components.core";
4
+ export const SSIPrimaryButtonContainerStyled = styled(SSIRoundedContainerStyled) `
5
+ height: 32px;
6
+ background: ${gradientColors["100"]};
7
+ display: flex;
8
+ flex-direction: row;
9
+ justify-content: center;
10
+ align-items: center;
11
+ gap: 8px;
12
+ padding-left: 8px;
13
+ padding-right: 8px;
14
+ color: ${fontColors.light};
15
+ cursor: pointer;
16
+ `;
17
+ export const SSIPrimaryButtonCaptionStyled = styled.div `
18
+ font-style: normal;
19
+ font-size: 14px;
20
+ font-weight: 400;
21
+ `;
@@ -0,0 +1,2 @@
1
+ export declare const SSITabViewHeaderContainerStyled: import("styled-components").StyledComponent<"div", any, {}, never>;
2
+ export declare const SSITabViewHeaderTitleContainerStyled: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -0,0 +1,13 @@
1
+ import styled from 'styled-components';
2
+ import { fontColors } from "@sphereon/ui-components.core";
3
+ export const SSITabViewHeaderContainerStyled = styled.div `
4
+ display: flex;
5
+ flex-direction: row;
6
+ gap: 84px;
7
+ margin-left: 66px;
8
+ `;
9
+ export const SSITabViewHeaderTitleContainerStyled = styled.div `
10
+ font-size: 16px;
11
+ color: ${fontColors.dark};
12
+ cursor: pointer;
13
+ `;
@@ -0,0 +1,6 @@
1
+ export declare const SSITableViewContainerStyled: import("styled-components").StyledComponent<"div", any, {}, never>;
2
+ export declare const SSITableViewLabelCellStyled: import("styled-components").StyledComponent<"div", any, {}, never>;
3
+ export declare const SSITableViewTableContainerStyled: import("styled-components").StyledComponent<"table", any, {}, never>;
4
+ export declare const SSITableViewRowContainerStyled: import("styled-components").StyledComponent<"tr", any, {}, never>;
5
+ export declare const SSITableViewCellContainerStyled: import("styled-components").StyledComponent<"td", any, {}, never>;
6
+ export declare const SSITableViewHeaderCellContainerStyled: import("styled-components").StyledComponent<"th", any, {}, never>;
@@ -0,0 +1,36 @@
1
+ import styled from 'styled-components';
2
+ import { backgroundColors, borderColors, fontColors } from "@sphereon/ui-components.core";
3
+ export const SSITableViewContainerStyled = styled.div `
4
+ background-color: ${backgroundColors.lightGrey};
5
+ display: flex;
6
+ flex-grow: 1;
7
+ flex-direction: column
8
+ `;
9
+ export const SSITableViewLabelCellStyled = styled.div `
10
+ display: flex;
11
+ flex-direction: row;
12
+ gap: 10px;
13
+ `;
14
+ export const SSITableViewTableContainerStyled = styled.table `
15
+ user-select: text;
16
+ width: fit-content;
17
+ border-collapse: collapse;
18
+ `;
19
+ export const SSITableViewRowContainerStyled = styled.tr `
20
+ border-bottom: 1px solid ${borderColors.lightGrey};
21
+ `;
22
+ export const SSITableViewCellContainerStyled = styled.td `
23
+ color: ${fontColors.dark};
24
+ background-color: ${backgroundColors.primaryLight};
25
+ padding: 20px 16px 20px 16px;
26
+ text-align: left;
27
+ `;
28
+ export const SSITableViewHeaderCellContainerStyled = styled.th `
29
+ position: relative;
30
+ padding: 20px 16px 20px 16px;
31
+ font-style: normal;
32
+ font-weight: 500;
33
+ line-height: normal;
34
+ background-color: ${backgroundColors.primaryLight};
35
+ color: ${fontColors.lightGrey};
36
+ `;
@@ -0,0 +1,6 @@
1
+ export declare const SSITableViewHeaderContainerStyled: import("styled-components").StyledComponent<"div", any, {}, never>;
2
+ export declare const SSITableViewHeaderContentContainerStyled: import("styled-components").StyledComponent<"div", any, {}, never>;
3
+ export declare const SSITableViewHeaderActionsContainerStyled: import("styled-components").StyledComponent<"div", any, {}, never>;
4
+ export declare const SSITableViewHeaderFilterContainerStyled: import("styled-components").StyledComponent<"div", any, {}, never>;
5
+ export declare const SSITableViewHeaderFilterCaptionStyled: import("styled-components").StyledComponent<"div", any, {}, never>;
6
+ export declare const SSITableViewHeaderShowOptionContainerStyled: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -0,0 +1,33 @@
1
+ import styled from 'styled-components';
2
+ import { SSIFlexDirectionRowViewStyled } from '../../containers';
3
+ import { backgroundColors, fontColors } from "@sphereon/ui-components.core";
4
+ export const SSITableViewHeaderContainerStyled = styled.div `
5
+ background-color: ${backgroundColors.primaryLight};
6
+ display: flex;
7
+ `;
8
+ export const SSITableViewHeaderContentContainerStyled = styled.div `
9
+ height: 48px;
10
+ margin-left: auto;
11
+ display: flex;
12
+ justify-content: center;
13
+ align-items: center;
14
+ margin-right: 24px;
15
+ `;
16
+ export const SSITableViewHeaderActionsContainerStyled = styled(SSIFlexDirectionRowViewStyled) `
17
+ height: 32px;
18
+ gap: 50px;
19
+ `;
20
+ export const SSITableViewHeaderFilterContainerStyled = styled(SSIFlexDirectionRowViewStyled) `
21
+ height: 32px;
22
+ align-items: center;
23
+ gap: 8px;
24
+ `;
25
+ export const SSITableViewHeaderFilterCaptionStyled = styled.div `
26
+ color: ${fontColors.dark};
27
+ `;
28
+ export const SSITableViewHeaderShowOptionContainerStyled = styled.div `
29
+ height: 32px;
30
+ display: flex;
31
+ text-align: left;
32
+ align-items: center;
33
+ `;
@@ -0,0 +1 @@
1
+ export declare const SSITypeLabelContainerStyled: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -0,0 +1,11 @@
1
+ import styled from 'styled-components';
2
+ import { SSIRoundedContainerStyled } from '../../containers';
3
+ import { fontColors } from "@sphereon/ui-components.core";
4
+ export const SSITypeLabelContainerStyled = styled(SSIRoundedContainerStyled) `
5
+ display: flex;
6
+ padding: 1px 12px;
7
+ justify-content: center;
8
+ align-items: center;
9
+ color: ${fontColors.light};
10
+ user-select: none;
11
+ `;
@@ -1,2 +1,9 @@
1
1
  export * from './SSICardView';
2
2
  export * from './SSIStatusLabel';
3
+ export * from './SSIPrimaryButton';
4
+ export * from './SSIIconButton';
5
+ export * from './SSIDropDownList';
6
+ export * from './SSITypeLabel';
7
+ export * from './SSITableViewHeader';
8
+ export * from './SSITableView';
9
+ export * from './SSITabViewHeader';
@@ -1,2 +1,9 @@
1
1
  export * from './SSICardView';
2
2
  export * from './SSIStatusLabel';
3
+ export * from './SSIPrimaryButton';
4
+ export * from './SSIIconButton';
5
+ export * from './SSIDropDownList';
6
+ export * from './SSITypeLabel';
7
+ export * from './SSITableViewHeader';
8
+ export * from './SSITableView';
9
+ export * from './SSITabViewHeader';
@@ -0,0 +1,37 @@
1
+ import { ComponentType } from 'react';
2
+ import { AccessorFn, DeepKeys } from '@tanstack/react-table';
3
+ export type TabRoute = {
4
+ key: string;
5
+ title: string;
6
+ };
7
+ export type TabViewRoute = TabRoute & {
8
+ content: ComponentType<unknown>;
9
+ };
10
+ export type TabNavigationState = {
11
+ index: number;
12
+ routes: Array<TabViewRoute>;
13
+ };
14
+ export declare enum ButtonIconsEnum {
15
+ ADD = "add",
16
+ ARROW_DOWN = "arrowDown",
17
+ FILTER = "filter"
18
+ }
19
+ export type ColumnHeader<T> = {
20
+ accessor: AccessorFn<T> | DeepKeys<T>;
21
+ type: TableCellTypeEnum;
22
+ label?: string;
23
+ };
24
+ export type Button = {
25
+ caption: string;
26
+ onClick: () => Promise<void>;
27
+ icon?: string;
28
+ disabled?: boolean;
29
+ };
30
+ export declare enum LabelTypeEnum {
31
+ ISSUER = "Issuer",
32
+ VERIFIER = "Verifier"
33
+ }
34
+ export declare enum TableCellTypeEnum {
35
+ TEXT = "text",
36
+ LABEL = "label"
37
+ }
@@ -0,0 +1,16 @@
1
+ export var ButtonIconsEnum;
2
+ (function (ButtonIconsEnum) {
3
+ ButtonIconsEnum["ADD"] = "add";
4
+ ButtonIconsEnum["ARROW_DOWN"] = "arrowDown";
5
+ ButtonIconsEnum["FILTER"] = "filter";
6
+ })(ButtonIconsEnum || (ButtonIconsEnum = {}));
7
+ export var LabelTypeEnum;
8
+ (function (LabelTypeEnum) {
9
+ LabelTypeEnum["ISSUER"] = "Issuer";
10
+ LabelTypeEnum["VERIFIER"] = "Verifier";
11
+ })(LabelTypeEnum || (LabelTypeEnum = {}));
12
+ export var TableCellTypeEnum;
13
+ (function (TableCellTypeEnum) {
14
+ TableCellTypeEnum["TEXT"] = "text";
15
+ TableCellTypeEnum["LABEL"] = "label";
16
+ })(TableCellTypeEnum || (TableCellTypeEnum = {}));
@@ -0,0 +1 @@
1
+ export * from './component';
@@ -0,0 +1 @@
1
+ export * from './component';
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.1",
4
+ "version": "0.1.2-unstable.3+01ddfd7",
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,8 @@
28
28
  "access": "public"
29
29
  },
30
30
  "dependencies": {
31
- "@sphereon/ui-components.core": "0.1.1",
31
+ "@sphereon/ui-components.core": "0.1.2-unstable.3+01ddfd7",
32
+ "@tanstack/react-table": "^8.9.3",
32
33
  "styled-components": "^5.3.3"
33
34
  },
34
35
  "devDependencies": {
@@ -39,5 +40,5 @@
39
40
  "peerDependencies": {
40
41
  "react": ">= 16.8.0"
41
42
  },
42
- "gitHead": "067169b933897f36b96709293be6163ee21c317b"
43
+ "gitHead": "01ddfd71cbcbff20139ed6ee0510384ba1b45a51"
43
44
  }