@qrkit/react 0.0.1 → 0.2.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.
@@ -0,0 +1,183 @@
1
+ /* src/styles.css */
2
+ .qrkit {
3
+ --qrkit-accent: #6750a4;
4
+ --qrkit-bg: #fffbfe;
5
+ --qrkit-backdrop: rgba(0, 0, 0, 0.6);
6
+ --qrkit-text: #1c1b1f;
7
+ --qrkit-text-muted: #49454f;
8
+ --qrkit-radius: 12px;
9
+ --qrkit-font: inherit;
10
+ }
11
+ @media (prefers-color-scheme: dark) {
12
+ .qrkit {
13
+ --qrkit-accent: #d0bcff;
14
+ --qrkit-bg: #1c1b1f;
15
+ --qrkit-backdrop: rgba(0, 0, 0, 0.75);
16
+ --qrkit-text: #e6e1e5;
17
+ --qrkit-text-muted: #cac4d0;
18
+ }
19
+ }
20
+ .qrkit-backdrop {
21
+ position: fixed;
22
+ inset: 0;
23
+ background: var(--qrkit-backdrop);
24
+ display: flex;
25
+ align-items: center;
26
+ justify-content: center;
27
+ z-index: 9999;
28
+ font-family: var(--qrkit-font);
29
+ }
30
+ .qrkit-modal {
31
+ background: var(--qrkit-bg);
32
+ color: var(--qrkit-text);
33
+ border-radius: var(--qrkit-radius);
34
+ padding: 28px 24px 24px;
35
+ width: 100%;
36
+ max-width: 400px;
37
+ max-height: 90vh;
38
+ overflow-y: auto;
39
+ box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
40
+ display: flex;
41
+ flex-direction: column;
42
+ gap: 20px;
43
+ }
44
+ .qrkit-modal-header {
45
+ display: flex;
46
+ align-items: center;
47
+ justify-content: space-between;
48
+ }
49
+ .qrkit-modal-title {
50
+ margin: 0;
51
+ font-size: 18px;
52
+ font-weight: 600;
53
+ color: var(--qrkit-text);
54
+ }
55
+ .qrkit-close-btn {
56
+ background: none;
57
+ border: none;
58
+ cursor: pointer;
59
+ font-size: 20px;
60
+ line-height: 1;
61
+ color: var(--qrkit-text-muted);
62
+ padding: 4px;
63
+ border-radius: 4px;
64
+ display: flex;
65
+ align-items: center;
66
+ justify-content: center;
67
+ }
68
+ .qrkit-close-btn:hover {
69
+ color: var(--qrkit-text);
70
+ }
71
+ .qrkit-scanner-wrap {
72
+ position: relative;
73
+ width: 100%;
74
+ aspect-ratio: 1;
75
+ border-radius: calc(var(--qrkit-radius) - 4px);
76
+ overflow: hidden;
77
+ background: #000;
78
+ }
79
+ .qrkit-scanner-video {
80
+ width: 100%;
81
+ height: 100%;
82
+ object-fit: cover;
83
+ display: block;
84
+ }
85
+ .qrkit-scanner-overlay {
86
+ position: absolute;
87
+ inset: 0;
88
+ pointer-events: none;
89
+ }
90
+ .qrkit-scanner-corner {
91
+ position: absolute;
92
+ width: 24px;
93
+ height: 24px;
94
+ border-color: var(--qrkit-accent);
95
+ border-style: solid;
96
+ }
97
+ .qrkit-scanner-corner.tl {
98
+ top: 12px;
99
+ left: 12px;
100
+ border-width: 3px 0 0 3px;
101
+ border-radius: 4px 0 0 0;
102
+ }
103
+ .qrkit-scanner-corner.tr {
104
+ top: 12px;
105
+ right: 12px;
106
+ border-width: 3px 3px 0 0;
107
+ border-radius: 0 4px 0 0;
108
+ }
109
+ .qrkit-scanner-corner.bl {
110
+ bottom: 12px;
111
+ left: 12px;
112
+ border-width: 0 0 3px 3px;
113
+ border-radius: 0 0 0 4px;
114
+ }
115
+ .qrkit-scanner-corner.br {
116
+ bottom: 12px;
117
+ right: 12px;
118
+ border-width: 0 3px 3px 0;
119
+ border-radius: 0 0 4px 0;
120
+ }
121
+ .qrkit-scanner-progress {
122
+ position: absolute;
123
+ bottom: 10px;
124
+ left: 50%;
125
+ transform: translateX(-50%);
126
+ background: rgba(0, 0, 0, 0.6);
127
+ color: #fff;
128
+ font-size: 12px;
129
+ padding: 3px 10px;
130
+ border-radius: 20px;
131
+ }
132
+ .qrkit-scanner-error {
133
+ color: #c00;
134
+ font-size: 14px;
135
+ text-align: center;
136
+ }
137
+ .qrkit-hint {
138
+ margin: 0;
139
+ font-size: 13px;
140
+ color: var(--qrkit-text-muted);
141
+ text-align: center;
142
+ }
143
+ .qrkit-qr-wrap {
144
+ display: flex;
145
+ flex-direction: column;
146
+ align-items: center;
147
+ gap: 12px;
148
+ }
149
+ .qrkit-qr-canvas {
150
+ border-radius: calc(var(--qrkit-radius) - 4px);
151
+ display: block;
152
+ }
153
+ .qrkit-btn {
154
+ display: inline-flex;
155
+ align-items: center;
156
+ justify-content: center;
157
+ padding: 10px 20px;
158
+ border-radius: calc(var(--qrkit-radius) - 4px);
159
+ font-size: 15px;
160
+ font-weight: 500;
161
+ cursor: pointer;
162
+ border: none;
163
+ transition: opacity 0.15s;
164
+ width: 100%;
165
+ }
166
+ .qrkit-btn:hover {
167
+ opacity: 0.85;
168
+ }
169
+ .qrkit-btn-primary {
170
+ background: var(--qrkit-accent);
171
+ color: #fff;
172
+ }
173
+ .qrkit-btn-ghost {
174
+ background: transparent;
175
+ color: var(--qrkit-text-muted);
176
+ border: 1px solid currentColor;
177
+ }
178
+ .qrkit-step {
179
+ font-size: 13px;
180
+ color: var(--qrkit-text-muted);
181
+ text-align: center;
182
+ margin: 0;
183
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qrkit/react",
3
- "version": "0.0.1",
3
+ "version": "0.2.0",
4
4
  "description": "React context, hooks, and drop-in components for QR-based airgapped wallet flows.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -9,7 +9,8 @@
9
9
  "types": "./dist/index.d.ts",
10
10
  "import": "./dist/index.js",
11
11
  "require": "./dist/index.cjs"
12
- }
12
+ },
13
+ "./styles.css": "./dist/styles.css"
13
14
  },
14
15
  "main": "./dist/index.cjs",
15
16
  "module": "./dist/index.js",
@@ -18,18 +19,23 @@
18
19
  "dist"
19
20
  ],
20
21
  "dependencies": {
22
+ "@qrkit/bc-ur": "2.0.0-beta.9-qrkit.2",
23
+ "focus-trap": "^8.0.1",
21
24
  "jsqr": "^1.4.0",
22
25
  "qrcode": "^1.5.4",
23
- "@qrkit/core": "0.1.0"
26
+ "@qrkit/core": "0.2.0"
24
27
  },
25
28
  "peerDependencies": {
26
29
  "react": ">=18",
27
30
  "react-dom": ">=18"
28
31
  },
29
32
  "devDependencies": {
33
+ "@testing-library/jest-dom": "^6.9.1",
34
+ "@testing-library/react": "^16.3.2",
30
35
  "@types/qrcode": "^1.5.6",
31
36
  "@types/react": "^19.2.14",
32
37
  "@types/react-dom": "^19.2.3",
38
+ "jsdom": "^29.0.1",
33
39
  "react": "^19.2.4",
34
40
  "react-dom": "^19.2.4",
35
41
  "tsup": "^8.4.0",