@sphereon/ui-components.ssi-react 0.1.3-unstable.103 → 0.1.3-unstable.106

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 (34) hide show
  1. package/dist/components/assets/icons/DeleteIcon/index.d.ts +2 -1
  2. package/dist/components/assets/icons/DeleteIcon/index.js +2 -2
  3. package/dist/components/assets/icons/MeatBallsIcon/index.d.ts +9 -0
  4. package/dist/components/assets/icons/MeatBallsIcon/index.js +7 -0
  5. package/dist/components/buttons/SSIIconButton/index.js +3 -3
  6. package/dist/components/lists/DropDownList/index.d.ts +14 -0
  7. package/dist/components/lists/DropDownList/index.js +33 -0
  8. package/dist/components/lists/DropDownListItem/index.d.ts +18 -0
  9. package/dist/components/lists/DropDownListItem/index.js +22 -0
  10. package/dist/components/views/SSITableView/SSITableViewHeader/index.js +2 -3
  11. package/dist/components/views/SSITableView/index.d.ts +1 -2
  12. package/dist/components/views/SSITableView/index.js +11 -15
  13. package/dist/index.d.ts +2 -2
  14. package/dist/index.js +2 -2
  15. package/dist/styles/components/components/{SSIDropDownList → DropDownList}/index.d.ts +2 -0
  16. package/dist/styles/components/components/{SSIDropDownList → DropDownList}/index.js +15 -0
  17. package/dist/styles/components/components/DropDownListItem/index.d.ts +3 -0
  18. package/dist/styles/components/components/DropDownListItem/index.js +22 -0
  19. package/dist/styles/components/components/buttons/index.d.ts +1 -0
  20. package/dist/styles/components/components/buttons/index.js +4 -0
  21. package/dist/styles/components/components/index.d.ts +3 -2
  22. package/dist/styles/components/components/index.js +3 -2
  23. package/dist/types/button/index.d.ts +3 -0
  24. package/dist/types/table/index.d.ts +10 -6
  25. package/dist/types/table/index.js +1 -0
  26. package/package.json +3 -3
  27. package/dist/components/assets/icons/BitterballenIcon/index.d.ts +0 -8
  28. package/dist/components/assets/icons/BitterballenIcon/index.js +0 -7
  29. package/dist/components/buttons/RowActionMenuButton/index.d.ts +0 -13
  30. package/dist/components/buttons/RowActionMenuButton/index.js +0 -34
  31. package/dist/components/lists/SSIDropDownList/index.d.ts +0 -7
  32. package/dist/components/lists/SSIDropDownList/index.js +0 -11
  33. package/dist/styles/components/components/RowActionMenuButton/index.d.ts +0 -4
  34. package/dist/styles/components/components/RowActionMenuButton/index.js +0 -29
@@ -1,6 +1,7 @@
1
1
  import { CSSProperties, FC } from 'react';
2
2
  type Props = {
3
- size?: number;
3
+ width?: number;
4
+ height?: number;
4
5
  color?: string;
5
6
  style?: CSSProperties;
6
7
  };
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { fontColors } from '@sphereon/ui-components.core';
3
3
  const DeleteIcon = (props) => {
4
- const { size = 21, color = fontColors.dark, style } = props;
5
- return (_jsx("div", { style: { ...style, width: size, aspectRatio: 1, display: 'flex' }, children: _jsx("svg", { width: "32", height: "32", viewBox: "0 0 32 32", fill: color, xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { d: "M24.8277 8.98905V24.6058C24.8277 26.4672 23.3113 28 21.4699 28H10.5336C8.68863 28 7.1722 26.4672 7.1722 24.6058V8.98905H5.97712C4.9409 8.98905 4.9409 7.39781 5.97712 7.39781H12.1114V5.87226C12.1114 4.87591 12.8841 4 13.8914 4H18.1121C19.1158 4 19.8921 4.87956 19.8921 5.87226V7.39781H26.0228C27.059 7.39781 27.059 8.98905 26.0228 8.98905H24.8277ZM13.6856 7.39781H18.3143V5.87226C18.3143 5.75547 18.2457 5.59124 18.1121 5.59124H13.8914C13.7542 5.59124 13.6856 5.75547 13.6856 5.87226V7.39781ZM19.43 21.9635C19.43 23.0073 17.8558 23.0073 17.8558 21.9635V13.2993C17.8558 12.2555 19.43 12.2555 19.43 13.2993V21.9635ZM14.1441 21.9635C14.1441 23.0073 12.5699 23.0073 12.5699 21.9635V13.2993C12.5699 12.2555 14.1441 12.2518 14.1441 13.2993V21.9635ZM23.2535 8.98905C18.419 8.98905 13.5845 8.98905 8.75001 8.98905V24.6058C8.75001 25.5985 9.54793 26.4088 10.5336 26.4088H21.4699C22.452 26.4088 23.2535 25.5985 23.2535 24.6058V8.98905Z", fill: "#D74500" }) }) }));
4
+ const { width = 19, height = 21, color = fontColors.light, style = {} } = props;
5
+ return (_jsx("div", { style: { ...style, width, height, display: 'flex' }, children: _jsx("svg", { width: "20", height: "21", viewBox: "0 0 20 21", fill: color, xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { d: "M17.3126 4.36542V18.0301C17.3126 19.6588 15.975 21 14.3509 21H4.70454C3.07718 21 1.73962 19.6588 1.73962 18.0301V4.36542H0.685498C-0.228499 4.36542 -0.228499 2.97308 0.685498 2.97308H6.09623V1.63823C6.09623 0.766423 6.77775 0 7.66627 0H11.3891C12.2745 0 12.9592 0.769617 12.9592 1.63823V2.97308H18.3667C19.2807 2.97308 19.2807 4.36542 18.3667 4.36542H17.3126ZM7.48474 2.97308H11.5675V1.63823C11.5675 1.53604 11.507 1.39234 11.3891 1.39234H7.66627C7.54525 1.39234 7.48474 1.53604 7.48474 1.63823V2.97308ZM12.5515 15.7181C12.5515 16.6314 11.163 16.6314 11.163 15.7181V8.13686C11.163 7.22354 12.5515 7.22354 12.5515 8.13686V15.7181ZM7.8892 15.7181C7.8892 16.6314 6.50068 16.6314 6.50068 15.7181V8.13686C6.50068 7.22354 7.8892 7.22035 7.8892 8.13686V15.7181ZM15.9241 4.36542C11.6598 4.36542 7.39557 4.36542 3.13132 4.36542V18.0301C3.13132 18.8987 3.83513 19.6077 4.70454 19.6077H14.3509C15.2171 19.6077 15.9241 18.8987 15.9241 18.0301V4.36542Z", fill: color }) }) }));
6
6
  };
