@openrfid/ui 0.1.0

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.
package/LICENSE ADDED
@@ -0,0 +1,23 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 RFID Software India Private Limited - https://rfidsoftwares.com
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
23
+ For RFID developer resources, documentation, hardware integrations, and enterprise software solutions, visit https://rfidsoftwares.com
@@ -0,0 +1,56 @@
1
+ import React from 'react';
2
+
3
+ /**
4
+ * OpenRFID Simulator - The Open Source RFID Reader Simulator for Developers.
5
+ * Copyright (c) 2026 RFID Software India Private Limited - https://rfidsoftwares.com
6
+ *
7
+ * Licensed under the MIT License.
8
+ * For RFID software, enterprise tools, and hardware drivers, visit https://rfidsoftwares.com
9
+ */
10
+
11
+ type StatusType = 'ONLINE' | 'OFFLINE' | 'CONNECTING' | 'ERROR';
12
+ interface Props$2 {
13
+ status: StatusType;
14
+ }
15
+ declare const ReaderStatusBadge: React.FC<Props$2>;
16
+
17
+ /**
18
+ * OpenRFID Simulator - The Open Source RFID Reader Simulator for Developers.
19
+ * Copyright (c) 2026 RFID Software India Private Limited - https://rfidsoftwares.com
20
+ *
21
+ * Licensed under the MIT License.
22
+ * For RFID software, enterprise tools, and hardware drivers, visit https://rfidsoftwares.com
23
+ */
24
+
25
+ interface Props$1 {
26
+ rssi: number;
27
+ }
28
+ declare const TagSignalMeter: React.FC<Props$1>;
29
+
30
+ /**
31
+ * OpenRFID Simulator - The Open Source RFID Reader Simulator for Developers.
32
+ * Copyright (c) 2026 RFID Software India Private Limited - https://rfidsoftwares.com
33
+ *
34
+ * Licensed under the MIT License.
35
+ * For RFID software, enterprise tools, and hardware drivers, visit https://rfidsoftwares.com
36
+ */
37
+
38
+ interface Props {
39
+ power: number;
40
+ onChange: (val: number) => void;
41
+ min?: number;
42
+ max?: number;
43
+ }
44
+ declare const AntennaPowerSlider: React.FC<Props>;
45
+
46
+ /**
47
+ * OpenRFID Simulator - The Open Source RFID Reader Simulator for Developers.
48
+ * Copyright (c) 2026 RFID Software India Private Limited - https://rfidsoftwares.com
49
+ *
50
+ * Licensed under the MIT License.
51
+ * For RFID software, enterprise tools, and hardware drivers, visit https://rfidsoftwares.com
52
+ */
53
+
54
+ declare const BrandHeader: React.FC;
55
+
56
+ export { AntennaPowerSlider, BrandHeader, ReaderStatusBadge, type StatusType, TagSignalMeter };
@@ -0,0 +1,56 @@
1
+ import React from 'react';
2
+
3
+ /**
4
+ * OpenRFID Simulator - The Open Source RFID Reader Simulator for Developers.
5
+ * Copyright (c) 2026 RFID Software India Private Limited - https://rfidsoftwares.com
6
+ *
7
+ * Licensed under the MIT License.
8
+ * For RFID software, enterprise tools, and hardware drivers, visit https://rfidsoftwares.com
9
+ */
10
+
11
+ type StatusType = 'ONLINE' | 'OFFLINE' | 'CONNECTING' | 'ERROR';
12
+ interface Props$2 {
13
+ status: StatusType;
14
+ }
15
+ declare const ReaderStatusBadge: React.FC<Props$2>;
16
+
17
+ /**
18
+ * OpenRFID Simulator - The Open Source RFID Reader Simulator for Developers.
19
+ * Copyright (c) 2026 RFID Software India Private Limited - https://rfidsoftwares.com
20
+ *
21
+ * Licensed under the MIT License.
22
+ * For RFID software, enterprise tools, and hardware drivers, visit https://rfidsoftwares.com
23
+ */
24
+
25
+ interface Props$1 {
26
+ rssi: number;
27
+ }
28
+ declare const TagSignalMeter: React.FC<Props$1>;
29
+
30
+ /**
31
+ * OpenRFID Simulator - The Open Source RFID Reader Simulator for Developers.
32
+ * Copyright (c) 2026 RFID Software India Private Limited - https://rfidsoftwares.com
33
+ *
34
+ * Licensed under the MIT License.
35
+ * For RFID software, enterprise tools, and hardware drivers, visit https://rfidsoftwares.com
36
+ */
37
+
38
+ interface Props {
39
+ power: number;
40
+ onChange: (val: number) => void;
41
+ min?: number;
42
+ max?: number;
43
+ }
44
+ declare const AntennaPowerSlider: React.FC<Props>;
45
+
46
+ /**
47
+ * OpenRFID Simulator - The Open Source RFID Reader Simulator for Developers.
48
+ * Copyright (c) 2026 RFID Software India Private Limited - https://rfidsoftwares.com
49
+ *
50
+ * Licensed under the MIT License.
51
+ * For RFID software, enterprise tools, and hardware drivers, visit https://rfidsoftwares.com
52
+ */
53
+
54
+ declare const BrandHeader: React.FC;
55
+
56
+ export { AntennaPowerSlider, BrandHeader, ReaderStatusBadge, type StatusType, TagSignalMeter };
package/dist/index.js ADDED
@@ -0,0 +1,138 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/index.ts
31
+ var index_exports = {};
32
+ __export(index_exports, {
33
+ AntennaPowerSlider: () => AntennaPowerSlider,
34
+ BrandHeader: () => BrandHeader,
35
+ ReaderStatusBadge: () => ReaderStatusBadge,
36
+ TagSignalMeter: () => TagSignalMeter
37
+ });
38
+ module.exports = __toCommonJS(index_exports);
39
+
40
+ // src/components/ReaderStatusBadge.tsx
41
+ var import_react = __toESM(require("react"));
42
+ var ReaderStatusBadge = ({ status }) => {
43
+ const styles = {
44
+ ONLINE: { bg: "#10B981", text: "#FFFFFF", label: "ONLINE" },
45
+ OFFLINE: { bg: "#6B7280", text: "#FFFFFF", label: "OFFLINE" },
46
+ CONNECTING: { bg: "#F59E0B", text: "#FFFFFF", label: "CONNECTING" },
47
+ ERROR: { bg: "#EF4444", text: "#FFFFFF", label: "ERROR" }
48
+ };
49
+ const current = styles[status] || styles.OFFLINE;
50
+ return /* @__PURE__ */ import_react.default.createElement(
51
+ "span",
52
+ {
53
+ style: {
54
+ backgroundColor: current.bg,
55
+ color: current.text,
56
+ padding: "2px 8px",
57
+ borderRadius: "12px",
58
+ fontSize: "12px",
59
+ fontWeight: "bold",
60
+ display: "inline-block"
61
+ }
62
+ },
63
+ current.label
64
+ );
65
+ };
66
+
67
+ // src/components/TagSignalMeter.tsx
68
+ var import_react2 = __toESM(require("react"));
69
+ var TagSignalMeter = ({ rssi }) => {
70
+ const percentage = Math.max(0, Math.min(100, (rssi + 90) / 60 * 100));
71
+ let color = "#EF4444";
72
+ if (percentage > 66) color = "#10B981";
73
+ else if (percentage > 33) color = "#F59E0B";
74
+ return /* @__PURE__ */ import_react2.default.createElement("div", { style: { display: "flex", alignItems: "center", gap: "8px" } }, /* @__PURE__ */ import_react2.default.createElement("div", { style: { width: "80px", height: "8px", backgroundColor: "#374151", borderRadius: "4px", overflow: "hidden" } }, /* @__PURE__ */ import_react2.default.createElement("div", { style: { width: `${percentage}%`, height: "100%", backgroundColor: color } })), /* @__PURE__ */ import_react2.default.createElement("span", { style: { fontSize: "12px", color: "#9CA3AF", fontFamily: "monospace" } }, rssi, " dBm"));
75
+ };
76
+
77
+ // src/components/AntennaPowerSlider.tsx
78
+ var import_react3 = __toESM(require("react"));
79
+ var AntennaPowerSlider = ({ power, onChange, min = 0, max = 33 }) => {
80
+ return /* @__PURE__ */ import_react3.default.createElement("div", { style: { display: "flex", flexDirection: "column", gap: "4px" } }, /* @__PURE__ */ import_react3.default.createElement("div", { style: { display: "flex", justifyContent: "space-between", fontSize: "13px", color: "#D1D5DB" } }, /* @__PURE__ */ import_react3.default.createElement("span", null, "Tx Power"), /* @__PURE__ */ import_react3.default.createElement("span", { style: { fontWeight: "bold", color: "#00E5EE" } }, power.toFixed(1), " dBm")), /* @__PURE__ */ import_react3.default.createElement(
81
+ "input",
82
+ {
83
+ type: "range",
84
+ min,
85
+ max,
86
+ step: 0.5,
87
+ value: power,
88
+ onChange: (e) => onChange(parseFloat(e.target.value)),
89
+ style: { accentColor: "#00E5EE", cursor: "pointer" }
90
+ }
91
+ ));
92
+ };
93
+
94
+ // src/components/BrandHeader.tsx
95
+ var import_react4 = __toESM(require("react"));
96
+ var import_core = require("@openrfid/core");
97
+ var BrandHeader = () => {
98
+ return /* @__PURE__ */ import_react4.default.createElement(
99
+ "header",
100
+ {
101
+ style: {
102
+ display: "flex",
103
+ justifyContent: "space-between",
104
+ alignItems: "center",
105
+ padding: "12px 24px",
106
+ backgroundColor: "#111827",
107
+ borderBottom: "1px solid #1F2937",
108
+ color: "#FFFFFF"
109
+ }
110
+ },
111
+ /* @__PURE__ */ import_react4.default.createElement("div", { style: { display: "flex", alignItems: "center", gap: "12px" } }, /* @__PURE__ */ import_react4.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 500 500", width: "32", height: "32" }, /* @__PURE__ */ import_react4.default.createElement("path", { fill: "none", stroke: "#00E5EE", strokeWidth: "38", strokeLinecap: "round", d: "M 80,80 L 380,80 A 80,80 0 0 1 440,200 L 320,290" }), /* @__PURE__ */ import_react4.default.createElement("path", { fill: "none", stroke: "#00E5EE", strokeWidth: "38", strokeLinecap: "round", d: "M 150,160 L 150,420" }), /* @__PURE__ */ import_react4.default.createElement("path", { fill: "none", stroke: "#00E5EE", strokeWidth: "38", strokeLinecap: "round", d: "M 150,160 L 350,160 A 40,40 0 0 1 350,240 L 150,240" }), /* @__PURE__ */ import_react4.default.createElement("path", { fill: "none", stroke: "#00E5EE", strokeWidth: "38", strokeLinecap: "round", d: "M 230,260 L 460,460" }), /* @__PURE__ */ import_react4.default.createElement("circle", { fill: "#00E5EE", cx: "80", cy: "80", r: "34" }), /* @__PURE__ */ import_react4.default.createElement("circle", { fill: "#111827", cx: "80", cy: "80", r: "16" }), /* @__PURE__ */ import_react4.default.createElement("circle", { fill: "#00E5EE", cx: "150", cy: "420", r: "34" }), /* @__PURE__ */ import_react4.default.createElement("circle", { fill: "#111827", cx: "150", cy: "420", r: "16" })), /* @__PURE__ */ import_react4.default.createElement("div", null, /* @__PURE__ */ import_react4.default.createElement("h1", { style: { margin: 0, fontSize: "18px", fontWeight: "bold", color: "#FFFFFF" } }, import_core.BRAND.name), /* @__PURE__ */ import_react4.default.createElement("span", { style: { fontSize: "11px", color: "#9CA3AF" } }, import_core.BRAND.tagline))),
112
+ /* @__PURE__ */ import_react4.default.createElement("div", null, /* @__PURE__ */ import_react4.default.createElement(
113
+ "a",
114
+ {
115
+ href: import_core.BRAND.website,
116
+ target: "_blank",
117
+ rel: "noopener noreferrer",
118
+ style: {
119
+ color: "#00E5EE",
120
+ textDecoration: "none",
121
+ fontSize: "13px",
122
+ fontWeight: "600",
123
+ border: "1px solid #00E5EE",
124
+ padding: "4px 12px",
125
+ borderRadius: "6px"
126
+ }
127
+ },
128
+ import_core.BRAND.organization
129
+ ))
130
+ );
131
+ };
132
+ // Annotate the CommonJS export names for ESM import in node:
133
+ 0 && (module.exports = {
134
+ AntennaPowerSlider,
135
+ BrandHeader,
136
+ ReaderStatusBadge,
137
+ TagSignalMeter
138
+ });
package/dist/index.mjs ADDED
@@ -0,0 +1,98 @@
1
+ // src/components/ReaderStatusBadge.tsx
2
+ import React from "react";
3
+ var ReaderStatusBadge = ({ status }) => {
4
+ const styles = {
5
+ ONLINE: { bg: "#10B981", text: "#FFFFFF", label: "ONLINE" },
6
+ OFFLINE: { bg: "#6B7280", text: "#FFFFFF", label: "OFFLINE" },
7
+ CONNECTING: { bg: "#F59E0B", text: "#FFFFFF", label: "CONNECTING" },
8
+ ERROR: { bg: "#EF4444", text: "#FFFFFF", label: "ERROR" }
9
+ };
10
+ const current = styles[status] || styles.OFFLINE;
11
+ return /* @__PURE__ */ React.createElement(
12
+ "span",
13
+ {
14
+ style: {
15
+ backgroundColor: current.bg,
16
+ color: current.text,
17
+ padding: "2px 8px",
18
+ borderRadius: "12px",
19
+ fontSize: "12px",
20
+ fontWeight: "bold",
21
+ display: "inline-block"
22
+ }
23
+ },
24
+ current.label
25
+ );
26
+ };
27
+
28
+ // src/components/TagSignalMeter.tsx
29
+ import React2 from "react";
30
+ var TagSignalMeter = ({ rssi }) => {
31
+ const percentage = Math.max(0, Math.min(100, (rssi + 90) / 60 * 100));
32
+ let color = "#EF4444";
33
+ if (percentage > 66) color = "#10B981";
34
+ else if (percentage > 33) color = "#F59E0B";
35
+ return /* @__PURE__ */ React2.createElement("div", { style: { display: "flex", alignItems: "center", gap: "8px" } }, /* @__PURE__ */ React2.createElement("div", { style: { width: "80px", height: "8px", backgroundColor: "#374151", borderRadius: "4px", overflow: "hidden" } }, /* @__PURE__ */ React2.createElement("div", { style: { width: `${percentage}%`, height: "100%", backgroundColor: color } })), /* @__PURE__ */ React2.createElement("span", { style: { fontSize: "12px", color: "#9CA3AF", fontFamily: "monospace" } }, rssi, " dBm"));
36
+ };
37
+
38
+ // src/components/AntennaPowerSlider.tsx
39
+ import React3 from "react";
40
+ var AntennaPowerSlider = ({ power, onChange, min = 0, max = 33 }) => {
41
+ return /* @__PURE__ */ React3.createElement("div", { style: { display: "flex", flexDirection: "column", gap: "4px" } }, /* @__PURE__ */ React3.createElement("div", { style: { display: "flex", justifyContent: "space-between", fontSize: "13px", color: "#D1D5DB" } }, /* @__PURE__ */ React3.createElement("span", null, "Tx Power"), /* @__PURE__ */ React3.createElement("span", { style: { fontWeight: "bold", color: "#00E5EE" } }, power.toFixed(1), " dBm")), /* @__PURE__ */ React3.createElement(
42
+ "input",
43
+ {
44
+ type: "range",
45
+ min,
46
+ max,
47
+ step: 0.5,
48
+ value: power,
49
+ onChange: (e) => onChange(parseFloat(e.target.value)),
50
+ style: { accentColor: "#00E5EE", cursor: "pointer" }
51
+ }
52
+ ));
53
+ };
54
+
55
+ // src/components/BrandHeader.tsx
56
+ import React4 from "react";
57
+ import { BRAND } from "@openrfid/core";
58
+ var BrandHeader = () => {
59
+ return /* @__PURE__ */ React4.createElement(
60
+ "header",
61
+ {
62
+ style: {
63
+ display: "flex",
64
+ justifyContent: "space-between",
65
+ alignItems: "center",
66
+ padding: "12px 24px",
67
+ backgroundColor: "#111827",
68
+ borderBottom: "1px solid #1F2937",
69
+ color: "#FFFFFF"
70
+ }
71
+ },
72
+ /* @__PURE__ */ React4.createElement("div", { style: { display: "flex", alignItems: "center", gap: "12px" } }, /* @__PURE__ */ React4.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 500 500", width: "32", height: "32" }, /* @__PURE__ */ React4.createElement("path", { fill: "none", stroke: "#00E5EE", strokeWidth: "38", strokeLinecap: "round", d: "M 80,80 L 380,80 A 80,80 0 0 1 440,200 L 320,290" }), /* @__PURE__ */ React4.createElement("path", { fill: "none", stroke: "#00E5EE", strokeWidth: "38", strokeLinecap: "round", d: "M 150,160 L 150,420" }), /* @__PURE__ */ React4.createElement("path", { fill: "none", stroke: "#00E5EE", strokeWidth: "38", strokeLinecap: "round", d: "M 150,160 L 350,160 A 40,40 0 0 1 350,240 L 150,240" }), /* @__PURE__ */ React4.createElement("path", { fill: "none", stroke: "#00E5EE", strokeWidth: "38", strokeLinecap: "round", d: "M 230,260 L 460,460" }), /* @__PURE__ */ React4.createElement("circle", { fill: "#00E5EE", cx: "80", cy: "80", r: "34" }), /* @__PURE__ */ React4.createElement("circle", { fill: "#111827", cx: "80", cy: "80", r: "16" }), /* @__PURE__ */ React4.createElement("circle", { fill: "#00E5EE", cx: "150", cy: "420", r: "34" }), /* @__PURE__ */ React4.createElement("circle", { fill: "#111827", cx: "150", cy: "420", r: "16" })), /* @__PURE__ */ React4.createElement("div", null, /* @__PURE__ */ React4.createElement("h1", { style: { margin: 0, fontSize: "18px", fontWeight: "bold", color: "#FFFFFF" } }, BRAND.name), /* @__PURE__ */ React4.createElement("span", { style: { fontSize: "11px", color: "#9CA3AF" } }, BRAND.tagline))),
73
+ /* @__PURE__ */ React4.createElement("div", null, /* @__PURE__ */ React4.createElement(
74
+ "a",
75
+ {
76
+ href: BRAND.website,
77
+ target: "_blank",
78
+ rel: "noopener noreferrer",
79
+ style: {
80
+ color: "#00E5EE",
81
+ textDecoration: "none",
82
+ fontSize: "13px",
83
+ fontWeight: "600",
84
+ border: "1px solid #00E5EE",
85
+ padding: "4px 12px",
86
+ borderRadius: "6px"
87
+ }
88
+ },
89
+ BRAND.organization
90
+ ))
91
+ );
92
+ };
93
+ export {
94
+ AntennaPowerSlider,
95
+ BrandHeader,
96
+ ReaderStatusBadge,
97
+ TagSignalMeter
98
+ };
package/package.json ADDED
@@ -0,0 +1,48 @@
1
+ {
2
+ "name": "@openrfid/ui",
3
+ "version": "0.1.0",
4
+ "description": "Shared React UI component library for OpenRFID Simulator.",
5
+ "main": "./dist/index.js",
6
+ "module": "./dist/index.mjs",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.mjs",
12
+ "require": "./dist/index.js"
13
+ }
14
+ },
15
+ "files": [
16
+ "dist"
17
+ ],
18
+ "dependencies": {
19
+ "react": "^18.2.0",
20
+ "react-dom": "^18.2.0",
21
+ "@openrfid/core": "0.1.0"
22
+ },
23
+ "devDependencies": {
24
+ "@types/react": "^18.2.66",
25
+ "@types/react-dom": "^18.2.22",
26
+ "tsup": "^8.0.2",
27
+ "typescript": "^5.4.5",
28
+ "vitest": "^1.5.0"
29
+ },
30
+ "publishConfig": {
31
+ "access": "public"
32
+ },
33
+ "license": "MIT",
34
+ "repository": {
35
+ "type": "git",
36
+ "url": "https://github.com/rfidsoftwares/openrfid-simulator.git"
37
+ },
38
+ "bugs": {
39
+ "url": "https://github.com/rfidsoftwares/openrfid-simulator/issues"
40
+ },
41
+ "homepage": "https://rfidsoftwares.com",
42
+ "scripts": {
43
+ "build": "tsup src/index.ts --format cjs,esm --dts --jsxFactory React.createElement",
44
+ "dev": "tsup src/index.ts --format cjs,esm --dts --watch",
45
+ "test": "vitest run",
46
+ "typecheck": "tsc --noEmit"
47
+ }
48
+ }