@limrun/ui 0.8.0 → 0.9.0-rc.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.
Files changed (64) hide show
  1. package/README.md +9 -0
  2. package/dist/components/device-install/device-install-dialog.d.ts +5 -0
  3. package/dist/components/device-install/index.d.ts +2 -0
  4. package/dist/core/device-install/apple/client.d.ts +17 -0
  5. package/dist/core/device-install/apple/crypto.d.ts +20 -0
  6. package/dist/core/device-install/apple/gsa-srp.d.ts +26 -0
  7. package/dist/core/device-install/apple/index.d.ts +5 -0
  8. package/dist/core/device-install/apple/provisioning.d.ts +161 -0
  9. package/dist/core/device-install/apple/relay.d.ts +29 -0
  10. package/dist/core/device-install/index.d.ts +4 -0
  11. package/dist/core/device-install/operations/index.d.ts +6 -0
  12. package/dist/core/device-install/operations/limbuild-client.d.ts +28 -0
  13. package/dist/core/device-install/operations/operations.d.ts +32 -0
  14. package/dist/core/device-install/operations/relay-client.d.ts +25 -0
  15. package/dist/core/device-install/operations/relay-protocol.d.ts +27 -0
  16. package/dist/core/device-install/operations/usbmux.d.ts +32 -0
  17. package/dist/core/device-install/operations/webusb.d.ts +21 -0
  18. package/dist/core/device-install/storage/browser-storage.d.ts +43 -0
  19. package/dist/core/device-install/storage/index.d.ts +1 -0
  20. package/dist/core/device-install/types.d.ts +48 -0
  21. package/dist/device-install/index.cjs +1 -0
  22. package/dist/device-install/index.d.ts +3 -0
  23. package/dist/device-install/index.js +77 -0
  24. package/dist/device-install/react.cjs +1 -0
  25. package/dist/device-install/react.d.ts +1 -0
  26. package/dist/device-install/react.js +4 -0
  27. package/dist/device-install-dialog-CSwQgbBm.js +2 -0
  28. package/dist/device-install-dialog-nThj775b.mjs +395 -0
  29. package/dist/device-install-dialog.css +1 -0
  30. package/dist/hooks/index.d.ts +1 -0
  31. package/dist/hooks/use-device-install.d.ts +70 -0
  32. package/dist/index.cjs +1 -1
  33. package/dist/index.d.ts +2 -0
  34. package/dist/index.js +401 -408
  35. package/dist/use-device-install-C1uVac59.mjs +13541 -0
  36. package/dist/use-device-install-Ca4jcVKU.js +31 -0
  37. package/package.json +15 -2
  38. package/src/components/device-install/device-install-dialog.css +244 -0
  39. package/src/components/device-install/device-install-dialog.tsx +432 -0
  40. package/src/components/device-install/index.ts +2 -0
  41. package/src/core/device-install/apple/client.ts +152 -0
  42. package/src/core/device-install/apple/crypto.ts +202 -0
  43. package/src/core/device-install/apple/gsa-srp.ts +127 -0
  44. package/src/core/device-install/apple/index.ts +5 -0
  45. package/src/core/device-install/apple/provisioning.ts +298 -0
  46. package/src/core/device-install/apple/relay.ts +221 -0
  47. package/src/core/device-install/index.ts +4 -0
  48. package/src/core/device-install/operations/index.ts +6 -0
  49. package/src/core/device-install/operations/limbuild-client.ts +104 -0
  50. package/src/core/device-install/operations/operations.ts +217 -0
  51. package/src/core/device-install/operations/relay-client.ts +255 -0
  52. package/src/core/device-install/operations/relay-protocol.ts +71 -0
  53. package/src/core/device-install/operations/usbmux.ts +270 -0
  54. package/src/core/device-install/operations/webusb-dom.d.ts +54 -0
  55. package/src/core/device-install/operations/webusb.ts +105 -0
  56. package/src/core/device-install/storage/browser-storage.ts +251 -0
  57. package/src/core/device-install/storage/index.ts +1 -0
  58. package/src/core/device-install/types.ts +65 -0
  59. package/src/device-install/index.ts +3 -0
  60. package/src/device-install/react.ts +1 -0
  61. package/src/hooks/index.ts +1 -0
  62. package/src/hooks/use-device-install.ts +1067 -0
  63. package/src/index.ts +2 -0
  64. package/vite.config.ts +6 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@limrun/ui",
