@limrun/ui 0.15.1 → 0.17.0-rc.1

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 (66) hide show
  1. package/README.md +59 -0
  2. package/dist/GLTFLoader-BKnsBFsj.js +1 -0
  3. package/dist/GLTFLoader-DW6wpvyR.mjs +1679 -0
  4. package/dist/components/duo-button-hinge.d.ts +16 -0
  5. package/dist/components/duo-controls.d.ts +21 -0
  6. package/dist/components/duo-flat-frame.d.ts +7 -0
  7. package/dist/components/duo-flat-geometry.d.ts +52 -0
  8. package/dist/components/duo-fold-motion.d.ts +27 -0
  9. package/dist/components/duo-fold-renderer.d.ts +19 -0
  10. package/dist/components/duo-fold-timing.d.ts +1 -0
  11. package/dist/components/duo-frame.d.ts +16 -0
  12. package/dist/components/duo-hardware.d.ts +20 -0
  13. package/dist/components/duo-model.d.ts +19 -0
  14. package/dist/components/duo-screen-handoff.d.ts +4 -0
  15. package/dist/components/duo-view.d.ts +4 -0
  16. package/dist/components/remote-control-framed.d.ts +2 -0
  17. package/dist/components/remote-control.d.ts +24 -1
  18. package/dist/core/duo.d.ts +63 -0
  19. package/dist/duo-fold-renderer-BXejNHcY.mjs +257 -0
  20. package/dist/duo-fold-renderer-DdltAnF7.js +53 -0
  21. package/dist/duo-frame-BzyYljix.mjs +26767 -0
  22. package/dist/duo-frame-DjfA4gG-.js +4059 -0
  23. package/dist/duo-view-COZg8ieG.js +1 -0
  24. package/dist/duo-view-o1yxIzxu.mjs +654 -0
  25. package/dist/frame-assets.d.ts +2 -0
  26. package/dist/index.cjs +1 -1
  27. package/dist/index.css +1 -1
  28. package/dist/index.d.ts +3 -2
  29. package/dist/index.js +25 -2495
  30. package/dist/lite.cjs +1 -0
  31. package/dist/lite.d.ts +6 -0
  32. package/dist/lite.js +13 -0
  33. package/dist/remote-control-CQjSEVDF.mjs +2673 -0
  34. package/dist/remote-control-DVRXfCR2.js +1 -0
  35. package/package.json +13 -3
  36. package/src/components/duo-button-hinge.test.tsx +138 -0
  37. package/src/components/duo-button-hinge.ts +75 -0
  38. package/src/components/duo-controls.tsx +142 -0
  39. package/src/components/duo-flat-frame.tsx +145 -0
  40. package/src/components/duo-flat-geometry.test.ts +63 -0
  41. package/src/components/duo-flat-geometry.ts +97 -0
  42. package/src/components/duo-fold-motion.test.tsx +245 -0
  43. package/src/components/duo-fold-motion.tsx +192 -0
  44. package/src/components/duo-fold-renderer.test.ts +29 -0
  45. package/src/components/duo-fold-renderer.ts +397 -0
  46. package/src/components/duo-fold-timing.test.ts +44 -0
  47. package/src/components/duo-fold-timing.ts +9 -0
  48. package/src/components/duo-frame.tsx +579 -0
  49. package/src/components/duo-hardware.test.ts +61 -0
  50. package/src/components/duo-hardware.ts +61 -0
  51. package/src/components/duo-model.test.ts +243 -0
  52. package/src/components/duo-model.ts +607 -0
  53. package/src/components/duo-screen-handoff.ts +52 -0
  54. package/src/components/duo-view.test.tsx +104 -0
  55. package/src/components/duo-view.tsx +315 -0
  56. package/src/components/remote-control-framed.tsx +14 -0
  57. package/src/components/remote-control.css +310 -0
  58. package/src/components/remote-control.tsx +259 -59
  59. package/src/core/duo.test.ts +142 -0
  60. package/src/core/duo.ts +156 -0
  61. package/src/demo.tsx +16 -1
  62. package/src/frame-assets.ts +22 -0
  63. package/src/index.ts +5 -1
  64. package/src/lite.test.ts +30 -0
  65. package/src/lite.ts +30 -0
  66. package/vite.config.ts +5 -0
@@ -129,3 +129,313 @@
129
129
  line-height: 1.3;
130
130
  color: #6b7280;
131
131
  }