7
7
  export default DeleteIcon;
@@ -0,0 +1,9 @@
1
+ import { CSSProperties, FC } from 'react';
2
+ type Props = {
3
+ width?: number;
4
+ height?: number;
5
+ color?: string;
6
+ style?: CSSProperties;
7
+ };
8
+ declare const MeatBallsIcon: FC<Props>;
9
+ export default MeatBallsIcon;
@@ -0,0 +1,7 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { fontColors } from '@sphereon/ui-components.core';
3
+ const MeatBallsIcon = (props) => {
4
+ const { width = 20, height = 20, color = fontColors.dark, style } = props;
5
+ return (_jsx("div", { style: { ...style, width, height, display: 'flex' }, children: _jsxs("svg", { width: "20", height: "20", viewBox: "0 0 32 32", fill: color, xmlns: "http://www.w3.org/2000/svg", children: [_jsx("circle", { cx: "8", cy: "16", r: "2", fill: color }), _jsx("circle", { cx: "16", cy: "16", r: "2", fill: color }), _jsx("circle", { cx: "24", cy: "16", r: "2", fill: color })] }) }));
6
+ };
7
+ export default MeatBallsIcon;
@@ -4,7 +4,7 @@ import SSIAddIcon from '../../assets/icons/SSIAddIcon';
4
4
  import SSIFilterIcon from '../../assets/icons/SSIFilterIcon';
5
5
  import SSIArrowDownIcon from '../../assets/icons/SSIArrowDownIcon';
6
6
  import { SSIIconButtonContainerStyled as Container } from '../../../styles';
7
- import BitterballenIcon from '../../assets/icons/BitterballenIcon';
7
+ import MeatBallsIcon from '../../assets/icons/MeatBallsIcon';
8
8
  import DeleteIcon from '../../assets/icons/DeleteIcon';
