@omnsight/osint-entity-components 0.2.0 → 0.2.2

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.
@@ -0,0 +1,2 @@
1
+ .entity-avatar{border:2px solid var(--mantine-color-body);transition:all .2s}.entity-avatar:hover{transform:scale(1.25);box-shadow:0 4px 8px #0003;z-index:100!important}
2
+ /*$vite$:1*/
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.2.0",
6
+ "version": "0.2.2",
7
7
  "engines": {
8
8
  "node": ">=24.0.0"
9
9
  },
@@ -58,6 +58,7 @@
58
58
  "omni-osint-crud-client": "latest",
59
59
  "react": "^19.2.4",
60
60
  "react-dom": "^19.2.4",
61
+ "react-hook-form": "^7.72.0",
61
62
  "react-i18next": "^16.6.6"
62
63
  },
63
64
  "devDependencies": {
@@ -1,4 +1,4 @@
1
- import { Group, Paper, RingProgress, Stack, Text, Title, Textarea, ScrollArea } from "@mantine/core";
1
+ import { Group, Paper, RingProgress, Stack, Text, Title, ScrollArea } from "@mantine/core";
2
2
  import { type MonitoringSource } from "omni-monitoring-client";
3
3
  import { useTranslation } from "react-i18next";
4
4
  import React from "react";
@@ -8,12 +8,14 @@ interface EventIconSelectorProps {
8
8
  data: Event;
9
9
  value?: string | null;
10
10
  onChange: (value: string | null) => void;
11
+ error?: string;
11
12
  }
12
13
 
13
14
  export const EventIconSelector: React.FC<EventIconSelectorProps> = ({
14
15
  data,
15
16
  value,
16
17
  onChange,
18
+ error,
17
19
  }) => {
18
20
  const { t } = useTranslation();
19
21
 
@@ -26,10 +28,11 @@ export const EventIconSelector: React.FC<EventIconSelectorProps> = ({
26
28
  <Select
27
29
  leftSection={<EventIcon event={data} />}
28
30
  defaultValue={translatedOptions[0].value}
29
- value={value}
31
+ value={value ?? ""}
30
32
  onChange={onChange}
31
33
  data={translatedOptions}
32
34
  style={{ flex: 1 }}
35
+ error={error}
33
36
  />
34
37
  );
35
38
  };
@@ -37,11 +40,13 @@ export const EventIconSelector: React.FC<EventIconSelectorProps> = ({
37
40
  interface EventColorSelectorProps {
38
41
  value?: string | null;
39
42
  onChange: (value: string | null) => void;
43
+ error?: string;
40
44
  }
41
45
 
42
46
  export const EventColorSelector: React.FC<EventColorSelectorProps> = ({
43
47
  value,
44
48
  onChange,
49
+ error,
45
50
  }) => {
46
51
  const colors = [
47
52
  "#0089ff",
@@ -55,10 +60,12 @@ export const EventColorSelector: React.FC<EventColorSelectorProps> = ({
55
60
 
56
61
  return (
57
62
  <ColorInput
58
- value={value || colors[0]}
63
+ defaultValue={colors[0]}
64
+ value={value ?? ""}
59
65
  onChange={onChange}
60
66
  swatches={colors}
61
67
  style={{ flex: 1 }}
68
+ error={error}
62
69
  />
63
70
  );
64
71
  };
@@ -90,7 +97,7 @@ export const EventIconSelect: React.FC<EventIconSelectProps> = ({
90
97
  value={value.type}
91
98
  onChange={handleTypeChange}
92
99
  />
93
- <EventColorSelector
100
+ <EventColorSelector
94
101
  value={String(value.attributes?.icon_color)}
95
102
  onChange={handleColorChange}
96
103
  />
@@ -8,11 +8,12 @@ interface OrganizationIconSelectorProps {
8
8
  data: Organization;
9
9
  value?: string | null;
10
10
  onChange: (value: string | null) => void;
11
+ error?: string;
11
12
  }
12
13
 
13
14
  export const OrganizationIconSelector: React.FC<
14
15
  OrganizationIconSelectorProps
15
- > = ({ data, value, onChange }) => {
16
+ > = ({ data, value, onChange, error }) => {
16
17
  const { t } = useTranslation();
17
18
 
18
19
  const translatedOptions = ICON_OPTIONS.map((option) => ({
@@ -24,9 +25,10 @@ export const OrganizationIconSelector: React.FC<
24
25
  <Select
25
26
  leftSection={<OrganizationIcon organization={data} />}
26
27
  defaultValue={translatedOptions[0].value}
27
- value={value}
28
+ value={value ?? ""}
28
29
  onChange={onChange}
29
30
  data={translatedOptions}
31
+ error={error}
30
32
  style={{ flex: 1 }}
31
33
  />
32
34
  );
@@ -35,11 +37,12 @@ export const OrganizationIconSelector: React.FC<
35
37
  interface OrganizationColorSelectorProps {
36
38
  value?: string | null;
37
39
  onChange: (value: string | null) => void;
40
+ error?: string;
38
41
  }
39
42
 
40
43
  export const OrganizationColorSelector: React.FC<
41
44
  OrganizationColorSelectorProps
42
- > = ({ value, onChange }) => {
45
+ > = ({ value, onChange, error }) => {
43
46
  const colors = [
44
47
  "#0089ff",
45
48
  "#ff0000",
@@ -52,10 +55,12 @@ export const OrganizationColorSelector: React.FC<
52
55
 
53
56
  return (
54
57
  <ColorInput
55
- value={value || colors[0]}
58
+ defaultValue={colors[0]}
59
+ value={value ?? ""}
56
60
  onChange={onChange}
57
61
  swatches={colors}
58
62
  style={{ flex: 1 }}
63
+ error={error}
59
64
  />
60
65
  );
61
66
  };
@@ -1,19 +1,21 @@
1
- import { type Person } from 'omni-osint-crud-client';
2
- import { useTranslation } from 'react-i18next';
3
- import { Group, Select, ColorInput } from '@mantine/core';
4
- import { ICON_OPTIONS } from './icons';
5
- import { PersonIcon } from './Icon';
1
+ import { type Person } from "omni-osint-crud-client";
2
+ import { useTranslation } from "react-i18next";
3
+ import { Group, Select, ColorInput } from "@mantine/core";
4
+ import { ICON_OPTIONS } from "./icons";
5
+ import { PersonIcon } from "./Icon";
6
6
 
7
7
  interface PersonIconSelectorProps {
8
8
  data: Person;
9
9
  value?: string | null;
10
10
  onChange: (value: string | null) => void;
11
+ error?: string;
11
12
  }
12
13
 
13
14
  export const PersonIconSelector: React.FC<PersonIconSelectorProps> = ({
14
15
  data,
15
16
  value,
16
17
  onChange,
18
+ error,
17
19
  }) => {
18
20
  const { t } = useTranslation();
19
21
 
@@ -26,10 +28,11 @@ export const PersonIconSelector: React.FC<PersonIconSelectorProps> = ({
26
28
  <Select
27
29
  leftSection={<PersonIcon person={data} />}
28
30
  defaultValue={translatedOptions[0].value}
29
- value={value}
31
+ value={value ?? ""}
30
32
  onChange={onChange}
31
33
  data={translatedOptions}
32
34
  style={{ flex: 1 }}
35
+ error={error}
33
36
  />
34
37
  );
35
38
  };
@@ -37,11 +40,13 @@ export const PersonIconSelector: React.FC<PersonIconSelectorProps> = ({
37
40
  interface PersonColorSelectorProps {
38
41
  value?: string | null;
39
42
  onChange: (value: string | null) => void;
43
+ error?: string;
40
44
  }
41
45
 
42
46
  export const PersonColorSelector: React.FC<PersonColorSelectorProps> = ({
43
47
  value,
44
48
  onChange,
49
+ error,
45
50
  }) => {
46
51
  const colors = [
47
52
  "#0089ff",
@@ -55,10 +60,12 @@ export const PersonColorSelector: React.FC<PersonColorSelectorProps> = ({
55
60
 
56
61
  return (
57
62
  <ColorInput
58
- value={value || colors[0]}
63
+ defaultValue={colors[0]}
64
+ value={value ?? ""}
59
65
  onChange={onChange}
60
66
  swatches={colors}
61
67
  style={{ flex: 1 }}
68
+ error={error}
62
69
  />
63
70
  );
64
71
  };
@@ -8,12 +8,14 @@ interface SourceIconSelectorProps {
8
8
  data: Source;
9
9
  value?: string | null;
10
10
  onChange: (value: string | null) => void;
11
+ error?: string;
11
12
  }
12
13
 
13
14
  export const SourceIconSelector: React.FC<SourceIconSelectorProps> = ({
14
15
  data,
15
16
  value,
16
17
  onChange,
18
+ error,
17
19
  }) => {
18
20
  const { t } = useTranslation();
19
21
 
@@ -26,10 +28,11 @@ export const SourceIconSelector: React.FC<SourceIconSelectorProps> = ({
26
28
  <Select
27
29
  leftSection={<SourceIcon source={data} />}
28
30
  defaultValue={translatedOptions[0].value}
29
- value={value}
31
+ value={value ?? ""}
30
32
  onChange={onChange}
31
33
  data={translatedOptions}
32
34
  style={{ flex: 1 }}
35
+ error={error}
33
36
  />
34
37
  );
35
38
  };
@@ -37,11 +40,13 @@ export const SourceIconSelector: React.FC<SourceIconSelectorProps> = ({
37
40
  interface SourceColorSelectorProps {
38
41
  value?: string | null;
39
42
  onChange: (value: string | null) => void;
43
+ error?: string;
40
44
  }
41
45
 
42
46
  export const SourceColorSelector: React.FC<SourceColorSelectorProps> = ({
43
47
  value,
44
48
  onChange,
49
+ error,
45
50
  }) => {
46
51
  const colors = [
47
52
  "#ababab",
@@ -55,10 +60,12 @@ export const SourceColorSelector: React.FC<SourceColorSelectorProps> = ({
55
60
 
56
61
  return (
57
62
  <ColorInput
58
- value={value || colors[0]}
63
+ defaultValue={colors[0]}
64
+ value={value ?? ""}
59
65
  onChange={onChange}
60
66
  swatches={colors}
61
67
  style={{ flex: 1 }}
68
+ error={error}
62
69
  />
63
70
  );
64
71
  };
@@ -91,7 +98,7 @@ export const SourceIconSelect: React.FC<SourceIconSelectProps> = ({
91
98
  onChange={handleTypeChange}
92
99
  />
93
100
  <SourceColorSelector
94
- value={String(value.attributes?.icon_color)}
101
+ value={String(value.attributes?.icon_color ?? "")}
95
102
  onChange={handleColorChange}
96
103
  />
97
104
  </Group>
@@ -8,12 +8,14 @@ interface WebsiteIconSelectorProps {
8
8
  data: Website;
9
9
  value?: string | null;
10
10
  onChange: (value: string | null) => void;
11
+ error?: string;
11
12
  }
12
13
 
13
14
  export const WebsiteIconSelector: React.FC<WebsiteIconSelectorProps> = ({
14
15
  data,
15
16
  value,
16
17
  onChange,
18
+ error,
17
19
  }) => {
18
20
  const { t } = useTranslation();
19
21
 
@@ -26,10 +28,11 @@ export const WebsiteIconSelector: React.FC<WebsiteIconSelectorProps> = ({
26
28
  <Select
27
29
  leftSection={<WebsiteIcon website={data} />}
28
30
  defaultValue={translatedOptions[0].value}
29
- value={value}
31
+ value={value ?? ""}
30
32
  onChange={onChange}
31
33
  data={translatedOptions}
32
34
  style={{ flex: 1 }}
35
+ error={error}
33
36
  />
34
37
  );
35
38
  };
@@ -37,11 +40,13 @@ export const WebsiteIconSelector: React.FC<WebsiteIconSelectorProps> = ({
37
40
  interface WebsiteColorSelectorProps {
38
41
  value?: string | null;
39
42
  onChange: (value: string | null) => void;
43
+ error?: string;
40
44
  }
41
45
 
42
46
  export const WebsiteColorSelector: React.FC<WebsiteColorSelectorProps> = ({
43
47
  value,
44
48
  onChange,
49
+ error,
45
50
  }) => {
46
51
  const colors = [
47
52
  "#0089ff",
@@ -55,10 +60,12 @@ export const WebsiteColorSelector: React.FC<WebsiteColorSelectorProps> = ({
55
60
 
56
61
  return (
57
62
  <ColorInput
58
- value={value || colors[0]}
63
+ defaultValue={colors[0]}
64
+ value={value ?? ""}
59
65
  onChange={onChange}
60
66
  swatches={colors}
61
67
  style={{ flex: 1 }}
68
+ error={error}
62
69
  />
63
70
  );
64
71
  };