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

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 (32) 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/RowActionMenuButton/index.d.ts +6 -6
  6. package/dist/components/buttons/RowActionMenuButton/index.js +9 -11
  7. package/dist/components/buttons/SSIIconButton/index.js +3 -3
  8. package/dist/components/lists/DropDownList/index.d.ts +7 -0
  9. package/dist/components/lists/DropDownList/index.js +14 -0
  10. package/dist/components/lists/DropDownListItem/index.d.ts +12 -0
  11. package/dist/components/lists/DropDownListItem/index.js +23 -0
  12. package/dist/components/views/SSITableView/SSITableViewHeader/index.js +2 -3
  13. package/dist/components/views/SSITableView/index.d.ts +1 -2
  14. package/dist/components/views/SSITableView/index.js +11 -14
  15. package/dist/index.d.ts +2 -2
  16. package/dist/index.js +2 -2
  17. package/dist/styles/components/components/DropDownListItem/index.d.ts +3 -0
  18. package/dist/styles/components/components/DropDownListItem/index.js +17 -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 -1
  22. package/dist/styles/components/components/index.js +3 -1
  23. package/dist/types/button/index.d.ts +3 -0
  24. package/dist/types/table/index.d.ts +9 -5
  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/lists/SSIDropDownList/index.d.ts +0 -7
  30. package/dist/components/lists/SSIDropDownList/index.js +0 -11
  31. /package/dist/styles/components/components/{SSIDropDownList → DropDownList}/index.d.ts +0 -0
  32. /package/dist/styles/components/components/{SSIDropDownList → DropDownList}/index.js +0 -0
@@ -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: "19", height: "21", viewBox: "0 0 19 21", 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: 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 = 4, color = fontColors.dark, style } = props;
5
+ return (_jsx("div", { style: { ...style, width, height, display: 'flex' }, children: _jsxs("svg", { width: "20", height: "4", viewBox: "0 0 20 4", fill: color, xmlns: "http://www.w3.org/2000/svg", children: [_jsx("circle", { cx: "13", cy: "21.5", r: "2", fill: color }), _jsx("circle", { cx: "21", cy: "21.5", r: "2", fill: color }), _jsx("circle", { cx: "29", cy: "21.5", r: "2", fill: color })] }) }));
6
+ };
7
+ export default MeatBallsIcon;
@@ -1,13 +1,13 @@
1
1
  import { CSSProperties, ReactElement } from 'react';
2
2
  import { ButtonIcon } from '@sphereon/ui-components.core';
3
- import { ActionButton } from '../../../index';
3
+ import { TableColumnActionButton } from '../../../index';
4
4
  import { Row } from '@tanstack/react-table';
5
- type Props<T> = {
6
- actions: ActionButton<T>[];
7
- icon: ButtonIcon;
5
+ type Props = {
6
+ actions: Array<TableColumnActionButton>;
7
+ rowData: Row<any>;
8
+ icon?: ButtonIcon;
8
9
  color?: string;
9
10
  style?: CSSProperties;
10
- rowData: Row<T>;
11
11
  };
12
- declare const RowActionMenuButton: <T>({ actions, icon, color, style, rowData }: Props<T>) => ReactElement;
12
+ declare const RowActionMenuButton: (props: Props) => ReactElement;
13
13
  export default RowActionMenuButton;
@@ -1,34 +1,32 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useState, useEffect, useRef } from 'react';
3
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 }) => {
4
+ import { SSIIconButton, DropDownList } from '../../../index';
5
+ import { RowActionMenuButtonContainerStyled as ButtonContainer } from '../../../styles';
6
+ const RowActionMenuButton = (props) => {
7
+ const { actions, icon = ButtonIcon.MEATBALLS, color, style = {} } = props;
7
8
  const [isDropdownVisible, setIsDropdownVisible] = useState(false);
8
9
  const dropdownRef = useRef(null);
9
10
  useEffect(() => {
10
- const handleClickOutside = (event) => {
11
+ const onClickOutside = (event) => {
11
12
  if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
12
13
  setIsDropdownVisible(false);
13
14
  }
14
15
  };
15
- document.addEventListener('mousedown', handleClickOutside);
16
+ document.addEventListener('mousedown', onClickOutside);
16
17
  return () => {
17
- document.removeEventListener('mousedown', handleClickOutside);
18
+ document.removeEventListener('mousedown', onClickOutside);
18
19
  };
19
20
  }, [dropdownRef]);
20
21
  const toggleDropdown = (event) => {
21
22
  event?.stopPropagation();
22
23
  setIsDropdownVisible(!isDropdownVisible);
23
24
  };
24
- const handleActionClick = (action, rowData) => async (event) => {
25
+ const onActionClick = (action, rowData) => async (event) => {
25
26
  event.stopPropagation();
26
27
  await action.onClick(rowData);
27
28
  setIsDropdownVisible(false);
28
29
  };
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()] }));
30
+ return (_jsxs(ButtonContainer, { style: { ...style }, children: [_jsx(SSIIconButton, { icon: icon, color: color, onClick: toggleDropdown }), _jsx(DropDownList, { buttons: actions })] }));
33
31
  };