9
9
  const SSIIconButton = (props) => {
10
10
  const { icon, onClick, disabled = false, color = fontColors.dark } = props;
@@ -16,8 +16,8 @@ const getIcon = (icon, color) => {
16
16
  return _jsx(SSIAddIcon, { color: color });
17
17
  case ButtonIcon.ARROW_DOWN:
18
18
  return _jsx(SSIArrowDownIcon, { color: color });
19
- case ButtonIcon.BITTERBALLEN:
20
- return _jsx(BitterballenIcon, { color: color });
19
+ case ButtonIcon.MEATBALLS:
20
+ return _jsx(MeatBallsIcon, { color: color });
21
21
  case ButtonIcon.DELETE:
22
22
  return _jsx(DeleteIcon, { color: color });
23
23
  case ButtonIcon.FILTER:
@@ -0,0 +1,14 @@
1
+ import { FC } from 'react';
2
+ import { GeneralButton } from '../../../types';
3
+ import { ButtonIcon } from '@sphereon/ui-components.core';
4
+ import { Row } from '@tanstack/react-table';
5
+ export type Props = {
6
+ icon: ButtonIcon;
7
+ buttons: Array<GeneralButton>;
8
+ opts?: DropDownListOpts;
9
+ };
10
+ export type DropDownListOpts = {
11
+ rowData?: Row<any>;
12
+ };
13
+ declare const DropDownList: FC<Props>;
14
+ export default DropDownList;
@@ -0,0 +1,33 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState, useRef, useEffect } from 'react';
3
+ import { SSIDropDownListContainerStyled as Container, DropDownContainerStyled as DropDownContainer, DropDownListButtonStyled as ListButton, } from '../../../styles/components';
4
+ import DropDownListItem from '../DropDownListItem';
5
+ import { SSIIconButton } from '../../../index';
6
+ const DropDownList = (props) => {
7
+ const { icon, buttons, opts } = props;
8
+ const [showActionsMenu, setShowActionsMenu] = useState(false);
9
+ const dropdownRef = useRef(null);
10
+ const onMore = (event) => {
11
+ setShowActionsMenu(!showActionsMenu);
12
+ event.stopPropagation();
13
+ };
14
+ useEffect(() => {
15
+ const handleClickOutside = (event) => {
16
+ if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
17
+ setShowActionsMenu(false);
18
+ }
19
+ };
20
+ document.addEventListener('mousedown', handleClickOutside);
21
+ return () => {
22
+ document.removeEventListener('mousedown', handleClickOutside);
23
+ };
24
+ }, [showActionsMenu]);
25
+ const getItems = () => {
26
+ return buttons.map((item, index) => {
27
+ const showBorder = buttons.length > 1 && index !== buttons.length - 1;
28
+ return (_jsx(DropDownListItem, { showBorder: showBorder, label: item.caption, onClick: item.onClick, icon: item.icon, fontColor: item.fontColor, opts: opts }, index));
29
+ });
30
+ };
31
+ return (_jsxs(Container, { ref: dropdownRef, children: [_jsx(ListButton, { children: _jsx(SSIIconButton, { icon: icon, color: 'black', onClick: onMore }) }), showActionsMenu && _jsx(DropDownContainer, { children: getItems() })] }));
32
+ };
33
+ export default DropDownList;
@@ -0,0 +1,18 @@
1
+ import { FC } from 'react';
2
+ import { ButtonIcon } from '@sphereon/ui-components.core';
3
+ import { Row } from '@tanstack/react-table';
4
+ type Props = {
5
+ label: string;
6
+ onClick: (args?: any) => Promise<void>;
7
+ disabled?: boolean;
8
+ icon?: ButtonIcon;
9
+ fontColor?: string;
10
+ showBorder?: boolean;
11
+ borderColor?: string;
12
+ opts?: DropDownListItemOpts;
13
+ };
14
+ export type DropDownListItemOpts = {
15
+ rowData?: Row<any>;
16
+ };
17
+ declare const DropDownListItem: FC<Props>;
18
+ export default DropDownListItem;
@@ -0,0 +1,22 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { DropDownListItemContainerStyled as Container, DropDownListItemIconContainerStyled as IconContainer, DropDownListItemCaptionContainerStyled as ListItemCaption, } from '../../../styles/components';
3
+ import DeleteIcon from '../../assets/icons/DeleteIcon';
4
+ import { ButtonIcon, fontColors } from '@sphereon/ui-components.core';
5
+ const DropDownListItem = (props) => {
6
+ const { disabled, label, icon, showBorder = false, fontColor = fontColors.dark, borderColor = fontColors.dark, opts, onClick } = props;
7
+ const getIcon = (icon) => {
8
+ switch (icon) {
9
+ case ButtonIcon.DELETE:
10
+ return _jsx(DeleteIcon, { color: fontColors.dark });
11
+ default:
12
+ return _jsx("div", {});
13
+ }
14
+ };
15
+ const onContainerClick = (event) => {
16
+ if (onClick) {
17
+ onClick(opts);
18
+ }
19
+ };
20
+ return (_jsxs(Container, { onClick: onContainerClick, style: { ...(showBorder && { borderBottomWidth: 2, borderBottomColor: borderColor }) }, children: [_jsx(ListItemCaption, { children: label }), icon && _jsx(IconContainer, { children: getIcon(icon) })] }));
21
+ };
22
+ export default DropDownListItem;
@@ -1,11 +1,10 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { ButtonIcon, Localization } from '@sphereon/ui-components.core';
3
3
  import SSIIconButton from '../../../buttons/SSIIconButton';
4
- import SSIDropDownList from '../../../lists/SSIDropDownList';
5
4
  import SSIPrimaryButton from '../../../buttons/SSIPrimaryButton';
