@sphereon/ui-components.ssi-react 0.2.1-unstable.24 → 0.2.1-unstable.25

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.
@@ -1,13 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { ButtonIcon, fontColors, OpacityStyleEnum } from '@sphereon/ui-components.core';
3
- import SSIAddIcon from '../../assets/icons/SSIAddIcon';
4
- import SSIFilterIcon from '../../assets/icons/SSIFilterIcon';
5
- import SSIArrowDownIcon from '../../assets/icons/SSIArrowDownIcon';
6
- import MeatBallsIcon from '../../assets/icons/MeatBallsIcon';
7
- import DeleteIcon from '../../assets/icons/DeleteIcon';
2
+ import { fontColors, OpacityStyleEnum } from '@sphereon/ui-components.core';
8
3
  import { IconButtonContainerStyled as Container, SSITextH3Styled as Caption } from '../../../styles';
9
- import { PencilIcon, ViewIcon } from '../../../index';
10
- import CopyIcon from '../../assets/icons/CopyIcon';
4
+ import { getIcon } from '../../../helpers/iconHelper';
11
5
  const IconButton = (props) => {
12
6
  const { caption, icon, iconColor = fontColors.dark } = props;
13
7
  const disabled = typeof props.disabled === 'function' ? props.disabled() : props.disabled ?? false;
@@ -20,26 +14,4 @@ const IconButton = (props) => {
20
14
  ...(disabled && { opacity: OpacityStyleEnum.DISABLED }),
21
15
  }, onClick: onClick, children: [getIcon(icon, iconColor), caption && _jsx(Caption, { children: caption })] }));
22
16
  };
23
- const getIcon = (icon, color) => {
24
- switch (icon) {
25
- case ButtonIcon.ADD:
26
- return _jsx(SSIAddIcon, { color: color });
27
- case ButtonIcon.ARROW_DOWN:
28
- return _jsx(SSIArrowDownIcon, { color: color });
29
- case ButtonIcon.MEATBALLS:
30
- return _jsx(MeatBallsIcon, { color: color });
31
- case ButtonIcon.EDIT:
32
- return _jsx(PencilIcon, { color: color });
33
- case ButtonIcon.COPY:
34
- return _jsx(CopyIcon, { color: color });
35
- case ButtonIcon.DELETE:
36
- return _jsx(DeleteIcon, { color: color });
37
- case ButtonIcon.FILTER:
38
- return _jsx(SSIFilterIcon, { color: color });
39
- case ButtonIcon.VIEW:
40
- return _jsx(ViewIcon, { color: color });
41
- default:
42
- return _jsx("div", {});
43
- }
44
- };
45
17
  export default IconButton;
@@ -1,17 +1,9 @@
1
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 { borderColors, ButtonIcon, fontColors } from '@sphereon/ui-components.core';
2
+ import { DropDownListItemCaptionContainerStyled as ListItemCaption, DropDownListItemContainerStyled as Container, DropDownListItemIconContainerStyled as IconContainer, } from '../../../styles/components';
3
+ import { borderColors, fontColors } from '@sphereon/ui-components.core';
4
+ import { getIcon } from '../../../helpers/iconHelper';
5
5
  const DropDownListItem = (props) => {
6
6
  const { disabled, label, icon, showBorder = false, fontColor = fontColors.dark, borderColor = borderColors.light, 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
7
  const onContainerClick = async (event) => {
16
8
  event.stopPropagation();
17
9
  if (onClick) {
@@ -0,0 +1,3 @@
1
+ import { ButtonIcon } from '@sphereon/ui-components.core';
2
+ import { ReactElement } from 'react';
3
+ export declare const getIcon: (icon: ButtonIcon, color?: string) => ReactElement;
@@ -0,0 +1,31 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { ButtonIcon, fontColors } from '@sphereon/ui-components.core';
3
+ import SSIAddIcon from '../components/assets/icons/SSIAddIcon';
4
+ import SSIArrowDownIcon from '../components/assets/icons/SSIArrowDownIcon';
5
+ import MeatBallsIcon from '../components/assets/icons/MeatBallsIcon';
6
+ import { PencilIcon, ViewIcon } from '../index';
7
+ import CopyIcon from '../components/assets/icons/CopyIcon';
8
+ import DeleteIcon from '../components/assets/icons/DeleteIcon';
9
+ import SSIFilterIcon from '../components/assets/icons/SSIFilterIcon';
10
+ export const getIcon = (icon, color = fontColors.dark) => {
11
+ switch (icon) {
12
+ case ButtonIcon.ADD:
13
+ return _jsx(SSIAddIcon, { color: color });
14
+ case ButtonIcon.ARROW_DOWN:
15
+ return _jsx(SSIArrowDownIcon, { color: color });
16
+ case ButtonIcon.MEATBALLS:
17
+ return _jsx(MeatBallsIcon, { color: color });
18
+ case ButtonIcon.EDIT:
19
+ return _jsx(PencilIcon, { color: color });
20
+ case ButtonIcon.COPY:
21
+ return _jsx(CopyIcon, { color: color });
22
+ case ButtonIcon.DELETE:
23
+ return _jsx(DeleteIcon, { color: color });
24
+ case ButtonIcon.FILTER:
25
+ return _jsx(SSIFilterIcon, { color: color });
26
+ case ButtonIcon.VIEW:
27
+ return _jsx(ViewIcon, { color: color });
28
+ default:
29
+ return _jsx("div", {});
30
+ }
31
+ };
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.2.1-unstable.24+0caf087",
4
+ "version": "0.2.1-unstable.25+a661e16",
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>",
@@ -40,7 +40,7 @@
40
40
  "@mui/styled-engine-sc": "^5.14.12",
41
41
  "@mui/system": "^5.15.12",
42
42
  "@mui/x-date-pickers": "^6.19.5",
43
- "@sphereon/ui-components.core": "0.2.1-unstable.24+0caf087",
43
+ "@sphereon/ui-components.core": "0.2.1-unstable.25+a661e16",
44
44
  "@tanstack/react-table": "^8.9.3",
45
45
  "react-json-tree": "^0.18.0",
46
46
  "react-loader-spinner": "5.4.5",
@@ -59,5 +59,5 @@
59
59
  "peerDependencies": {
60
60
  "react": ">= 18"
61
61
  },
62
- "gitHead": "0caf087a39a5e44e6f39281234b54525b4cb2db8"
62
+ "gitHead": "a661e1632fdb5e16f32f3bb1e60f44387a5bdd54"
63
63
  }