3
- "version": "0.8.0",
3
+ "version": "0.9.0-rc.2",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -13,6 +13,16 @@
13
13
  "import": "./dist/index.js",
14
14
  "require": "./dist/index.cjs"
15
15
  },
16
+ "./device-install": {
17
+ "types": "./dist/device-install/index.d.ts",
18
+ "import": "./dist/device-install/index.js",
19
+ "require": "./dist/device-install/index.cjs"
20
+ },
21
+ "./device-install/react": {
22
+ "types": "./dist/device-install/react.d.ts",
23
+ "import": "./dist/device-install/react.js",
24
+ "require": "./dist/device-install/react.cjs"
25
+ },
16
26
  "./package.json": "./package.json"
17
27
  },
18
28
  "scripts": {
@@ -29,6 +39,7 @@
29
39
  },
30
40
  "license": "MIT",
31
41
  "devDependencies": {
42
+ "@types/node-forge": "^1.3.14",
32
43
  "@types/react": "^19.1.12",
33
44
  "@types/react-dom": "^19.1.9",
34
45
  "@vitejs/plugin-react-swc": "^4.0.1",
@@ -40,6 +51,8 @@
40
51
  "vite-plugin-lib-inject-css": "^2.2.2"
41
52
  },
42
53
  "dependencies": {
43
- "clsx": "^2.1.1"
54
+ "@foxt/js-srp": "^0.0.3-patch2",
55
+ "clsx": "^2.1.1",
56
+ "node-forge": "^1.4.0"
44
57
  }
45
58
  }