6
- import { SSITableViewHeaderActionsContainerStyled as ActionsContainer, SSITableViewHeaderContainerStyled as Container, SSITableViewHeaderContentContainerStyled as ContentContainer, SSITextH3Styled as FilterCaption, SSITableViewHeaderFilterContainerStyled as FilterContainer, SSITableViewHeaderShowOptionContainerStyled as ShowOptionContainer, } from '../../../../styles';
5
+ import { SSITableViewHeaderActionsContainerStyled as ActionsContainer, SSITableViewHeaderContainerStyled as Container, SSITableViewHeaderContentContainerStyled as ContentContainer, SSITextH3Styled as FilterCaption, SSITableViewHeaderFilterContainerStyled as FilterContainer, } from '../../../../styles';
7
6
  const SSITableViewHeader = (props) => {
8
7
  const { enableFiltering = false, enableMostRecent = false, actions = [] } = props;
9
- return (_jsx(Container, { children: _jsx(ContentContainer, { children: _jsxs(ActionsContainer, { children: [enableFiltering && (_jsxs(FilterContainer, { children: [_jsx(SSIIconButton, { icon: ButtonIcon.FILTER, onClick: async () => console.log('add filter clicked') }), _jsx(FilterCaption, { children: Localization.translate('action_filter_caption') })] })), enableMostRecent && (_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)))] }) }) }));
8
+ return (_jsx(Container, { children: _jsx(ContentContainer, { children: _jsxs(ActionsContainer, { children: [enableFiltering && (_jsxs(FilterContainer, { children: [_jsx(SSIIconButton, { icon: ButtonIcon.FILTER, onClick: async () => console.log('add filter clicked') }), _jsx(FilterCaption, { children: Localization.translate('action_filter_caption') })] })), actions.map((action, index) => (_jsx(SSIPrimaryButton, { caption: action.caption, onClick: action.onClick, icon: action.icon }, index)))] }) }) }));
10
9
  };
11
10
  export default SSITableViewHeader;
@@ -1,6 +1,6 @@
1
1
  import { ReactElement } from 'react';
2
2
  import { ColumnResizeMode, Row } from '@tanstack/react-table';