132
+
133
+ .rc-duo-view {
134
+ position: absolute;
135
+ inset: 0;
136
+ }
137
+ .rc-duo-mode {
138
+ position: absolute;
139
+ top: 12px;
140
+ right: 16px;
141
+ z-index: 3;
142
+ display: flex;
143
+ gap: 2px;
144
+ padding: 3px;
145
+ background: #fff;
146
+ border: 1px solid #d9dde4;
147
+ border-radius: 10px;
148
+ }
149
+ .rc-duo-mode button {
150
+ border: 0;
151
+ border-radius: 7px;
152
+ padding: 7px 13px;
153
+ font: 12px system-ui;
154
+ color: #29313e;
155
+ background: transparent;
156
+ cursor: pointer;
157
+ }
158
+ .rc-duo-mode button[aria-pressed='true'] {
159
+ background: #202b3c;
160
+ color: white;
161
+ }
162
+ .rc-duo-flat-stage {
163
+ position: relative;
164
+ flex: 1;
165
+ min-height: 160px;
166
+ margin-top: 48px;
167
+ }
168
+ .rc-duo-flat-device {
169
+ position: absolute;
170
+ left: 50%;
171
+ top: 50%;
172
+ flex: none;
173
+ transform-origin: center;
174
+ }
175
+ .rc-duo-flat-frame {
176
+ position: absolute;
177
+ inset: 0;
178
+ width: 100%;
179
+ height: 100%;
180
+ overflow: visible;
181
+ pointer-events: none;
182
+ filter: drop-shadow(0 5px 6px #17202e1c);
183
+ }
184
+ .rc-duo-flat-screen {
185
+ position: absolute;
186
+ overflow: hidden;
187
+ background: #090b0d;
188
+ touch-action: none;
189
+ outline: none;
190
+ }
191
+ .rc-duo-flat-screen video,
192
+ .rc-duo-flat-screen canvas {
193
+ position: absolute;
194
+ left: 50%;
195
+ top: 50%;
196
+ max-width: none;
197
+ pointer-events: none;
198
+ }
199
+ .rc-duo-flat-stage[data-folding='true'] > .rc-duo-flat-device,
200
+ .rc-duo-flat-stage[data-folding='true'] > .rc-duo-hardware {
201
+ visibility: hidden;
202
+ pointer-events: none;
203
+ }
204
+ .rc-duo-fold-hold {
205
+ position: absolute;
206
+ left: 50%;
207
+ top: 50%;
208
+ pointer-events: none;
209
+ }
210
+ .rc-duo-fold-still {
211
+ position: relative;
212
+ }
213
+ .rc-duo-fold-canvas {
214
+ position: absolute;
215
+ inset: 0;
216
+ width: 100%;
217
+ height: 100%;
218
+ pointer-events: none;
219
+ }
220
+ @media (prefers-reduced-motion: reduce) {
221
+ .rc-duo-fold-canvas,
222
+ .rc-duo-fold-hold {
223
+ display: none;
224
+ }
225
+ .rc-duo-flat-stage[data-folding='true'] > .rc-duo-flat-device {
226
+ visibility: visible;
227
+ }
228
+ }
229
+ .rc-duo .rc-duo-physical {
230
+ position: absolute;
231
+ z-index: 2;
232
+ padding: 0;
233
+ border-radius: 0;
234
+ touch-action: none;
235
+ }
236
+ .rc-duo-physical[data-edge='top'] {
237
+ transform: translate(-50%, -100%);
238
+ }
239
+ .rc-duo-physical[data-edge='right'] {
240
+ transform: translate(0, -50%);
241
+ }
242
+ .rc-duo-physical span {
243
+ position: absolute;
244
+ display: block;
245
+ border: 1px solid #7d8387;
246
+ border-radius: 2px;
247
+ box-sizing: border-box;
248
+ background: linear-gradient(180deg, #747d83, #fafcfb 32%, #afb5b9 64%, #636b70);
249
+ box-shadow: 0 0.5px 1px #0004;
250
+ transition: transform 110ms ease;
251
+ pointer-events: none;
252
+ }
253
+ .rc-duo-physical[data-edge='top'] span {
254
+ bottom: 0;
255
+ left: 50%;
256
+ transform: translateX(-50%);
257
+ }
258
+ .rc-duo-physical[data-edge='right'] span {
259
+ top: 50%;
260
+ left: 0;
261
+ transform: translateY(-50%);
262
+ background: linear-gradient(90deg, #747d83, #fafcfb 32%, #afb5b9 64%, #636b70);
263
+ }
264
+ .rc-duo-physical[data-edge='top'][data-highlighted='true'] span,
265
+ .rc-duo-physical[data-edge='top']:focus-visible span {
266
+ transform: translate(-50%, -2px);
267
+ }
268
+ .rc-duo-physical[data-edge='right'][data-highlighted='true'] span,
269
+ .rc-duo-physical[data-edge='right']:focus-visible span {
270
+ transform: translate(2px, -50%);
271
+ }
272
+ .rc-duo-physical[data-edge='top'][data-pressed='true'] span {
273
+ transform: translate(-50%, 0.5px);
274
+ }
275
+ .rc-duo-physical[data-edge='right'][data-pressed='true'] span {
276
+ transform: translate(-0.5px, -50%);
277
+ }
278
+ .rc-duo {
279
+ position: absolute;
280
+ inset: 0;
281
+ display: flex;
282
+ flex-direction: column;
283
+ overflow: hidden;
284
+ background: radial-gradient(ellipse at 50% 40%, #ffffff, #e8ebee);
285
+ border-radius: 16px;
286
+ color: #29313e;
287
+ }
288
+ .rc-duo-stage {
289
+ position: relative;
290
+ margin-top: 48px;
291
+ flex: 1;
292
+ min-height: 160px;
293
+ width: 100%;
294
+ outline: none;
295
+ touch-action: none;
296
+ }
297
+ .rc-duo-stage canvas {
298
+ display: block;
299
+ width: 100%;
300
+ height: 100%;
301
+ touch-action: none;
302
+ }
303
+ .rc-duo .rc-duo-hardware {
304
+ position: absolute;
305
+ display: grid;
306
+ place-items: center;
307
+ z-index: 1;
308
+ width: 44px;
309
+ height: 44px;
310
+ padding: 0;
311
+ transform: translate(-50%, -50%);
312
+ color: #73777c;
313
+ opacity: 0;
314
+ pointer-events: none;
315
+ transition:
316
+ opacity 120ms ease,
317
+ color 100ms ease;
318
+ }
319
+ .rc-duo .rc-duo-hardware[data-visible='true'],
320
+ .rc-duo .rc-duo-hardware:focus-visible {
321
+ opacity: 1;
322
+ pointer-events: auto;
323
+ }
324
+ .rc-duo .rc-duo-hardware svg {
325
+ width: var(--duo-hardware-icon-size, 24px);
326
+ height: var(--duo-hardware-icon-size, 24px);
327
+ transform: translate(var(--duo-hardware-icon-x, 0px), var(--duo-hardware-icon-y, 0px));
328
+ }
329
+ .rc-duo .rc-duo-hardware:hover,
330
+ .rc-duo .rc-duo-hardware:focus-visible,
331
+ .rc-duo .rc-duo-hardware[data-pressed='true'] {
332
+ color: #007aff;
333
+ }
334
+ .rc-duo-controls {
335
+ flex: none;
336
+ align-self: center;
337
+ width: min(540px, calc(100% - 40px));
338
+ box-sizing: border-box;
339
+ margin: 0 20px 20px;
340
+ padding: 12px;
341
+ background: rgba(255, 255, 255, 0.88);
342
+ border: 1px solid #d9dde4;
343
+ border-radius: 16px;
344
+ box-shadow: 0 6px 25px #13203610;
345
+ font:
346
+ 12px system-ui,
347
+ sans-serif;
348
+ }
349
+ .rc-duo-hinge,
350
+ .rc-duo-views {
351
+ display: flex;
352
+ align-items: center;
353
+ gap: 10px;
354
+ flex-wrap: wrap;
355
+ }
356
+ .rc-duo-hinge {
357
+ flex-wrap: nowrap;
358
+ gap: 8px;
359
+ }
360
+ .rc-duo-hinge input {
361
+ flex: 1;
362
+ min-width: 30px;
363
+ width: 100%;
364
+ accent-color: #34435b;
365
+ }
366
+ .rc-duo-hinge output {
367
+ min-width: 32px;
368
+ font-variant-numeric: tabular-nums;
369
+ }
370
+ .rc-duo button {
371
+ border: 0;
372
+ padding: 7px 10px;
373
+ border-radius: 8px;
374
+ background: transparent;
375
+ color: inherit;
376
+ cursor: pointer;
377
+ font: inherit;
378
+ }
379
+ .rc-duo-hinge .rc-duo-fold {
380
+ flex: none;
381
+ background: #202b3c;
382
+ color: white;
383
+ min-width: 65px;
384
+ }
385
+ .rc-duo-views {
386
+ min-height: 29px;
387
+ margin-top: 8px;
388
+ gap: 2px;
389
+ font-size: 11px;
390
+ }
391
+ .rc-duo-views button {
392
+ padding: 6px 8px;
393
+ }
394
+ .rc-duo-view-label {
395
+ padding: 6px 8px;
396
+ color: #77808d;
397
+ }
398
+ .rc-duo .rc-duo-rotate {
399
+ display: flex;
400
+ align-items: center;
401
+ justify-content: center;
402
+ padding: 7px;
403
+ border: 1px solid #d9dde4;
404
+ }
405
+ .rc-duo button:disabled {
406
+ cursor: default;
407
+ opacity: 0.5;
408
+ }
409
+ .rc-duo-views button[aria-pressed='true'] {
410
+ background: #e5eaf0;
411
+ }
412
+ .rc-duo button:focus-visible,
413
+ .rc-duo input:focus-visible {
414
+ outline: 2px solid #4275c3;
415
+ outline-offset: 2px;
416
+ }
417
+ .rc-duo-error {
418
+ position: absolute;
419
+ top: 16px;
420
+ left: 16px;
421
+ right: 16px;
422
+ padding: 10px;
423
+ border-radius: 8px;
424
+ background: #fff0ee;
425
+ color: #9c2e26;
426
+ font: 13px system-ui;
427
+ }
428
+
429
+ .rc-duo .rc-duo-lock {
430
+ display: inline-flex;
431
+ align-items: center;
432
+ gap: 6px;
433
+ margin-left: auto;
434
+ border: 1px solid #d3dae3;
435
+ }
436
+ .rc-duo-stage[data-position-locked='false'] canvas {
437
+ cursor: grab;
438
+ }
439
+ .rc-duo-stage[data-position-locked='false'] canvas:active {
440
+ cursor: grabbing;
441
+ }