34
32
  export default RowActionMenuButton;
@@ -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,7 @@
1
+ import { FC } from 'react';
2
+ import { GeneralButton } from '../../../types';
3
+ export type Props = {
4
+ buttons: Array<GeneralButton>;
5
+ };
6
+ declare const DropDownList: FC<Props>;
7
+ export default DropDownList;
@@ -0,0 +1,14 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { SSIDropDownListContainerStyled as Container } from '../../../styles/components';
3
+ import DropDownListItem from '../DropDownListItem';
4
+ const DropDownList = (props) => {
5
+ const getItems = () => {
6
+ const { buttons } = props;
7
+ return buttons.map((item, index) => {
8
+ const showBorder = buttons.length > 1 && index !== buttons.length - 1;
9
+ return (_jsx(DropDownListItem, { showBorder: showBorder, caption: item.caption, onClick: item.onClick, icon: item.icon, fontColor: item.fontColor }, index));
10
+ });
11
+ };
12
+ return _jsx(Container, { children: getItems() });
13
+ };
14
+ export default DropDownList;
@@ -0,0 +1,12 @@
1
+ import { FC } from 'react';
2
+ import { ButtonIcon } from '@sphereon/ui-components.core';
3
+ type Props = {
4
+ caption: string;
5
+ onClick: (args?: any) => Promise<void>;
6
+ disabled?: boolean;
7
+ icon?: ButtonIcon;
8
+ showBorder?: boolean;
9
+ fontColor?: string;
10
+ };
11
+ declare const DropDownListItem: FC<Props>;
12
+ export default DropDownListItem;
@@ -0,0 +1,23 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { ButtonFlexRowStyled as Button, DropDownListItemContainerStyled as Container, DropDownListItemIconContainerStyled as IconContainer, DropDownListItemCaptionContainerStyled as ListItemCaption, } from '../../../styles/components';
3
+ import DeleteIcon from '../../assets/icons/DeleteIcon';
4
+ import { borderColors, ButtonIcon, fontColors, OpacityStyleEnum } from '@sphereon/ui-components.core';
5
+ const DropDownListItem = (props) => {
6
+ const { disabled, caption, icon, showBorder = false, fontColor = fontColors.dark } = props;
7
+ const onClick = async () => {
8
+ await props.onClick();
9
+ };
10
+ const getIcon = (icon) => {
11
+ const { fontColor = fontColors.dark } = props;
12
+ switch (icon) {
13
+ case ButtonIcon.DELETE:
14
+ return _jsx(DeleteIcon, { color: fontColor });
15
+ default:
16
+ return _jsx("div", {});
17
+ }
18
+ };
19
+ return (_jsx(Button, { onClick: onClick, disabled: disabled, style: {
20
+ ...(disabled && { opacity: OpacityStyleEnum.DISABLED }),
21
+ }, children: _jsxs(Container, { style: { ...(showBorder && { borderBottomWidth: 2, borderBottomColor: borderColors.light }) }, children: [_jsx(ListItemCaption, { style: { color: fontColor }, children: caption }), icon && _jsx(IconContainer, { children: getIcon(icon) })] }) }));
22
+ };
23
+ 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') })] })), "//todo: revisit this part when we have the most recent functionality", 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;
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import React from 'react';
3
3
  import { createColumnHelper, flexRender, getCoreRowModel, useReactTable, } from '@tanstack/react-table';
4
- import { ButtonIcon, Localization } from '@sphereon/ui-components.core';
4
+ import { Localization } from '@sphereon/ui-components.core';
5
5
  import SSITableViewHeader from './SSITableViewHeader';
6
6
  import SSITypeLabel from '../../labels/SSITypeLabel';
7
7
  import SSIHoverText from '../../fields/SSIHoverText';
@@ -18,7 +18,7 @@ function IndeterminateCheckbox({ indeterminate, className = '', ...rest }) {
18
18
  }, [ref, indeterminate]);
19
19
  return _jsx("input", { type: "checkbox", ref: ref, className: className + ' cursor-pointer', ...rest });
20
20
  }
