@trii/components 2.0.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 (33) hide show
  1. package/dist/cjs/index.js +14323 -0
  2. package/dist/cjs/index.js.map +1 -0
  3. package/dist/cjs/types/components/ContactInfoPopup/ContactInfoPopup.d.ts +13 -0
  4. package/dist/cjs/types/components/ContactInfoPopup/components/ContactMethod/ContactMethod.d.ts +10 -0
  5. package/dist/cjs/types/components/ContactInfoPopup/components/ContactMethod/index.d.ts +1 -0
  6. package/dist/cjs/types/components/ContactInfoPopup/components/Header/Header.d.ts +10 -0
  7. package/dist/cjs/types/components/ContactInfoPopup/components/Header/index.d.ts +1 -0
  8. package/dist/cjs/types/components/ContactInfoPopup/components/Properties/Properties.d.ts +7 -0
  9. package/dist/cjs/types/components/ContactInfoPopup/components/Properties/index.d.ts +1 -0
  10. package/dist/cjs/types/components/ContactInfoPopup/components/index.d.ts +3 -0
  11. package/dist/cjs/types/components/ContactInfoPopup/index.d.ts +1 -0
  12. package/dist/cjs/types/components/TextBox/TestBox.d.ts +8 -0
  13. package/dist/cjs/types/components/TextBox/index.d.ts +1 -0
  14. package/dist/cjs/types/components/index.d.ts +2 -0
  15. package/dist/cjs/types/index.d.ts +1 -0
  16. package/dist/esm/index.js +14302 -0
  17. package/dist/esm/index.js.map +1 -0
  18. package/dist/esm/types/components/ContactInfoPopup/ContactInfoPopup.d.ts +13 -0
  19. package/dist/esm/types/components/ContactInfoPopup/components/ContactMethod/ContactMethod.d.ts +10 -0
  20. package/dist/esm/types/components/ContactInfoPopup/components/ContactMethod/index.d.ts +1 -0
  21. package/dist/esm/types/components/ContactInfoPopup/components/Header/Header.d.ts +10 -0
  22. package/dist/esm/types/components/ContactInfoPopup/components/Header/index.d.ts +1 -0
  23. package/dist/esm/types/components/ContactInfoPopup/components/Properties/Properties.d.ts +7 -0
  24. package/dist/esm/types/components/ContactInfoPopup/components/Properties/index.d.ts +1 -0
  25. package/dist/esm/types/components/ContactInfoPopup/components/index.d.ts +3 -0
  26. package/dist/esm/types/components/ContactInfoPopup/index.d.ts +1 -0
  27. package/dist/esm/types/components/TextBox/TestBox.d.ts +8 -0
  28. package/dist/esm/types/components/TextBox/index.d.ts +1 -0
  29. package/dist/esm/types/components/index.d.ts +2 -0
  30. package/dist/esm/types/index.d.ts +1 -0
  31. package/dist/index.d.ts +24 -0
  32. package/package.json +99 -0
  33. package/readme +71 -0
@@ -0,0 +1,13 @@
1
+ /// <reference types="react" />
2
+ import { IContact } from '@trii/types/dist/Contacts';
3
+ export interface ContactInfoPopupProps {
4
+ open: boolean;
5
+ anchorEl: HTMLElement | null;
6
+ onClose: () => void;
7
+ t?: (key: string) => string;
8
+ contactData?: IContact;
9
+ avatarImgUrl?: string;
10
+ handleNavigateToContacts?: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
11
+ }
12
+ declare const ContactInfoPopup: ({ open, anchorEl, onClose, contactData, avatarImgUrl, handleNavigateToContacts, t, }: ContactInfoPopupProps) => import("react/jsx-runtime").JSX.Element;
13
+ export default ContactInfoPopup;
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ import { IContactAddress } from '@trii/types/dist/Contacts';
3
+ interface ContactProps {
4
+ contactList: IContactAddress[];
5
+ title?: string;
6
+ showTitle?: boolean;
7
+ icon: React.ReactNode;
8
+ }
9
+ declare const ContactMethod: ({ icon, contactList, title, showTitle, }: ContactProps) => import("react/jsx-runtime").JSX.Element;
10
+ export default ContactMethod;
@@ -0,0 +1 @@
1
+ export { default } from './ContactMethod';
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ type HeaderProps = {
3
+ imgUrl: string | undefined;
4
+ name: string | undefined;
5
+ contactId: string | undefined;
6
+ t: (key: string) => string;
7
+ handleNavigateToContacts: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void | undefined;
8
+ };
9
+ declare const Header: ({ handleNavigateToContacts, imgUrl, name, contactId, t, }: HeaderProps) => import("react/jsx-runtime").JSX.Element;
10
+ export default Header;
@@ -0,0 +1 @@
1
+ export { default } from './Header';
@@ -0,0 +1,7 @@
1
+ import { Property } from '@trii/types/dist/Contacts';
2
+ interface Props {
3
+ properties: Property[] | undefined;
4
+ title: string;
5
+ }
6
+ declare const Properties: ({ properties, title }: Props) => import("react/jsx-runtime").JSX.Element;
7
+ export default Properties;
@@ -0,0 +1 @@
1
+ export { default } from './Properties';
@@ -0,0 +1,3 @@
1
+ export { default as Header } from './Header';
2
+ export { default as ContactMethod } from './ContactMethod';
3
+ export { default as Properties } from './Properties';
@@ -0,0 +1 @@
1
+ export { default } from './ContactInfoPopup';
@@ -0,0 +1,8 @@
1
+ export interface TestBoxProps {
2
+ /**
3
+ * Color of the box background
4
+ */
5
+ bgColor?: 'red' | 'blue' | 'green';
6
+ }
7
+ declare const TestBox: ({ bgColor }: TestBoxProps) => import("react/jsx-runtime").JSX.Element;
8
+ export default TestBox;
@@ -0,0 +1 @@
1
+ export { default } from './TestBox';
@@ -0,0 +1,2 @@
1
+ export { default as TestBox } from './TextBox';
2
+ export { default as ContactInfoPopup } from './ContactInfoPopup';
@@ -0,0 +1 @@
1
+ export * from './components';
@@ -0,0 +1,24 @@
1
+ /// <reference types="react" />
2
+ import * as react_jsx_runtime from 'react/jsx-runtime';
3
+ import { IContact } from '@trii/types/dist/Contacts';
4
+
5
+ interface TestBoxProps {
6
+ /**
7
+ * Color of the box background
8
+ */
9
+ bgColor?: 'red' | 'blue' | 'green';
10
+ }
11
+ declare const TestBox: ({ bgColor }: TestBoxProps) => react_jsx_runtime.JSX.Element;
12
+
13
+ interface ContactInfoPopupProps {
14
+ open: boolean;
15
+ anchorEl: HTMLElement | null;
16
+ onClose: () => void;
17
+ t?: (key: string) => string;
18
+ contactData?: IContact;
19
+ avatarImgUrl?: string;
20
+ handleNavigateToContacts?: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
21
+ }
22
+ declare const ContactInfoPopup: ({ open, anchorEl, onClose, contactData, avatarImgUrl, handleNavigateToContacts, t, }: ContactInfoPopupProps) => react_jsx_runtime.JSX.Element;
23
+
24
+ export { ContactInfoPopup, TestBox };
package/package.json ADDED
@@ -0,0 +1,99 @@
1
+ {
2
+ "name": "@trii/components",
3
+ "version": "2.0.3",
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 ADDED
@@ -0,0 +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
+ ```