@@ -0,0 +1,244 @@
1
+ .lr-device-install {
2
+ font-family:
3
+ Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
4
+ }
5
+
6
+ .lr-device-install__trigger,
7
+ .lr-device-install__primary,
8
+ .lr-device-install__secondary,
9
+ .lr-device-install__icon-button {
10
+ border: 1px solid #d1d5db;
11
+ border-radius: 8px;
12
+ cursor: pointer;
13
+ font: inherit;
14
+ }
15
+
16
+ .lr-device-install__trigger,
17
+ .lr-device-install__primary {
18
+ background: #111827;
19
+ color: #ffffff;
20
+ padding: 8px 12px;
21
+ }
22
+
23
+ .lr-device-install__secondary,
24
+ .lr-device-install__icon-button {
25
+ background: #ffffff;
26
+ color: #111827;
27
+ padding: 8px 12px;
28
+ }
29
+
30
+ .lr-device-install__trigger:disabled,
31
+ .lr-device-install__primary:disabled,
32
+ .lr-device-install__secondary:disabled {
33
+ cursor: not-allowed;
34
+ opacity: 0.55;
35
+ }
36
+
37
+ .lr-device-install__backdrop {
38
+ align-items: center;
39
+ background: rgb(17 24 39 / 0.55);
40
+ display: flex;
41
+ inset: 0;
42
+ justify-content: center;
43
+ padding: 24px;
44
+ position: fixed;
45
+ z-index: 50;
46
+ }
47
+
48
+ .lr-device-install__dialog {
49
+ background: #ffffff;
50
+ border-radius: 16px;
51
+ box-shadow: 0 24px 80px rgb(15 23 42 / 0.28);
52
+ color: #111827;
53
+ max-height: min(90vh, 900px);
54
+ max-width: 880px;
55
+ overflow: auto;
56
+ padding: 24px;
57
+ width: 100%;
58
+ }
59
+
60
+ .lr-device-install__header {
61
+ align-items: flex-start;
62
+ display: flex;
63
+ gap: 16px;
64
+ justify-content: space-between;
65
+ margin-bottom: 18px;
66
+ }
67
+
68
+ .lr-device-install__header h2,
69
+ .lr-device-install__step h3,
70
+ .lr-device-install__logs h3 {
71
+ margin: 0;
72
+ }
73
+
74
+ .lr-device-install__header p,
75
+ .lr-device-install__step p,
76
+ .lr-device-install__logs {
77
+ color: #4b5563;
78
+ }
79
+
80
+ .lr-device-install__error {
81
+ background: #fef2f2;
82
+ border: 1px solid #fecaca;
83
+ border-radius: 10px;
84
+ color: #991b1b;
85
+ margin-bottom: 14px;
86
+ padding: 10px 12px;
87
+ }
88
+
89
+ .lr-device-install__steps {
90
+ display: grid;
91
+ gap: 12px;
92
+ }
93
+
94
+ .lr-device-install__step {
95
+ border: 1px solid #e5e7eb;
96
+ border-radius: 12px;
97
+ padding: 14px;
98
+ }
99
+
100
+ .lr-device-install__step--active {
101
+ border-color: #111827;
102
+ }
103
+
104
+ .lr-device-install__step-header {
105
+ align-items: flex-start;
106
+ display: grid;
107
+ gap: 12px;
108
+ grid-template-columns: auto 1fr auto;
109
+ }
110
+
111
+ .lr-device-install__step-number {
112
+ align-items: center;
113
+ background: #111827;
114
+ border-radius: 999px;
115
+ color: #ffffff;
116
+ display: flex;
117
+ font-size: 13px;
118
+ font-weight: 700;
119
+ height: 28px;
120
+ justify-content: center;
121
+ width: 28px;
122
+ }
123
+
124
+ .lr-device-install__status {
125
+ border-radius: 999px;
126
+ font-size: 12px;
127
+ padding: 3px 8px;
128
+ text-transform: capitalize;
129
+ }
130
+
131
+ .lr-device-install__status--idle {
132
+ background: #f3f4f6;
133
+ color: #4b5563;
134
+ }
135
+
136
+ .lr-device-install__status--active {
137
+ background: #dbeafe;
138
+ color: #1d4ed8;
139
+ }
140
+
141
+ .lr-device-install__status--complete {
142
+ background: #dcfce7;
143
+ color: #166534;
144
+ }
145
+
146
+ .lr-device-install__status--error {
147
+ background: #fee2e2;
148
+ color: #991b1b;
149
+ }
150
+
151
+ .lr-device-install__step-body {
152
+ display: grid;
153
+ gap: 12px;
154
+ margin-top: 12px;
155
+ }
156
+
157
+ .lr-device-install__grid {
158
+ display: grid;
159
+ gap: 10px;
160
+ grid-template-columns: repeat(3, minmax(0, 1fr));
161
+ }
162
+
163
+ .lr-device-install__field {
164
+ display: grid;
165
+ gap: 6px;
166
+ }
167
+
168
+ .lr-device-install__field span {
169
+ color: #374151;
170
+ font-size: 13px;
171
+ font-weight: 600;
172
+ }
173
+
174
+ .lr-device-install__field input {
175
+ border: 1px solid #d1d5db;
176
+ border-radius: 8px;
177
+ font: inherit;
178
+ padding: 8px 10px;
179
+ }
180
+
181
+ .lr-device-install__build-logs {
182
+ border: 1px solid #e5e7eb;
183
+ border-radius: 10px;
184
+ overflow: hidden;
185
+ }
186
+
187
+ .lr-device-install__build-logs summary {
188
+ cursor: pointer;
189
+ font-weight: 600;
190
+ padding: 10px 12px;
191
+ }
192
+
193
+ .lr-device-install__build-logs pre {
194
+ background: #0f172a;
195
+ color: #e5e7eb;
196
+ margin: 0;
197
+ max-height: 240px;
198
+ overflow: auto;
199
+ padding: 12px;
200
+ white-space: pre-wrap;
201
+ }
202
+
203
+ .lr-device-install__device {
204
+ background: #f9fafb;
205
+ border: 1px solid #e5e7eb;
206
+ border-radius: 10px;
207
+ padding: 10px;
208
+ }
209
+
210
+ .lr-device-install__logs {
211
+ border-top: 1px solid #e5e7eb;
212
+ margin-top: 18px;
213
+ padding-top: 14px;
214
+ }
215
+
216
+ .lr-device-install__logs ol {
217
+ display: grid;
218
+ gap: 6px;
219
+ list-style: none;
220
+ margin: 8px 0 0;
221
+ max-height: 160px;
222
+ overflow: auto;
223
+ padding: 0;
224
+ }
225
+
226
+ .lr-device-install__logs li {
227
+ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', monospace;
228
+ font-size: 12px;
229
+ white-space: pre-wrap;
230
+ }
231
+
232
+ @media (max-width: 760px) {
233
+ .lr-device-install__grid {
234
+ grid-template-columns: 1fr;
235
+ }
236
+
237
+ .lr-device-install__step-header {
238
+ grid-template-columns: auto 1fr;
239
+ }
240
+
241
+ .lr-device-install__status {
242
+ grid-column: 2;
243
+ }
244
+ }