@trii/components 2.0.8 → 2.0.10

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 (39) hide show
  1. package/dist/cjs/index.js +617 -40
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/cjs/types/components/ContactInfoPopup/ContactInfoPopup.d.ts +4 -3
  4. package/dist/cjs/types/components/ContactInfoPopup/components/BusinessSection/BusinessSection.d.ts +7 -0
  5. package/dist/cjs/types/components/ContactInfoPopup/components/BusinessSection/index.d.ts +1 -0
  6. package/dist/cjs/types/components/ContactInfoPopup/components/Header/Header.d.ts +2 -1
  7. package/dist/cjs/types/components/ContactInfoPopup/components/LabelsSection/LabelsSection.d.ts +7 -0
  8. package/dist/cjs/types/components/ContactInfoPopup/components/LabelsSection/index.d.ts +1 -0
  9. package/dist/cjs/types/components/ContactInfoPopup/components/MemberItem/MemberItem.d.ts +5 -0
  10. package/dist/cjs/types/components/ContactInfoPopup/components/MemberItem/index.d.ts +1 -0
  11. package/dist/cjs/types/components/ContactInfoPopup/components/MembersSection/MembersSection.d.ts +7 -0
  12. package/dist/cjs/types/components/ContactInfoPopup/components/MembersSection/components/MemberItem/MemberItem.d.ts +4 -0
  13. package/dist/cjs/types/components/ContactInfoPopup/components/MembersSection/components/MemberItem/index.d.ts +1 -0
  14. package/dist/cjs/types/components/ContactInfoPopup/components/MembersSection/components/index.d.ts +1 -0
  15. package/dist/cjs/types/components/ContactInfoPopup/components/MembersSection/index.d.ts +1 -0
  16. package/dist/cjs/types/components/ContactInfoPopup/components/index.d.ts +3 -0
  17. package/dist/cjs/types/components/ContactInfoPopup/types/is-business.typeguard.d.ts +7 -0
  18. package/dist/cjs/types/components/ContactInfoPopup/types/is-contact.typeguard.d.ts +7 -0
  19. package/dist/esm/index.js +617 -40
  20. package/dist/esm/index.js.map +1 -1
  21. package/dist/esm/types/components/ContactInfoPopup/ContactInfoPopup.d.ts +4 -3
  22. package/dist/esm/types/components/ContactInfoPopup/components/BusinessSection/BusinessSection.d.ts +7 -0
  23. package/dist/esm/types/components/ContactInfoPopup/components/BusinessSection/index.d.ts +1 -0
  24. package/dist/esm/types/components/ContactInfoPopup/components/Header/Header.d.ts +2 -1
  25. package/dist/esm/types/components/ContactInfoPopup/components/LabelsSection/LabelsSection.d.ts +7 -0
  26. package/dist/esm/types/components/ContactInfoPopup/components/LabelsSection/index.d.ts +1 -0
  27. package/dist/esm/types/components/ContactInfoPopup/components/MemberItem/MemberItem.d.ts +5 -0
  28. package/dist/esm/types/components/ContactInfoPopup/components/MemberItem/index.d.ts +1 -0
  29. package/dist/esm/types/components/ContactInfoPopup/components/MembersSection/MembersSection.d.ts +7 -0
  30. package/dist/esm/types/components/ContactInfoPopup/components/MembersSection/components/MemberItem/MemberItem.d.ts +4 -0
  31. package/dist/esm/types/components/ContactInfoPopup/components/MembersSection/components/MemberItem/index.d.ts +1 -0
  32. package/dist/esm/types/components/ContactInfoPopup/components/MembersSection/components/index.d.ts +1 -0
  33. package/dist/esm/types/components/ContactInfoPopup/components/MembersSection/index.d.ts +1 -0
  34. package/dist/esm/types/components/ContactInfoPopup/components/index.d.ts +3 -0
  35. package/dist/esm/types/components/ContactInfoPopup/types/is-business.typeguard.d.ts +7 -0
  36. package/dist/esm/types/components/ContactInfoPopup/types/is-contact.typeguard.d.ts +7 -0
  37. package/dist/index.d.ts +4 -3
  38. package/package.json +99 -99
  39. package/readme +71 -71