21
- const getCellFormatting = (type, value, opts) => {
21
+ const getCellFormatting = (type, value, row, opts) => {
22
22
  switch (type) {
23
23
  case TableCellType.TEXT:
24
24
  const { truncationLength, enableHover = false } = opts ?? {};
@@ -33,18 +33,25 @@ const getCellFormatting = (type, value, opts) => {
33
33
  case TableCellType.CREDENTIAL_CARD: {
34
34
  return _jsx(CredentialMiniCardView, { ...value });
35
35
  }
36
+ case TableCellType.ACTION_GROUP: {
37
+ const { actionGroup } = opts ?? {};
38
+ if (actionGroup) {
39
+ return _jsx(RowActionMenuButton, { icon: actionGroup.icon, actions: actionGroup.actions, rowData: row });
40
+ }
41
+ return _jsx("div", {});
42
+ }
36
43
  default:
37
44
  return _jsx("div", {});
38
45
  }
39
46
  };
40
47
  const SSITableView = (props) => {
41
- const { columns, data, enableRowSelection = false, enableFiltering = false, enableMostRecent = false, enableResultCount = false, columnResizeMode = 'onChange', actions = [], actionGroup, onRowClick, } = props;
48
+ const { columns, data, enableRowSelection = false, enableFiltering = false, enableMostRecent = false, enableResultCount = false, columnResizeMode = 'onChange', actions = [], onRowClick, } = props;
42
49
  const [rowSelection, setRowSelection] = React.useState({});
43
50
  const columnHelper = createColumnHelper();
44
51
  let availableColumns = columns.map((header) => columnHelper.accessor(header.accessor, {
45
52
  id: header.accessor,
46
53
  header: header.label,
47
- cell: (info) => getCellFormatting(header.type, info.getValue(), header.opts),
54
+ cell: (info) => getCellFormatting(header.type, info.getValue(), info.row, header.opts),
48
55
  minSize: header.opts?.columnMinWidth,
49
56
  maxSize: header.opts?.columnMaxWidth,
50
57
  size: header.opts?.columnWidth,
@@ -68,16 +75,6 @@ const SSITableView = (props) => {
68
75
  ...availableColumns,
69
76
  ];
70
77
  }
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
78
  const table = useReactTable({
82
79
  defaultColumn: {
83
80
  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, };
@@ -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,17 @@
1
+ import { SSIFlexDirectionRowViewStyled } from '../../containers';
2
+ import styled from 'styled-components';
3
+ import { backgroundColors } from '@sphereon/ui-components.core';
4
+ import { SSITextH2Styled } from '../../../fonts';
5
+ export const DropDownListItemContainerStyled = styled(SSIFlexDirectionRowViewStyled) `
6
+ flex: 1;
7
+ background-color: ${backgroundColors.primaryLight};
8
+ `;
9
+ export const DropDownListItemCaptionContainerStyled = styled(SSITextH2Styled) `
10
+ margin: 13px 0 11px 16px;
11
+ `;
12
+ export const DropDownListItemIconContainerStyled = styled.div `
13
+ width: 42px;
14
+ margin: 4px 6px 2px auto;
15
+ align-items: center;
16
+ justify-content: center;
17
+ `;
@@ -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,3 +1,5 @@
1
+ export * from './buttons';
2
+ export * from './DropDownListItem';
1
3
  export * from './RowActionMenuButton';
2
4
  export * from './SSICredentialCardView';
3
5
  export * from './SSICredentialMiniCardView';
@@ -5,7 +7,7 @@ export * from './SSIStatusLabel';
5
7
  export * from './SSIPrimaryButton';
6
8
  export * from './SSISecondaryButton';
7
9
  export * from './SSIIconButton';
8
- export * from './SSIDropDownList';
10
+ export * from './DropDownList';
9
11
  export * from './SSITypeLabel';
10
12
  export * from './SSITableViewHeader';
11
13
  export * from './SSITableView';
@@ -1,3 +1,5 @@
1
+ export * from './buttons';
2
+ export * from './DropDownListItem';
1
3
  export * from './RowActionMenuButton';
2
4
  export * from './SSICredentialCardView';
3
5
  export * from './SSICredentialMiniCardView';
@@ -5,7 +7,7 @@ export * from './SSIStatusLabel';
5
7
  export * from './SSIPrimaryButton';
6
8
  export * from './SSISecondaryButton';
7
9
  export * from './SSIIconButton';
8
- export * from './SSIDropDownList';
10
+ export * from './DropDownList';
9
11
  export * from './SSITypeLabel';
10
12
  export * from './SSITableViewHeader';
11
13
  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> = {
24
+ export type TableColumnActionGroup = {
23
25
  caption: string;
24
- actions: ActionButton<T>[];
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.104+2de960b",
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.104+2de960b",
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": "2de960bdb8327783e162afeaed458e49ac76290e"
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,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;