3
- import { ActionGroup, Button, ColumnHeader } from '../../../types';
3
+ import { Button, ColumnHeader } from '../../../types';
4
4
  type Props<T> = {
5
5
  data: Array<T>;
6
6
  columns: Array<ColumnHeader<T>>;
@@ -11,7 +11,6 @@ type Props<T> = {
11
11
  enableResultCount?: boolean;
12
12
  columnResizeMode?: ColumnResizeMode;
13
13
  actions?: Array<Button>;
14
- actionGroup?: ActionGroup<T>;
15
14
  };
16
15
  declare const SSITableView: <T extends {}>(props: Props<T>) => ReactElement;
17
16
  export default SSITableView;
@@ -7,8 +7,7 @@ import SSITypeLabel from '../../labels/SSITypeLabel';
7
7
  import SSIHoverText from '../../fields/SSIHoverText';
8
8
  import { SSITableViewCellContainerStyled as CellContainer, SSITableViewContainerStyled as Container, SSITableViewHeaderCellContainerStyled as HeaderCellContainer, SSITableViewLabelCellStyled as LabelCell, SSITableViewResultCountCaptionStyled as ResultCountCaption, SSITableViewRowContainerStyled as RowContainer, SSITableViewTableContainerStyled as TableContainer, } from '../../../styles';
9
9
  import { TableCellType } from '../../../types';
10
- import { CredentialMiniCardView, SSIStatusLabel } from '../../../index';
11
- import RowActionMenuButton from '../../buttons/RowActionMenuButton';
10
+ import { CredentialMiniCardView, DropDownList, SSIStatusLabel } from '../../../index';
12
11
  function IndeterminateCheckbox({ indeterminate, className = '', ...rest }) {
13
12
  const ref = React.useRef(null);
14
13
  React.useEffect(() => {
@@ -18,7 +17,7 @@ function IndeterminateCheckbox({ indeterminate, className = '', ...rest }) {
18
17
  }, [ref, indeterminate]);
19
18
  return _jsx("input", { type: "checkbox", ref: ref, className: className + ' cursor-pointer', ...rest });
20
19
  }
21
- const getCellFormatting = (type, value, opts) => {
20
+ const getCellFormatting = (type, value, row, opts) => {
22
21
  switch (type) {
23
22
  case TableCellType.TEXT:
24
23
  const { truncationLength, enableHover = false } = opts ?? {};
@@ -33,18 +32,25 @@ const getCellFormatting = (type, value, opts) => {
33
32
  case TableCellType.CREDENTIAL_CARD: {
34
33
  return _jsx(CredentialMiniCardView, { ...value });
35
34
  }
35
+ case TableCellType.ACTION_GROUP: {
36
+ const { actionGroup } = opts ?? {};
37
+ if (actionGroup) {
38
+ return _jsx(DropDownList, { icon: actionGroup.icon ?? ButtonIcon.MEATBALLS, buttons: actionGroup.actions, opts: { rowData: row } });
39
+ }
40
+ return _jsx("div", {});
41
+ }
36
42
  default:
37
43
  return _jsx("div", {});
38
44
  }
39
45
  };
40
46
  const SSITableView = (props) => {
41
- const { columns, data, enableRowSelection = false, enableFiltering = false, enableMostRecent = false, enableResultCount = false, columnResizeMode = 'onChange', actions = [], actionGroup, onRowClick, } = props;
47
+ const { columns, data, enableRowSelection = false, enableFiltering = false, enableMostRecent = false, enableResultCount = false, columnResizeMode = 'onChange', actions = [], onRowClick, } = props;
42
48
  const [rowSelection, setRowSelection] = React.useState({});
43
49
  const columnHelper = createColumnHelper();
44
50
  let availableColumns = columns.map((header) => columnHelper.accessor(header.accessor, {
45
51
  id: header.accessor,
46
52
  header: header.label,
47
- cell: (info) => getCellFormatting(header.type, info.getValue(), header.opts),
53
+ cell: (info) => getCellFormatting(header.type, info.getValue(), info.row, header.opts),
48
54
  minSize: header.opts?.columnMinWidth,
49
55
  maxSize: header.opts?.columnMaxWidth,
50
56
  size: header.opts?.columnWidth,
@@ -68,16 +74,6 @@ const SSITableView = (props) => {
68
74
  ...availableColumns,
69
75
  ];
70
76
  }
71
- if (actionGroup) {
72
- availableColumns = [
73
- ...availableColumns,
74
- {
75
- id: 'actions',
76
- header: actionGroup.caption,
77
- cell: ({ row }) => (_jsx("div", { className: "px-1", children: _jsx(RowActionMenuButton, { actions: actionGroup.actions, icon: ButtonIcon.BITTERBALLEN, rowData: row }) })),
78
- },
79
- ];
80
- }
81
77
  const table = useReactTable({
82
78
  defaultColumn: {
83
79
  size: 0,
package/dist/index.d.ts CHANGED
@@ -13,7 +13,7 @@ import SSIArrowDownIcon from './components/assets/icons/SSIArrowDownIcon';
13
13
  import SSITypeLabel from './components/labels/SSITypeLabel';
14
14
  import SSIIconButton from './components/buttons/SSIIconButton';
15
15
  import SSIPrimaryButton from './components/buttons/SSIPrimaryButton';
16
- import SSIDropDownList from './components/lists/SSIDropDownList';
16
+ import DropDownList from './components/lists/DropDownList';
17
17
  import SSITableView from './components/views/SSITableView';
18
18
  import SSITableViewHeader from './components/views/SSITableView/SSITableViewHeader';
19
19
  import SSITabView from './components/views/SSITabView';
@@ -29,4 +29,4 @@ import { Row } from '@tanstack/react-table';
29
29
  export * from './styles/fonts';
30
30
  export * from './types';
31
31
  export * from './helpers';
32
- export { SSICredentialCardView, CredentialMiniCardView, CredentialMiniCardViewProps, SSIStatusLabel, SSICheckmarkBadge, SSIExclamationMarkBadge, SSIPlaceholderLogo, SSILogo, SSIAddIcon, SSIFilterIcon, SSIArrowDownIcon, SSITypeLabel, SSIIconButton, SSIPrimaryButton, SSISecondaryButton, SSIDropDownList, SSITableView, SSITableViewHeader, SSITabView, SSITabViewHeader, SSIProfileIcon, SSIToastContainer, SSICheckbox, SSIActivityIndicator, SSIHoverText, StepMarker, ProgressStepIndicator, Row, };
32
+ export { SSICredentialCardView, CredentialMiniCardView, CredentialMiniCardViewProps, SSIStatusLabel, SSICheckmarkBadge, SSIExclamationMarkBadge, SSIPlaceholderLogo, SSILogo, SSIAddIcon, SSIFilterIcon, SSIArrowDownIcon, SSITypeLabel, SSIIconButton, SSIPrimaryButton, SSISecondaryButton, DropDownList, SSITableView, SSITableViewHeader, SSITabView, SSITabViewHeader, SSIProfileIcon, SSIToastContainer, SSICheckbox, SSIActivityIndicator, SSIHoverText, StepMarker, ProgressStepIndicator, Row, };
package/dist/index.js CHANGED
@@ -12,7 +12,7 @@ import SSIArrowDownIcon from './components/assets/icons/SSIArrowDownIcon';
12
12
  import SSITypeLabel from './components/labels/SSITypeLabel';
13
13
  import SSIIconButton from './components/buttons/SSIIconButton';
14
14
  import SSIPrimaryButton from './components/buttons/SSIPrimaryButton';
15
- import SSIDropDownList from './components/lists/SSIDropDownList';
15
+ import DropDownList from './components/lists/DropDownList';
16
16
  import SSITableView from './components/views/SSITableView';
17
17
  import SSITableViewHeader from './components/views/SSITableView/SSITableViewHeader';
18
18
  import SSITabView from './components/views/SSITabView';
@@ -27,4 +27,4 @@ import StepMarker from './components/assets/markers/StepMarker';
27
27
  export * from './styles/fonts';
28
28
  export * from './types';
29
29
  export * from './helpers';
30
- export { SSICredentialCardView, CredentialMiniCardView, SSIStatusLabel, SSICheckmarkBadge, SSIExclamationMarkBadge, SSIPlaceholderLogo, SSILogo, SSIAddIcon, SSIFilterIcon, SSIArrowDownIcon, SSITypeLabel, SSIIconButton, SSIPrimaryButton, SSISecondaryButton, SSIDropDownList, SSITableView, SSITableViewHeader, SSITabView, SSITabViewHeader, SSIProfileIcon, SSIToastContainer, SSICheckbox, SSIActivityIndicator, SSIHoverText, StepMarker, ProgressStepIndicator, };
30
+ export { SSICredentialCardView, CredentialMiniCardView, SSIStatusLabel, SSICheckmarkBadge, SSIExclamationMarkBadge, SSIPlaceholderLogo, SSILogo, SSIAddIcon, SSIFilterIcon, SSIArrowDownIcon, SSITypeLabel, SSIIconButton, SSIPrimaryButton, SSISecondaryButton, DropDownList, SSITableView, SSITableViewHeader, SSITabView, SSITabViewHeader, SSIProfileIcon, SSIToastContainer, SSICheckbox, SSIActivityIndicator, SSIHoverText, StepMarker, ProgressStepIndicator, };
@@ -1,2 +1,4 @@
1
1
  export declare const SSIDropDownListContainerStyled: import("styled-components").StyledComponent<"div", any, {}, never>;
2
2
  export declare const SSIDropDownListSelectedValueStyled: import("styled-components").StyledComponent<"div", any, {}, never>;
3
+ export declare const DropDownListButtonStyled: import("styled-components").StyledComponent<"div", any, {}, never>;
4
+ export declare const DropDownContainerStyled: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -2,7 +2,10 @@ import styled from 'styled-components';
2
2
  import { SSIFlexDirectionRowViewStyled } from '../../containers';
3
3
  import { SSITextH3Styled } from '../../../fonts';
4
4
  import { gradient100TextCss } from '../../../css';
5
+ import { backgroundColors } from '@sphereon/ui-components.core';
5
6
  export const SSIDropDownListContainerStyled = styled(SSIFlexDirectionRowViewStyled) `
7
+ position: relative;
8
+ display: inline-block;
6
9
  text-align: left;
7
10
  align-items: center;
8
11
  gap: 2px;
@@ -10,3 +13,15 @@ export const SSIDropDownListContainerStyled = styled(SSIFlexDirectionRowViewStyl
10
13
  export const SSIDropDownListSelectedValueStyled = styled(SSITextH3Styled) `
11
14
  ${gradient100TextCss}
12
15
  `;
16
+ export const DropDownListButtonStyled = styled.div `
17
+ display: inline-block !important;
18
+ `;
19
+ export const DropDownContainerStyled = styled.div `
20
+ position: absolute;
21
+ top: 100%;
22
+ left: 0;
23
+ width: 250px;
24
+ background-color: ${backgroundColors.primaryLight};
25
+ border-radius: 8px;
26
+ z-index: 1000;
27
+ `;
@@ -0,0 +1,3 @@
1
+ export declare const DropDownListItemContainerStyled: import("styled-components").StyledComponent<"div", any, {}, never>;
2
+ export declare const DropDownListItemCaptionContainerStyled: import("styled-components").StyledComponent<"div", any, {}, never>;
3
+ export declare const DropDownListItemIconContainerStyled: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -0,0 +1,22 @@
1
+ import styled from 'styled-components';
2
+ import { SSIFlexDirectionRowViewStyled } from '../../containers';
3
+ import { SSITextH2Styled } from '../../../fonts';
4
+ import { backgroundColors, fontColors } from '@sphereon/ui-components.core';
5
+ export const DropDownListItemContainerStyled = styled(SSIFlexDirectionRowViewStyled) `
6
+ flex-direction: row;
7
+ align-items: center;
8
+ background-color: ${backgroundColors.primaryLight};
9
+ padding: 10px 16px;
10
+ `;
11
+ export const DropDownListItemCaptionContainerStyled = styled(SSITextH2Styled) `
12
+ flex: 1;
13
+ margin-right: 8px;
14
+ color: ${fontColors.dark};
15
+ `;
16
+ export const DropDownListItemIconContainerStyled = styled.div `
17
+ display: flex;
18
+ align-items: center;
19
+ justify-content: center;
20
+ margin: 4px;
21
+ margin-right: 12px;
22
+ `;
@@ -0,0 +1 @@
1
+ export declare const ButtonFlexRowStyled: import("styled-components").StyledComponent<"button", any, {}, never>;
@@ -0,0 +1,4 @@
1
+ import styled from 'styled-components';
2
+ export const ButtonFlexRowStyled = styled('button') `
3
+ flex-direction: row;
4
+ `;
@@ -1,11 +1,12 @@
1
- export * from './RowActionMenuButton';
1
+ export * from './buttons';
2
+ export * from './DropDownListItem';
2
3
  export * from './SSICredentialCardView';
3
4
  export * from './SSICredentialMiniCardView';
4
5
  export * from './SSIStatusLabel';
5
6
  export * from './SSIPrimaryButton';
6
7
  export * from './SSISecondaryButton';
7
8
  export * from './SSIIconButton';
8
- export * from './SSIDropDownList';
9
+ export * from './DropDownList';
9
10
  export * from './SSITypeLabel';
10
11
  export * from './SSITableViewHeader';
11
12
  export * from './SSITableView';
@@ -1,11 +1,12 @@
1
- export * from './RowActionMenuButton';
1
+ export * from './buttons';
2
+ export * from './DropDownListItem';
2
3
  export * from './SSICredentialCardView';
3
4
  export * from './SSICredentialMiniCardView';
4
5
  export * from './SSIStatusLabel';
5
6
  export * from './SSIPrimaryButton';
6
7
  export * from './SSISecondaryButton';
7
8
  export * from './SSIIconButton';
8
- export * from './SSIDropDownList';
9
+ export * from './DropDownList';
9
10
  export * from './SSITypeLabel';
10
11
  export * from './SSITableViewHeader';
11
12
  export * from './SSITableView';
@@ -1,7 +1,10 @@
1
1
  import { ButtonIcon } from '@sphereon/ui-components.core';
2
+ import { TableColumnActionButton } from '../table';
2
3
  export type Button = {
3
4
  caption: string;
4
5
  onClick: () => Promise<void>;
5
6
  icon?: ButtonIcon;
7
+ fontColor?: string;
6
8
  disabled?: boolean;
7
9
  };
10
+ export type GeneralButton = Button | TableColumnActionButton;
@@ -4,7 +4,8 @@ export declare enum TableCellType {
4
4
  TEXT = "text",
5
5
  LABEL = "label",
6
6
  STATUS = "status",
7
- CREDENTIAL_CARD = "credentialCard"
7
+ CREDENTIAL_CARD = "credentialCard",
8
+ ACTION_GROUP = "actionGroup"
8
9
  }
9
10
  export type ColumnHeader<T> = {
10
11
  accessor: AccessorFn<T> | DeepKeys<T>;
@@ -18,14 +19,17 @@ export type TableCellOptions = {
18
19
  columnMinWidth?: number;
19
20
  columnMaxWidth?: number;
20
21
  columnWidth?: number;
22
+ actionGroup?: TableColumnActionGroup;
21
23
  };
22
- export type ActionGroup<T> = {
23
- caption: string;
24
- actions: ActionButton<T>[];
24
+ export type TableColumnActionGroup = {
25
+ label?: string;
26
+ icon?: ButtonIcon;
27
+ actions: Array<TableColumnActionButton>;
25
28
  };
26
- export type ActionButton<T> = {
29
+ export type TableColumnActionButton = {
27
30
  caption: string;
28
- onClick: (rowData: Row<T>) => Promise<void>;
31
+ onClick: (rowData: Row<any>) => Promise<void>;
29
32
  icon?: ButtonIcon;
33
+ fontColor?: string;
30
34
  disabled?: boolean;
31
35
  };
@@ -4,4 +4,5 @@ export var TableCellType;
4
4
  TableCellType["LABEL"] = "label";
5
5
  TableCellType["STATUS"] = "status";
6
6
  TableCellType["CREDENTIAL_CARD"] = "credentialCard";
7
+ TableCellType["ACTION_GROUP"] = "actionGroup";
7
8
  })(TableCellType || (TableCellType = {}));
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-unstable.103+b911546",
4
+ "version": "0.1.3-unstable.106+c72e879",
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-unstable.103+b911546",
31
+ "@sphereon/ui-components.core": "0.1.3-unstable.106+c72e879",
32
32
  "@tanstack/react-table": "^8.9.3",
33
33
  "react-loader-spinner": "^5.4.5",
34
34
  "react-toastify": "^9.1.3",
@@ -42,5 +42,5 @@
42
42
  "peerDependencies": {
43
43
  "react": ">= 16.8.0"
44
44
  },
45
- "gitHead": "b911546860dd4fee85478893d41458267dc08c71"
45
+ "gitHead": "c72e8791c86a4b27e790d6d005fd5d120c9607cd"
46
46
  }
@@ -1,8 +0,0 @@
1
- import { CSSProperties, FC } from 'react';
2
- type Props = {
3
- size?: number;
4
- color?: string;
5
- style?: CSSProperties;
6
- };
7
- declare const BitterballenIcon: FC<Props>;
8
- export default BitterballenIcon;
@@ -1,7 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { fontColors } from '@sphereon/ui-components.core';
3
- const BitterballenIcon = (props) => {
4
- const { size = 42, color = fontColors.dark, style } = props;
5
- return (_jsx("div", { style: { ...style, width: size, aspectRatio: 1, display: 'flex' }, children: _jsxs("svg", { width: "42", height: "43", viewBox: "0 0 42 43", fill: color, xmlns: "http://www.w3.org/2000/svg", children: [_jsx("circle", { cx: "13", cy: "21.5", r: "2", fill: "#303030" }), _jsx("circle", { cx: "21", cy: "21.5", r: "2", fill: "#303030" }), _jsx("circle", { cx: "29", cy: "21.5", r: "2", fill: "#303030" })] }) }));
6
- };
7
- export default BitterballenIcon;
@@ -1,13 +0,0 @@
1
- import { CSSProperties, ReactElement } from 'react';
2
- import { ButtonIcon } from '@sphereon/ui-components.core';
3
- import { ActionButton } from '../../../index';
4
- import { Row } from '@tanstack/react-table';
5
- type Props<T> = {
6
- actions: ActionButton<T>[];
7
- icon: ButtonIcon;
8
- color?: string;
9
- style?: CSSProperties;
10
- rowData: Row<T>;
11
- };
12
- declare const RowActionMenuButton: <T>({ actions, icon, color, style, rowData }: Props<T>) => ReactElement;
13
- export default RowActionMenuButton;
@@ -1,34 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useState, useEffect, useRef } from 'react';
3
- import { ButtonIcon } from '@sphereon/ui-components.core';
4
- import { SSIIconButton } from '../../../index';
5
- import { RowActionMenuButtonContainerStyled as ButtonContainer, RowActionDropdownContainerStyled as DropdownContainer, ActionItemContainerStyled as ActionItemContainer, ActionItemCaptionStyled as ItemCaption, } from '../../../styles';
6
- const RowActionMenuButton = ({ actions, icon, color, style = {}, rowData }) => {
7
- const [isDropdownVisible, setIsDropdownVisible] = useState(false);
8
- const dropdownRef = useRef(null);
9
- useEffect(() => {
10
- const handleClickOutside = (event) => {
11
- if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
12
- setIsDropdownVisible(false);
13
- }
14
- };
15
- document.addEventListener('mousedown', handleClickOutside);
16
- return () => {
17
- document.removeEventListener('mousedown', handleClickOutside);
18
- };
19
- }, [dropdownRef]);
20
- const toggleDropdown = (event) => {
21
- event?.stopPropagation();
22
- setIsDropdownVisible(!isDropdownVisible);
23
- };
24
- const handleActionClick = (action, rowData) => async (event) => {
25
- event.stopPropagation();
26
- await action.onClick(rowData);
27
- setIsDropdownVisible(false);
28
- };
29
- const renderDropdown = () => {
30
- return (_jsx(DropdownContainer, { ref: dropdownRef, style: { display: isDropdownVisible ? 'block' : 'none' }, children: actions.map((action, index) => (_jsxs(ActionItemContainer, { onClick: handleActionClick(action, rowData), children: [_jsx(ItemCaption, { children: action.caption }), action.icon && _jsx(SSIIconButton, { onClick: handleActionClick(action, rowData), icon: action.icon })] }, index))) }));
31
- };
32
- return (_jsxs(ButtonContainer, { style: { ...style }, children: [_jsx(SSIIconButton, { icon: icon || ButtonIcon.BITTERBALLEN, color: color, onClick: toggleDropdown }), renderDropdown()] }));
33
- };
34
- export default RowActionMenuButton;
@@ -1,7 +0,0 @@
1
- import { FC } from 'react';
2
- type Props = {
3
- initialValue: string;
4
- label?: string;
5
- };
6
- declare const SSIDropDownList: FC<Props>;
7
- export default SSIDropDownList;
@@ -1,11 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import React from 'react';
3
- import { ButtonIcon } from '@sphereon/ui-components.core';
4
- import SSIIconButton from '../../buttons/SSIIconButton';
5
- import { SSIDropDownListContainerStyled as Container, SSITextH3Styled as LabelCaption, SSIDropDownListSelectedValueStyled as SelectedValue, } from '../../../styles';
6
- const SSIDropDownList = (props) => {
7
- const { initialValue, label } = props;
8
- const [value, setValue] = React.useState(initialValue);
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
- };
11
- export default SSIDropDownList;
@@ -1,4 +0,0 @@
1
- export declare const RowActionMenuButtonContainerStyled: import("styled-components").StyledComponent<"div", any, {}, never>;
2
- export declare const ActionItemContainerStyled: import("styled-components").StyledComponent<"div", any, {}, never>;
3
- export declare const ActionItemCaptionStyled: import("styled-components").StyledComponent<"span", any, {}, never>;
4
- export declare const RowActionDropdownContainerStyled: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -1,29 +0,0 @@
1
- import styled from 'styled-components';
2
- export const RowActionMenuButtonContainerStyled = styled.div `
3
- position: relative;
4
- `;
5
- export const ActionItemContainerStyled = styled.div `
6
- display: flex;
7
- justify-content: space-between;
8
- align-items: center;
9
- padding: 5px;
10
- cursor: pointer;
11
- max-width: 250px;
12
- `;
13
- export const ActionItemCaptionStyled = styled.span `
14
- font-family: Poppins;
15
- font-size: 16px;
16
- font-weight: 400;
17
- line-height: 24px;
18
- letter-spacing: 0em;
19
- text-align: left;
20
- `;
21
- export const RowActionDropdownContainerStyled = styled.div `
22
- position: absolute;
23
- z-index: 1000;
24
- background-color: #fff;
25
- width: auto;
26
- padding: 10px;
27
- background: #fbfbfb;
28
- border-radius: 0px 0px 6px 6px;
29
- `;