@@ -1,13 +1,14 @@
1
- import { IContact } from '@trii/types/dist/Contacts';
1
+ import { IBusiness, IContact } from '@trii/types/dist/Contacts';
2
2
  import { SxProps, Theme } from '@mui/material';
3
3
  export interface ContactInfoPopupProps {
4
4
  open: boolean;
5
5
  anchorEl: HTMLElement | null;
6
6
  onClose: () => void;
7
7
  t?: (key: string) => string;
8
- contactData?: IContact;
8
+ contactData?: IContact | IBusiness;
9
9
  avatarImgUrl?: string;
10
10
  sx?: SxProps<Theme>;
11
+ navigate: (path: string) => void;
11
12
  }
12
- declare const ContactInfoPopup: ({ open, anchorEl, onClose, contactData, avatarImgUrl, t, }: ContactInfoPopupProps) => import("react/jsx-runtime").JSX.Element;
13
+ declare const ContactInfoPopup: ({ open, anchorEl, onClose, contactData, avatarImgUrl, navigate, t, }: ContactInfoPopupProps) => import("react/jsx-runtime").JSX.Element;
13
14
  export default ContactInfoPopup;
@@ -0,0 +1,7 @@
1
+ import { IContact } from '@trii/types/dist/Contacts';
2
+ interface BusinessSectionProps {
3
+ contactData?: IContact;
4
+ title: string;
5
+ }
6
+ declare const BusinessSection: ({ contactData, title }: BusinessSectionProps) => import("react/jsx-runtime").JSX.Element | null;
7
+ export default BusinessSection;
@@ -0,0 +1 @@
1
+ export { default } from './BusinessSection';
@@ -2,6 +2,7 @@ type HeaderProps = {
2
2
  imgUrl: string | undefined;
3
3
  name: string | undefined;
4
4
  contactId: string | undefined;
5
+ navigate: (path: string) => void;
5
6
  };
6
- declare const Header: ({ imgUrl, name, contactId, }: HeaderProps) => import("react/jsx-runtime").JSX.Element;
7
+ declare const Header: ({ imgUrl, name, contactId, navigate }: HeaderProps) => import("react/jsx-runtime").JSX.Element;
7
8
  export default Header;
@@ -0,0 +1,7 @@
1
+ import { IContact, IBusiness } from '@trii/types/dist/Contacts';
2
+ interface LabelsSectionProps {
3
+ contactData?: IContact | IBusiness;
4
+ title: string;
5
+ }
6
+ declare const LabelsSection: ({ contactData, title }: LabelsSectionProps) => import("react/jsx-runtime").JSX.Element | null;
7
+ export default LabelsSection;
@@ -0,0 +1 @@
1
+ export { default } from './LabelsSection';
@@ -0,0 +1,5 @@
1
+ import { IContactInfo } from '@trii/types/dist/Contacts';
2
+ declare const MemberItem: ({ data }: {
3
+ data: IContactInfo;
4
+ }) => import("react/jsx-runtime").JSX.Element;
5
+ export default MemberItem;
@@ -0,0 +1 @@
1
+ export { default } from './MemberItem';
@@ -0,0 +1,7 @@
1
+ import { IBusiness } from '@trii/types/dist/Contacts';
2
+ interface MembersSectionProps {
3
+ contactData?: IBusiness;
4
+ title: string;
5
+ }
6
+ declare const MembersSection: ({ contactData, title }: MembersSectionProps) => import("react/jsx-runtime").JSX.Element | null;
7
+ export default MembersSection;
@@ -0,0 +1,4 @@
1
+ declare const MemberItem: ({ name }: {
2
+ name: string;
3
+ }) => import("react/jsx-runtime").JSX.Element;
4
+ export default MemberItem;
@@ -0,0 +1 @@
1
+ export { default as MemberItem } from './MemberItem';
@@ -0,0 +1 @@
1
+ export { default } from './MembersSection';
@@ -1,3 +1,6 @@
1
1
  export { default as Header } from './Header';
2
2
  export { default as ContactMethod } from './ContactMethod';
3
3
  export { default as Properties } from './Properties';
4
+ export { default as LabelsSection } from './LabelsSection';
5
+ export { default as BusinessSection } from './BusinessSection';
6
+ export { default as MembersSection } from './MembersSection';
@@ -0,0 +1,7 @@
1
+ import { IBusiness } from '@trii/types/dist/Contacts/contacts';
2
+ /**
3
+ * Type guard to check if an object is an IBusiness
4
+ * @param obj The object to check
5
+ * @returns True if the object is an IBusiness
6
+ */
7
+ export declare function isBusiness(obj: any): obj is IBusiness;
@@ -0,0 +1,7 @@
1
+ import { IContact } from '@trii/types/dist/Contacts/contacts';
2
+ /**
3
+ * Type guard to check if an object is an IContact
4
+ * @param obj The object to check
5
+ * @returns True if the object is an IContact
6
+ */
7
+ export declare function isContact(obj: any): obj is IContact;
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { IContact } from '@trii/types/dist/Contacts';
2
+ import { IContact, IBusiness } from '@trii/types/dist/Contacts';
3
3
  import { SxProps, Theme } from '@mui/material';
4
4
 
5
5
  interface TestBoxProps {
@@ -15,10 +15,11 @@ interface ContactInfoPopupProps {
15
15
  anchorEl: HTMLElement | null;
16
16
  onClose: () => void;
17
17
  t?: (key: string) => string;
18
- contactData?: IContact;
18
+ contactData?: IContact | IBusiness;
19
19
  avatarImgUrl?: string;
20
20
  sx?: SxProps<Theme>;
21
+ navigate: (path: string) => void;
21
22
  }
22
- declare const ContactInfoPopup: ({ open, anchorEl, onClose, contactData, avatarImgUrl, t, }: ContactInfoPopupProps) => react_jsx_runtime.JSX.Element;
23
+ declare const ContactInfoPopup: ({ open, anchorEl, onClose, contactData, avatarImgUrl, navigate, t, }: ContactInfoPopupProps) => react_jsx_runtime.JSX.Element;
23
24
 
24
25
  export { ContactInfoPopup, TestBox };
package/package.json CHANGED
@@ -1,99 +1,99 @@
1
- {
2
- "name": "@trii/components",
3
- "version": "2.0.8",
4
- "description": "Trii components package",
5
- "main": "dist/cjs/index.js",
6
- "module": "dist/esm/index.js",
7
- "types": "dist/index.d.ts",
8
- "files": [
9
- "dist"
10
- ],
11
- "scripts": {
12
- "dev": "rollup -c --watch",
13
- "build": "rollup -c",
14
- "test": "jest --watchAll --verbose",
15
- "storybook": "storybook dev -p 6006",
16
- "build-storybook": "storybook build"
17
- },
18
- "author": "Ezequiel",
19
- "license": "MIT",
20
- "babel": {
21
- "sourceType": "unambiguous",
22
- "presets": [
23
- [
24
- "@babel/preset-env",
25
- {
26
- "targets": {
27
- "chrome": 100,
28
- "safari": 15,
29
- "firefox": 91
30
- }
31
- }
32
- ],
33
- [
34
- "@babel/preset-react",
35
- {
36
- "runtime": "automatic"
37
- }
38
- ],
39
- "@babel/preset-typescript"
40
- ]
41
- },
42
- "postcss": {
43
- "plugins": {
44
- "postcss-import": {}
45
- }
46
- },
47
- "devDependencies": {
48
- "@babel/core": "^7.23.0",
49
- "@babel/preset-env": "^7.22.20",
50
- "@babel/preset-react": "^7.22.15",
51
- "@babel/preset-typescript": "^7.23.0",
52
- "@emotion/react": "^11.11.4",
53
- "@emotion/styled": "^11.11.5",
54
- "@fontsource/material-icons": "^5.0.18",
55
- "@fontsource/roboto": "^5.0.13",
56
- "@mui/icons-material": "^5.15.15",
57
- "@mui/material": "^5.15.15",
58
- "@rollup/plugin-commonjs": "^25.0.4",
59
- "@rollup/plugin-node-resolve": "^15.2.1",
60
- "@rollup/plugin-typescript": "^11.1.4",
61
- "@storybook/addon-essentials": "^8.5.3",
62
- "@storybook/addon-interactions": "^8.5.3",
63
- "@storybook/addon-links": "^8.5.3",
64
- "@storybook/addon-onboarding": "^8.5.3",
65
- "@storybook/addon-themes": "^8.5.3",
66
- "@storybook/addon-webpack5-compiler-babel": "^3.0.5",
67
- "@storybook/addon-webpack5-compiler-swc": "^2.0.0",
68
- "@storybook/blocks": "^8.5.3",
69
- "@storybook/react": "^8.5.3",
70
- "@storybook/react-webpack5": "^8.5.3",
71
- "@storybook/test": "^8.5.3",
72
- "@testing-library/jest-dom": "^6.1.3",
73
- "@testing-library/react": "^14.0.0",
74
- "@types/jest": "^29.5.5",
75
- "@types/react": "^18.2.23",
76
- "babel-jest": "^29.7.0",
77
- "jest": "^29.7.0",
78
- "jest-environment-jsdom": "^29.7.0",
79
- "postcss": "^8.4.31",
80
- "postcss-import": "^15.1.0",
81
- "react": "^18.2.0",
82
- "react-dom": "^18.2.0",
83
- "rollup": "^3.29.4",
84
- "rollup-plugin-dts": "^6.0.2",
85
- "rollup-plugin-postcss": "^4.0.2",
86
- "storybook": "^8.5.3",
87
- "tslib": "^2.6.2",
88
- "typescript": "^5.2.2"
89
- },
90
- "peerDependencies": {
91
- "@emotion/react": "^11.11.4",
92
- "react": ">=17.0.2 <19.0.0",
93
- "react-dom": ">=17.0.2 <19.0.0"
94
- },
95
- "dependencies": {
96
- "@trii/types": "^2.10.398",
97
- "moment": "^2.30.1"
98
- }
99
- }
1
+ {
2
+ "name": "@trii/components",
3
+ "version": "2.0.10",
4
+ "description": "Trii components package",
5
+ "main": "dist/cjs/index.js",
6
+ "module": "dist/esm/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "files": [
9
+ "dist"
10
+ ],
11
+ "scripts": {
12
+ "dev": "rollup -c --watch",
13
+ "build": "rollup -c",
14
+ "test": "jest --watchAll --verbose",
15
+ "storybook": "storybook dev -p 6006",
16
+ "build-storybook": "storybook build"
17
+ },
18
+ "author": "Ezequiel",
19
+ "license": "MIT",
20
+ "babel": {
21
+ "sourceType": "unambiguous",
22
+ "presets": [
23
+ [
24
+ "@babel/preset-env",
25
+ {
26
+ "targets": {
27
+ "chrome": 100,
28
+ "safari": 15,
29
+ "firefox": 91
30
+ }
31
+ }
32
+ ],
33
+ [
34
+ "@babel/preset-react",
35
+ {
36
+ "runtime": "automatic"
37
+ }
38
+ ],
39
+ "@babel/preset-typescript"
40
+ ]
41
+ },
42
+ "postcss": {
43
+ "plugins": {
44
+ "postcss-import": {}
45
+ }
46
+ },
47
+ "devDependencies": {
48
+ "@babel/core": "^7.23.0",
49
+ "@babel/preset-env": "^7.22.20",
50
+ "@babel/preset-react": "^7.22.15",
51
+ "@babel/preset-typescript": "^7.23.0",
52
+ "@emotion/react": "^11.11.4",
53
+ "@emotion/styled": "^11.11.5",
54
+ "@fontsource/material-icons": "^5.0.18",
55
+ "@fontsource/roboto": "^5.0.13",
56
+ "@mui/icons-material": "^5.15.15",
57
+ "@mui/material": "^5.15.15",
58
+ "@rollup/plugin-commonjs": "^25.0.4",
59
+ "@rollup/plugin-node-resolve": "^15.2.1",
60
+ "@rollup/plugin-typescript": "^11.1.4",
61
+ "@storybook/addon-essentials": "^8.5.3",
62
+ "@storybook/addon-interactions": "^8.5.3",
63
+ "@storybook/addon-links": "^8.5.3",
64
+ "@storybook/addon-onboarding": "^8.5.3",
65
+ "@storybook/addon-themes": "^8.5.3",
66
+ "@storybook/addon-webpack5-compiler-babel": "^3.0.5",
67
+ "@storybook/addon-webpack5-compiler-swc": "^2.0.0",
68
+ "@storybook/blocks": "^8.5.3",
69
+ "@storybook/react": "^8.5.3",
70
+ "@storybook/react-webpack5": "^8.5.3",
71
+ "@storybook/test": "^8.5.3",
72
+ "@testing-library/jest-dom": "^6.1.3",
73
+ "@testing-library/react": "^14.0.0",
74
+ "@types/jest": "^29.5.5",
75
+ "@types/react": "^18.2.23",
76
+ "babel-jest": "^29.7.0",
77
+ "jest": "^29.7.0",
78
+ "jest-environment-jsdom": "^29.7.0",
79
+ "postcss": "^8.4.31",
80
+ "postcss-import": "^15.1.0",
81
+ "react": "^18.2.0",
82
+ "react-dom": "^18.2.0",
83
+ "rollup": "^3.29.4",
84
+ "rollup-plugin-dts": "^6.0.2",
85
+ "rollup-plugin-postcss": "^4.0.2",
86
+ "storybook": "^8.5.3",
87
+ "tslib": "^2.6.2",
88
+ "typescript": "^5.2.2"
89
+ },
90
+ "peerDependencies": {
91
+ "@emotion/react": "^11.11.4",
92
+ "react": ">=17.0.2 <19.0.0",
93
+ "react-dom": ">=17.0.2 <19.0.0"
94
+ },
95
+ "dependencies": {
96
+ "@trii/types": "^2.10.398",
97
+ "moment": "^2.30.1"
98
+ }
99
+ }
package/readme CHANGED
@@ -1,71 +1,71 @@
1
- # Trii Components
2
-
3
- ## Introduction
4
-
5
- This project contains reusable components for the Trii application.
6
-
7
- ## Prerequisites
8
-
9
- - Node.js (v14 or higher)
10
- - npm (v6 or higher) or yarn (v1.22 or higher)
11
-
12
- ## Installation
13
-
14
- 1. Clone the repository:
15
- ```sh
16
- git clone https://github.com/yourusername/trii-components.git
17
- ```
18
- 2. Navigate to the project directory:
19
- ```sh
20
- cd trii-components
21
- ```
22
- 3. Install dependencies:
23
- ```sh
24
- npm install
25
- ```
26
- or
27
- ```sh
28
- yarn install
29
- ```
30
-
31
- ## Running the Project
32
-
33
- To start the development server, run:
34
-
35
- ```sh
36
- npm run storybook
37
- ```
38
-
39
- or
40
-
41
- ```sh
42
- yarn storybook
43
- ```
44
-
45
- ## Building the Project
46
-
47
- To build the project, run:
48
-
49
- ```sh
50
- npm run build
51
- ```
52
-
53
- or
54
-
55
- ```sh
56
- yarn build
57
- ```
58
-
59
- ## Upload build to NPM
60
-
61
- To upload the build to NPM, run:
62
-
63
- ```sh
64
- npm publish
65
- ```
66
-
67
- or
68
-
69
- ```sh
70
- yarn publish
71
- ```
1
+ # Trii Components
2
+
3
+ ## Introduction
4
+
5
+ This project contains reusable components for the Trii application.
6
+
7
+ ## Prerequisites
8
+
9
+ - Node.js (v14 or higher)
10
+ - npm (v6 or higher) or yarn (v1.22 or higher)
11
+
12
+ ## Installation
13
+
14
+ 1. Clone the repository:
15
+ ```sh
16
+ git clone https://github.com/yourusername/trii-components.git
17
+ ```
18
+ 2. Navigate to the project directory:
19
+ ```sh
20
+ cd trii-components
21
+ ```
22
+ 3. Install dependencies:
23
+ ```sh
24
+ npm install
25
+ ```
26
+ or
27
+ ```sh
28
+ yarn install
29
+ ```
30
+
31
+ ## Running the Project
32
+
33
+ To start the development server, run:
34
+
35
+ ```sh
36
+ npm run storybook
37
+ ```
38
+
39
+ or
40
+
41
+ ```sh
42
+ yarn storybook
43
+ ```
44
+
45
+ ## Building the Project
46
+
47
+ To build the project, run:
48
+
49
+ ```sh
50
+ npm run build
51
+ ```
52
+
53
+ or
54
+
55
+ ```sh
56
+ yarn build
57
+ ```
58
+
59
+ ## Upload build to NPM
60
+
61
+ To upload the build to NPM, run:
62
+
63
+ ```sh
64
+ npm publish
65
+ ```
66
+
67
+ or
68
+
69
+ ```sh
70
+ yarn publish
71
+ ```