@linxin666/dsh-remote-bridge 0.4.8 → 0.4.10
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/README.i18n.yaml +2 -2
- package/README.md +75 -18
- package/README.zh.md +74 -18
- package/lib/client.js +783 -260
- package/lib/client.js.map +1 -1
- package/lib/index.js +15849 -2913
- package/lib/types/client/PairEntry.d.ts +2 -2
- package/lib/types/client/PairPanel.d.ts +10 -2
- package/lib/types/client/UiPresentRow.d.ts +13 -0
- package/lib/types/client/icons.d.ts +5 -13
- package/lib/types/client/index.d.ts +4 -0
- package/lib/types/client/locales.d.ts +24 -15
- package/lib/types/client/semantic.d.ts +9 -5
- package/lib/types/client/toolview-slot.d.ts +68 -0
- package/lib/types/client/ui-card.d.ts +160 -0
- package/lib/types/core/commands.d.ts +59 -0
- package/lib/types/core/connection.d.ts +106 -0
- package/lib/types/core/devices.d.ts +102 -2
- package/lib/types/core/extension.d.ts +13 -0
- package/lib/types/core/hub.d.ts +129 -15
- package/lib/types/core/liveactivity.d.ts +324 -0
- package/lib/types/core/protocol.d.ts +328 -5
- package/lib/types/core/push.d.ts +186 -0
- package/lib/types/core/questions.d.ts +61 -9
- package/lib/types/core/session-meta.d.ts +55 -1
- package/lib/types/core/squads.d.ts +130 -0
- package/lib/types/core/turn-end-quiet.d.ts +135 -0
- package/lib/types/core/ui.d.ts +238 -0
- package/lib/types/core/usage-stats.d.ts +160 -0
- package/lib/types/core/usage.d.ts +294 -0
- package/lib/types/host/apns.d.ts +151 -0
- package/lib/types/host/squads-ledger.d.ts +39 -0
- package/lib/types/host/squads.d.ts +77 -0
- package/lib/types/host/ui-tools.d.ts +80 -0
- package/lib/types/host/usage-stats.d.ts +75 -0
- package/lib/types/host/watchers.d.ts +95 -0
- package/lib/types/index.d.ts +47 -3
- package/package.json +15 -14
- package/src/client/PairEntry.tsx +58 -31
- package/src/client/PairPanel.tsx +181 -97
- package/src/client/UiPresentRow.tsx +149 -0
- package/src/client/icons.tsx +17 -60
- package/src/client/index.ts +11 -0
- package/src/client/locales.ts +36 -24
- package/src/client/panel.module.css +239 -186
- package/src/client/semantic.ts +10 -6
- package/src/client/toolview-slot.ts +84 -0
- package/src/client/ui-card.ts +368 -0
- package/src/client/ui-present.module.css +87 -0
- package/src/core/commands.ts +95 -0
- package/src/core/connection.ts +811 -12
- package/src/core/devices.ts +337 -5
- package/src/core/extension.ts +20 -0
- package/src/core/hub.ts +518 -43
- package/src/core/liveactivity.ts +833 -0
- package/src/core/protocol.ts +370 -5
- package/src/core/push.ts +385 -0
- package/src/core/questions.ts +81 -10
- package/src/core/session-meta.ts +73 -1
- package/src/core/squads.ts +345 -0
- package/src/core/turn-end-quiet.ts +388 -0
- package/src/core/ui.ts +398 -0
- package/src/core/usage-stats.ts +424 -0
- package/src/core/usage.ts +937 -0
- package/src/core/wire.ts +8 -0
- package/src/host/apns.ts +320 -0
- package/src/host/squads-ledger.ts +105 -0
- package/src/host/squads.ts +206 -0
- package/src/host/ui-tools.ts +233 -0
- package/src/host/usage-stats.ts +155 -0
- package/src/host/watchers.ts +296 -0
- package/src/index.ts +327 -10
package/src/client/locales.ts
CHANGED
|
@@ -1,30 +1,32 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `remote-bridge` namespace dictionaries: the protocol v1 pairing panel copy
|
|
2
|
+
* `remote-bridge` namespace dictionaries: the protocol v1 pairing panel copy and
|
|
3
|
+
* the header of an interactive card (§35.11).
|
|
3
4
|
*
|
|
4
|
-
* The panel has one job —
|
|
5
|
-
* QR symbol
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
5
|
+
* The panel has one job — put the live one-shot code in front of the operator as
|
|
6
|
+
* a QR symbol — so its copy carries exactly four things: what to do with the
|
|
7
|
+
* symbol, how long it lives, which address the phone will actually dial, and why
|
|
8
|
+
* the code is single-use. No key states how the host finds its public address:
|
|
9
|
+
* that is an implementation fact the reader cannot act on.
|
|
10
|
+
*
|
|
11
|
+
* The card's keys say only what the transcript row can act on: whether the page
|
|
12
|
+
* is still waiting for the operator, that it is over, that this desktop renders
|
|
13
|
+
* without answering, and that a page carrying nothing or too much draws a
|
|
14
|
+
* sentence instead of a frame.
|
|
9
15
|
*/
|
|
10
16
|
|
|
11
17
|
/** Simplified Chinese dictionary (the key-set source of truth). */
|
|
12
18
|
export const zh = {
|
|
13
19
|
'entry.label': '配对手机(协议 v1)',
|
|
14
20
|
'title': '协议 v1 配对',
|
|
15
|
-
'subtitle': '用手机 App
|
|
21
|
+
'subtitle': '用手机 App 扫描二维码,即可让手机以协议 v1 连上这台宿主。配对码由本机签发,只在本机显示。',
|
|
16
22
|
'state.reading': '正在取配对码…',
|
|
17
23
|
'pair.qrLabel': '配对二维码',
|
|
18
|
-
'pair.payloadLabel': '二维码内容(可复制后粘贴到手机)',
|
|
19
24
|
'pair.countdown': '剩余 {s} 秒',
|
|
20
|
-
'pair.expired': '
|
|
21
|
-
'pair.expiredHint': '过期的配对码不会被手机接受,请重新取码。',
|
|
22
|
-
'pair.usedHint': '配对码一次性:手机调用 pair.begin 的瞬间即作废,重新取码也会作废上一张。',
|
|
25
|
+
'pair.expired': '配对码已过期',
|
|
23
26
|
'pair.refresh': '重新取码',
|
|
24
|
-
'
|
|
25
|
-
'origin.
|
|
26
|
-
'origin.
|
|
27
|
-
'origin.located.body': '二维码里已经带上 {origin}:手机扫一次就同时设好连接地址与配对码,不需要手填任何东西。',
|
|
27
|
+
'pair.usedHint': '配对码一次性有效:手机一开始配对即作废,重新取码也会作废上一张。',
|
|
28
|
+
'origin.located': '手机将连到 {origin}',
|
|
29
|
+
'origin.missing': '没有找到公网地址:请先在手机里把连接地址填成你的公网中继,再扫码。本页的 {host} 只有本机能连。',
|
|
28
30
|
'forbidden.title': '这个页面不是从本机打开的',
|
|
29
31
|
'forbidden.body': '配对码只能在本机 Web UI 上取。请在本机浏览器打开 http://127.0.0.1:<端口> 后重试。',
|
|
30
32
|
'failed.title': '取配对码失败',
|
|
@@ -36,25 +38,28 @@ export const zh = {
|
|
|
36
38
|
'action.copied': '已复制',
|
|
37
39
|
'action.copyFailed': '复制失败',
|
|
38
40
|
'action.retry': '重试',
|
|
41
|
+
'card.waiting': '等你操作',
|
|
42
|
+
'card.settled': '已结算',
|
|
43
|
+
'card.answerOnPhone': '在手机上作答',
|
|
44
|
+
'card.interacted': '已收到页面上的操作,但桌面端不作答:在手机上作答',
|
|
45
|
+
'card.frameLabel': '整页卡片',
|
|
46
|
+
'card.empty': '这次调用没有可渲染的页面',
|
|
47
|
+
'card.oversize': '页面超出大小上限,未渲染',
|
|
39
48
|
} as const
|
|
40
49
|
|
|
41
50
|
/** English dictionary, key-for-key with the zh source. */
|
|
42
51
|
export const en: Record<RemoteBridgeKey, string> = {
|
|
43
52
|
'entry.label': 'Pair a phone (protocol v1)',
|
|
44
53
|
'title': 'Protocol v1 pairing',
|
|
45
|
-
'subtitle': 'Scan the QR code with the phone app to
|
|
54
|
+
'subtitle': 'Scan the QR code with the phone app to let the phone reach this host over protocol v1. The code is minted by this machine and shown only here.',
|
|
46
55
|
'state.reading': 'Requesting a pairing code…',
|
|
47
56
|
'pair.qrLabel': 'Pairing QR code',
|
|
48
|
-
'pair.payloadLabel': 'What the QR encodes (copy it to paste on the phone)',
|
|
49
57
|
'pair.countdown': '{s} s left',
|
|
50
|
-
'pair.expired': 'The pairing code expired
|
|
51
|
-
'pair.expiredHint': 'An expired code is never accepted; request a new one.',
|
|
52
|
-
'pair.usedHint': 'The code is single-use: the phone spends it the moment it calls pair.begin, and requesting a new one voids the previous code.',
|
|
58
|
+
'pair.expired': 'The pairing code expired',
|
|
53
59
|
'pair.refresh': 'New code',
|
|
54
|
-
'
|
|
55
|
-
'origin.
|
|
56
|
-
'origin.
|
|
57
|
-
'origin.located.body': 'The QR carries {origin}: one scan sets both the connection address and the pairing code, with nothing to type.',
|
|
60
|
+
'pair.usedHint': 'The code is single-use: pairing spends it, and a new code voids the previous one.',
|
|
61
|
+
'origin.located': 'The phone will dial {origin}',
|
|
62
|
+
'origin.missing': 'No public address found: set the phone app to your public relay first, then scan. {host} (this page) is reachable only from this machine.',
|
|
58
63
|
'forbidden.title': 'This page is not open on this machine',
|
|
59
64
|
'forbidden.body': 'Pairing codes can only be read from the machine itself. Open http://127.0.0.1:<port> in a browser on this machine and retry.',
|
|
60
65
|
'failed.title': 'Could not read a pairing code',
|
|
@@ -66,6 +71,13 @@ export const en: Record<RemoteBridgeKey, string> = {
|
|
|
66
71
|
'action.copied': 'Copied',
|
|
67
72
|
'action.copyFailed': 'Copy failed',
|
|
68
73
|
'action.retry': 'Retry',
|
|
74
|
+
'card.waiting': 'Waiting for you',
|
|
75
|
+
'card.settled': 'Settled',
|
|
76
|
+
'card.answerOnPhone': 'Answer on the phone',
|
|
77
|
+
'card.interacted': 'The page sent an action, but this desktop does not answer: answer on the phone',
|
|
78
|
+
'card.frameLabel': 'Page card',
|
|
79
|
+
'card.empty': 'This call carried no page to render',
|
|
80
|
+
'card.oversize': 'The page is over the size limit and was not rendered',
|
|
69
81
|
}
|
|
70
82
|
|
|
71
83
|
/** Every key the `remote-bridge` namespace carries. */
|
|
@@ -1,8 +1,45 @@
|
|
|
1
|
-
/* Protocol v1 pairing panel: the sidebar-foot
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
/* Protocol v1 pairing panel: the sidebar-foot seat plus the QR modal card.
|
|
2
|
+
Colour comes only from the theme's semantic aliases. Geometry, spacing and
|
|
3
|
+
type resolve through the scale below, so no element carries a one-off literal
|
|
4
|
+
(KFL R4 centralizes the value; A3 keeps one spacing rhythm; H5 holds the view
|
|
5
|
+
to three type sizes: 15 title / 13 body / 12 status). */
|
|
6
|
+
|
|
7
|
+
/* ── One geometry scale for the seat and the card ──
|
|
8
|
+
|
|
9
|
+
Four spacing tiers, one type tier per hierarchy level, the symbol's fixed
|
|
10
|
+
module, and the two hit areas. The rule below repeats the selector for each
|
|
11
|
+
root that needs the scale: the seat and the card are siblings in different
|
|
12
|
+
trees, so custom properties cannot be inherited from one shared ancestor. */
|
|
13
|
+
.panel,
|
|
14
|
+
.trigger,
|
|
15
|
+
.dialog {
|
|
16
|
+
--pair-space-1: 4px;
|
|
17
|
+
--pair-space-2: 8px;
|
|
18
|
+
--pair-space-3: 12px;
|
|
19
|
+
--pair-space-4: 24px;
|
|
20
|
+
--pair-title-size: 15px;
|
|
21
|
+
--pair-title-line: 24px;
|
|
22
|
+
--pair-text-size: 13px;
|
|
23
|
+
--pair-text-line: 20px;
|
|
24
|
+
--pair-state-size: 12px;
|
|
25
|
+
--pair-state-line: 18px;
|
|
26
|
+
--pair-qr: 184px;
|
|
27
|
+
--pair-bar: 4px;
|
|
28
|
+
--pair-seat: 36px;
|
|
29
|
+
--pair-close: 28px;
|
|
30
|
+
--pair-hit: 44px;
|
|
31
|
+
--pair-width: 460px;
|
|
32
|
+
--pair-faded: 0.35;
|
|
33
|
+
--pair-focus-offset: 2px;
|
|
34
|
+
/* The live status row's whole box: one text line, its gap and the bar. The
|
|
35
|
+
expired sentence occupies the same box, so the flip moves nothing. */
|
|
36
|
+
--pair-status: calc(var(--pair-state-line) + var(--pair-space-1) + var(--pair-bar));
|
|
37
|
+
/* The address line's reserved box: the located line and the missing-address
|
|
38
|
+
warning each fill it, so neither the hint nor the action row below moves. */
|
|
39
|
+
--pair-address: calc(var(--pair-text-line) * 2);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/* ── Sidebar foot seat ── */
|
|
6
43
|
|
|
7
44
|
.trigger {
|
|
8
45
|
position: relative;
|
|
@@ -10,8 +47,8 @@
|
|
|
10
47
|
display: inline-flex;
|
|
11
48
|
align-items: center;
|
|
12
49
|
justify-content: center;
|
|
13
|
-
width:
|
|
14
|
-
height:
|
|
50
|
+
width: var(--pair-seat);
|
|
51
|
+
height: var(--pair-seat);
|
|
15
52
|
border: none;
|
|
16
53
|
border-radius: 50%;
|
|
17
54
|
padding: 0;
|
|
@@ -20,7 +57,16 @@
|
|
|
20
57
|
cursor: pointer;
|
|
21
58
|
/* Ahead of the update/remote stack in the shared footer-action seat. */
|
|
22
59
|
order: -1;
|
|
23
|
-
transition: background-color
|
|
60
|
+
transition: background-color var(--ds-transition-duration) ease, color var(--ds-transition-duration) ease;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/* The 36px visual keeps its size; the negative inset grows the pointer and
|
|
64
|
+
touch target to var(--pair-hit) without touching the seat's geometry (I3). */
|
|
65
|
+
.trigger::after {
|
|
66
|
+
content: '';
|
|
67
|
+
position: absolute;
|
|
68
|
+
inset: calc((var(--pair-hit) - var(--pair-seat)) / -2);
|
|
69
|
+
border-radius: 50%;
|
|
24
70
|
}
|
|
25
71
|
|
|
26
72
|
.trigger:hover:not(:disabled) {
|
|
@@ -32,9 +78,14 @@
|
|
|
32
78
|
background: var(--dsw-alias-interactive-bg-active);
|
|
33
79
|
}
|
|
34
80
|
|
|
81
|
+
/* The seat is the one control this package still draws itself (see icons.tsx for
|
|
82
|
+
the QR exception): the official Button has no circular seat variant, and the
|
|
83
|
+
seat's geometry belongs to the shell's footer row. Its states therefore read
|
|
84
|
+
the very slots the library's ghost variant reads — hover, active and the
|
|
85
|
+
family's declared focus ring — so the two never diverge in behaviour. */
|
|
35
86
|
.trigger:focus-visible {
|
|
36
|
-
outline:
|
|
37
|
-
|
|
87
|
+
outline: var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color, var(--dsw-alias-state-business-primary));
|
|
88
|
+
outline-offset: var(--pair-focus-offset);
|
|
38
89
|
}
|
|
39
90
|
|
|
40
91
|
/* ── Rail seat geometry (official-shell compatibility) ──
|
|
@@ -44,55 +95,83 @@
|
|
|
44
95
|
rail mode stack the seat vertically, keeping every occupant in the 36px
|
|
45
96
|
column the shell uses elsewhere. The selector carries no class names (they
|
|
46
97
|
stay global under CSS Modules) and matches only a seat that actually holds
|
|
47
|
-
this trigger.
|
|
98
|
+
this trigger. The gap keeps a fallback literal because this rule targets the
|
|
99
|
+
seat element itself, which is outside this plugin's token scope. */
|
|
48
100
|
[class*='footerActions']:has([data-dsh-plugin='remote-bridge'][data-wide='rail']) {
|
|
49
101
|
flex-direction: column;
|
|
50
102
|
align-items: center;
|
|
51
|
-
gap: 4px;
|
|
103
|
+
gap: var(--pair-space-1, 4px);
|
|
52
104
|
}
|
|
53
105
|
|
|
54
|
-
/* ──
|
|
106
|
+
/* ── The headless card the official Modal renders ──
|
|
55
107
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
108
|
+
The library owns the overlay, the mask, the radius, the elevation and the
|
|
109
|
+
card's own fade-in; this class only sizes the card for the 184px symbol and
|
|
110
|
+
pads it. Both declarations repeat the class so they win over the library's
|
|
111
|
+
own .dialog rule whichever order the two stylesheets are injected in. */
|
|
112
|
+
.dialog.dialog {
|
|
113
|
+
width: min(var(--pair-width), 100%);
|
|
114
|
+
max-height: 100%;
|
|
115
|
+
padding: var(--pair-space-4);
|
|
116
|
+
overflow: auto;
|
|
63
117
|
}
|
|
64
118
|
|
|
65
|
-
|
|
66
|
-
position: absolute;
|
|
67
|
-
inset: 0;
|
|
68
|
-
background: var(--dsw-alias-bg-mask-1);
|
|
69
|
-
backdrop-filter: var(--dsw-mask-blur);
|
|
70
|
-
}
|
|
119
|
+
/* ── Panel ── */
|
|
71
120
|
|
|
72
121
|
.panel {
|
|
73
|
-
position: relative;
|
|
74
|
-
z-index: 1;
|
|
75
122
|
display: flex;
|
|
76
123
|
flex-direction: column;
|
|
77
|
-
gap:
|
|
124
|
+
gap: var(--pair-space-3);
|
|
78
125
|
box-sizing: border-box;
|
|
79
|
-
width:
|
|
80
|
-
max-width:
|
|
81
|
-
max-height: calc(100vh - 48px);
|
|
82
|
-
overflow: auto;
|
|
83
|
-
padding: 24px;
|
|
84
|
-
border-radius: 24px;
|
|
85
|
-
background: var(--dsw-alias-bg-layer-2);
|
|
86
|
-
box-shadow: var(--dsw-shadow-lv3);
|
|
126
|
+
width: 100%;
|
|
127
|
+
max-width: 100%;
|
|
87
128
|
color: var(--dsw-alias-label-primary);
|
|
88
|
-
font-size:
|
|
89
|
-
line-height:
|
|
90
|
-
|
|
129
|
+
font-size: var(--pair-text-size);
|
|
130
|
+
line-height: var(--pair-text-line);
|
|
131
|
+
/* The leave leg's second shape: a fade that needs no keyframe name. It is
|
|
132
|
+
what the reduced-motion path runs, and what a browser that cannot report
|
|
133
|
+
the dialog's keyframe name falls back to. */
|
|
134
|
+
transition: opacity var(--ds-transition-duration) var(--ds-ease-in-out);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/* ── Leave leg (M1/M2) ──
|
|
138
|
+
|
|
139
|
+
The library animates the card in with its own opacity-only `modalEnter` and
|
|
140
|
+
returns null the instant `open` goes false, so the exit is this plugin's: the
|
|
141
|
+
panel stays mounted and plays that same keyframe backwards — same name, same
|
|
142
|
+
duration, same curve, direction reversed — which is the enter path read in the
|
|
143
|
+
opposite direction. `--pair-exit-name` carries that name because the bundler
|
|
144
|
+
scopes the library's keyframes, so the name cannot be written here; PairPanel
|
|
145
|
+
reads it off the mounted dialog when closing starts and clears it on reopen.
|
|
146
|
+
With no name the declaration resolves to `none` and the card falls back to the
|
|
147
|
+
transition on .panel, which is also what reduced motion runs.
|
|
148
|
+
|
|
149
|
+
Known limitation, recorded rather than hidden: the mask's own fade-in belongs
|
|
150
|
+
to the library's .mask::after and its name is scoped the same way, so the
|
|
151
|
+
overlay behind this reverse fade cannot be reversed and clears with the node.
|
|
152
|
+
Reusing a scoped keyframe from outside the library's stylesheet is not
|
|
153
|
+
possible, and duplicating the mask to animate it would fork the primitive. */
|
|
154
|
+
.panel[data-closing] {
|
|
155
|
+
opacity: 0;
|
|
156
|
+
animation: var(--pair-exit-name, none) var(--ds-transition-duration) var(--ds-ease-in-out) reverse both;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/* Reduced motion (M5): the library drops its own animation, so the leave leg
|
|
160
|
+
keeps the lifecycle with one short opacity fade instead of no motion at all.
|
|
161
|
+
No travel, no size change, no focus move: the layout is identical to the
|
|
162
|
+
settled state while the fade runs, and the dialog stays mounted until it ends. */
|
|
163
|
+
@media (prefers-reduced-motion: reduce) {
|
|
164
|
+
.panel[data-closing] {
|
|
165
|
+
animation: none;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/* ── Header ── */
|
|
91
170
|
|
|
92
171
|
.header {
|
|
93
172
|
display: flex;
|
|
94
173
|
align-items: flex-start;
|
|
95
|
-
gap:
|
|
174
|
+
gap: var(--pair-space-3);
|
|
96
175
|
}
|
|
97
176
|
|
|
98
177
|
.heading {
|
|
@@ -102,243 +181,217 @@
|
|
|
102
181
|
|
|
103
182
|
.title {
|
|
104
183
|
margin: 0;
|
|
105
|
-
font-size:
|
|
184
|
+
font-size: var(--pair-title-size);
|
|
106
185
|
font-weight: 600;
|
|
107
|
-
line-height:
|
|
186
|
+
line-height: var(--pair-title-line);
|
|
108
187
|
}
|
|
109
188
|
|
|
110
189
|
.subtitle {
|
|
111
|
-
margin:
|
|
190
|
+
margin: var(--pair-space-1) 0 0;
|
|
112
191
|
color: var(--dsw-alias-label-secondary);
|
|
113
|
-
font-size:
|
|
114
|
-
line-height:
|
|
192
|
+
font-size: var(--pair-text-size);
|
|
193
|
+
line-height: var(--pair-text-line);
|
|
115
194
|
}
|
|
116
195
|
|
|
117
|
-
|
|
196
|
+
/* Official ghost/sm control: the library owns hover, focus and disabled, and
|
|
197
|
+
the negative inset below restores the 44px target around its 28px box (I3). */
|
|
198
|
+
.close {
|
|
199
|
+
position: relative;
|
|
118
200
|
flex: none;
|
|
119
|
-
|
|
120
|
-
align-items: center;
|
|
121
|
-
justify-content: center;
|
|
122
|
-
width: 28px;
|
|
123
|
-
height: 28px;
|
|
124
|
-
border: none;
|
|
125
|
-
border-radius: 8px;
|
|
201
|
+
width: var(--pair-close);
|
|
126
202
|
padding: 0;
|
|
127
|
-
background: transparent;
|
|
128
203
|
color: var(--dsw-alias-label-secondary);
|
|
129
|
-
cursor: pointer;
|
|
130
|
-
transition: background-color 120ms ease, color 120ms ease;
|
|
131
204
|
}
|
|
132
205
|
|
|
133
|
-
.
|
|
134
|
-
|
|
135
|
-
|
|
206
|
+
.close::after {
|
|
207
|
+
content: '';
|
|
208
|
+
position: absolute;
|
|
209
|
+
inset: calc((var(--pair-hit) - var(--pair-close)) / -2);
|
|
210
|
+
border-radius: 50%;
|
|
136
211
|
}
|
|
137
212
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
213
|
+
/* ── Body ── */
|
|
214
|
+
|
|
215
|
+
.body {
|
|
216
|
+
display: flex;
|
|
217
|
+
flex-direction: column;
|
|
218
|
+
gap: var(--pair-space-2);
|
|
141
219
|
}
|
|
142
220
|
|
|
143
|
-
/* ── QR card ──
|
|
221
|
+
/* ── QR card ──
|
|
144
222
|
|
|
223
|
+
The symbol's box is a fixed module, so the card the read leaves behind and
|
|
224
|
+
the card the code arrives in are the same height (A4), and the status row's
|
|
225
|
+
height is fixed too: the countdown and the expiry sentence share one box. */
|
|
145
226
|
.qrCard {
|
|
146
227
|
display: flex;
|
|
147
228
|
flex-direction: column;
|
|
148
229
|
align-items: center;
|
|
149
|
-
gap:
|
|
150
|
-
padding:
|
|
230
|
+
gap: var(--pair-space-2);
|
|
231
|
+
padding: var(--pair-space-3);
|
|
151
232
|
border: 1px solid var(--dsw-alias-border-l2);
|
|
152
|
-
border-radius:
|
|
233
|
+
border-radius: var(--dsw-radius-lg);
|
|
153
234
|
background: var(--dsw-alias-bg-layer-1);
|
|
154
235
|
}
|
|
155
236
|
|
|
156
237
|
/* No background of its own: QRCodeSVG paints its full-size white quiet zone
|
|
157
|
-
itself
|
|
158
|
-
|
|
159
|
-
.
|
|
238
|
+
itself, so the symbol keeps scanner contrast in either theme and this box
|
|
239
|
+
adds no literal colour. */
|
|
240
|
+
.qrSlot {
|
|
160
241
|
display: flex;
|
|
161
242
|
align-items: center;
|
|
162
243
|
justify-content: center;
|
|
244
|
+
width: var(--pair-qr);
|
|
245
|
+
height: var(--pair-qr);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
/* An expired code stops looking scannable without moving or resizing: the
|
|
249
|
+
symbol keeps its box and only loses contrast. */
|
|
250
|
+
.qrSlot[data-expired] {
|
|
251
|
+
opacity: var(--pair-faded);
|
|
163
252
|
}
|
|
164
253
|
|
|
165
|
-
.
|
|
254
|
+
.skeleton {
|
|
166
255
|
display: block;
|
|
167
|
-
width:
|
|
168
|
-
height:
|
|
256
|
+
width: var(--pair-qr);
|
|
257
|
+
height: var(--pair-qr);
|
|
258
|
+
border-radius: var(--dsw-radius-md);
|
|
259
|
+
background: var(--dsw-alias-interactive-bg-hover);
|
|
169
260
|
}
|
|
170
261
|
|
|
171
|
-
.
|
|
262
|
+
.status {
|
|
172
263
|
display: flex;
|
|
173
264
|
flex-direction: column;
|
|
174
265
|
align-items: center;
|
|
175
|
-
|
|
266
|
+
justify-content: center;
|
|
267
|
+
gap: var(--pair-space-1);
|
|
268
|
+
box-sizing: border-box;
|
|
176
269
|
width: 100%;
|
|
270
|
+
height: var(--pair-status);
|
|
177
271
|
}
|
|
178
272
|
|
|
179
|
-
.
|
|
273
|
+
.statusText {
|
|
274
|
+
margin: 0;
|
|
180
275
|
color: var(--dsw-alias-label-secondary);
|
|
181
|
-
font-size:
|
|
182
|
-
line-height:
|
|
276
|
+
font-size: var(--pair-state-size);
|
|
277
|
+
line-height: var(--pair-state-line);
|
|
183
278
|
font-variant-numeric: tabular-nums;
|
|
184
279
|
}
|
|
185
280
|
|
|
186
281
|
.bar {
|
|
187
282
|
display: block;
|
|
188
283
|
width: 100%;
|
|
189
|
-
height:
|
|
284
|
+
height: var(--pair-bar);
|
|
190
285
|
overflow: hidden;
|
|
191
|
-
border-radius:
|
|
286
|
+
border-radius: var(--dsw-radius-xs);
|
|
192
287
|
background: var(--dsw-alias-interactive-bg-hover);
|
|
193
288
|
}
|
|
194
289
|
|
|
195
290
|
.barFill {
|
|
196
291
|
display: block;
|
|
197
292
|
height: 100%;
|
|
198
|
-
border-radius:
|
|
293
|
+
border-radius: var(--dsw-radius-xs);
|
|
199
294
|
background: var(--dsw-alias-brand-primary);
|
|
200
|
-
transition: width
|
|
295
|
+
transition: width var(--ds-transition-duration) linear;
|
|
201
296
|
}
|
|
202
297
|
|
|
203
|
-
/* ──
|
|
298
|
+
/* ── Supporting group under the card ── */
|
|
204
299
|
|
|
205
|
-
.
|
|
300
|
+
.address {
|
|
206
301
|
display: flex;
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
302
|
+
align-items: center;
|
|
303
|
+
min-height: var(--pair-address);
|
|
304
|
+
margin: 0;
|
|
305
|
+
color: var(--dsw-alias-label-secondary);
|
|
306
|
+
font-size: var(--pair-text-size);
|
|
307
|
+
line-height: var(--pair-text-line);
|
|
210
308
|
}
|
|
211
309
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
310
|
+
/* The warn state slot is the shell's own text colour for a warning line; there
|
|
311
|
+
is no label-warning alias in the theme, and inventing one here would put a
|
|
312
|
+
literal hue outside the declared palette. */
|
|
313
|
+
.address[data-tone='warning'] {
|
|
314
|
+
color: var(--dsw-alias-state-warn-primary);
|
|
216
315
|
}
|
|
217
316
|
|
|
218
|
-
.
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
background: var(--dsw-alias-bg-layer-1);
|
|
224
|
-
color: var(--dsw-alias-label-primary);
|
|
225
|
-
font-family: var(--dsw-font-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
|
|
226
|
-
font-size: 12px;
|
|
227
|
-
line-height: 18px;
|
|
228
|
-
word-break: break-all;
|
|
229
|
-
user-select: all;
|
|
317
|
+
.hint {
|
|
318
|
+
margin: 0;
|
|
319
|
+
color: var(--dsw-alias-label-tertiary);
|
|
320
|
+
font-size: var(--pair-text-size);
|
|
321
|
+
line-height: var(--pair-text-line);
|
|
230
322
|
}
|
|
231
323
|
|
|
232
|
-
/* ──
|
|
324
|
+
/* ── Refusals ── */
|
|
233
325
|
|
|
234
326
|
.notice {
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
327
|
+
display: flex;
|
|
328
|
+
align-items: flex-start;
|
|
329
|
+
gap: var(--pair-space-2);
|
|
330
|
+
padding: var(--pair-space-3);
|
|
331
|
+
border: 1px solid var(--dsw-alias-state-error-primary);
|
|
332
|
+
border-radius: var(--dsw-radius-md);
|
|
238
333
|
background: var(--dsw-alias-bg-layer-1);
|
|
239
334
|
}
|
|
240
335
|
|
|
241
|
-
.
|
|
242
|
-
|
|
336
|
+
.noticeIcon {
|
|
337
|
+
flex: none;
|
|
338
|
+
display: inline-flex;
|
|
339
|
+
color: var(--dsw-alias-state-error-primary);
|
|
243
340
|
}
|
|
244
341
|
|
|
245
|
-
.
|
|
246
|
-
|
|
342
|
+
.noticeCopy {
|
|
343
|
+
min-width: 0;
|
|
247
344
|
}
|
|
248
345
|
|
|
249
346
|
.noticeTitle {
|
|
250
347
|
margin: 0;
|
|
348
|
+
font-size: var(--pair-text-size);
|
|
251
349
|
font-weight: 600;
|
|
252
|
-
line-height:
|
|
350
|
+
line-height: var(--pair-text-line);
|
|
253
351
|
}
|
|
254
352
|
|
|
255
|
-
.
|
|
256
|
-
margin:
|
|
353
|
+
.noticeText {
|
|
354
|
+
margin: var(--pair-space-1) 0 0;
|
|
257
355
|
color: var(--dsw-alias-label-secondary);
|
|
258
|
-
font-size:
|
|
259
|
-
line-height:
|
|
356
|
+
font-size: var(--pair-text-size);
|
|
357
|
+
line-height: var(--pair-text-line);
|
|
260
358
|
}
|
|
261
359
|
|
|
262
|
-
|
|
263
|
-
margin: 0;
|
|
264
|
-
color: var(--dsw-alias-label-tertiary);
|
|
265
|
-
font-size: 12px;
|
|
266
|
-
line-height: 18px;
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
/* ── Actions ── */
|
|
360
|
+
/* ── Action row ── */
|
|
270
361
|
|
|
271
362
|
.actions {
|
|
272
363
|
display: flex;
|
|
273
|
-
justify-content: flex-end;
|
|
274
|
-
gap: 8px;
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
/* The panel's one primary action: a filled button over the primary-action
|
|
278
|
-
token trio, so a skin's light and dark sets both keep readable contrast.
|
|
279
|
-
brand-primary must not be a fill colour (it equals the foreground). */
|
|
280
|
-
.refresh {
|
|
281
|
-
display: inline-flex;
|
|
282
|
-
align-items: center;
|
|
283
|
-
gap: 6px;
|
|
284
|
-
height: 32px;
|
|
285
|
-
border: none;
|
|
286
|
-
border-radius: 16px;
|
|
287
|
-
padding: 0 16px;
|
|
288
|
-
background: var(--dsw-alias-button-primary-fill);
|
|
289
|
-
color: var(--dsw-alias-label-primary-foreground);
|
|
290
|
-
font-size: 14px;
|
|
291
|
-
line-height: 20px;
|
|
292
|
-
cursor: pointer;
|
|
293
|
-
transition: background-color 120ms ease;
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
.refresh:hover:not(:disabled) {
|
|
297
|
-
background: var(--dsw-alias-button-primary-hover);
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
.refresh:disabled {
|
|
301
|
-
opacity: 0.5;
|
|
302
|
-
cursor: default;
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
.refresh:focus-visible {
|
|
306
|
-
outline: none;
|
|
307
|
-
box-shadow: 0 0 0 2px var(--dsw-alias-bg-layer-2), 0 0 0 4px var(--dsw-alias-brand-primary);
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
.copyButton {
|
|
311
|
-
display: inline-flex;
|
|
312
364
|
align-items: center;
|
|
313
|
-
justify-content:
|
|
314
|
-
gap:
|
|
315
|
-
align-self: flex-start;
|
|
316
|
-
height: 28px;
|
|
317
|
-
border: none;
|
|
318
|
-
border-radius: 8px;
|
|
319
|
-
padding: 0 10px;
|
|
320
|
-
background: transparent;
|
|
321
|
-
color: var(--dsw-alias-label-secondary);
|
|
322
|
-
font-size: 12px;
|
|
323
|
-
line-height: 18px;
|
|
324
|
-
cursor: pointer;
|
|
325
|
-
transition: background-color 120ms ease, color 120ms ease;
|
|
365
|
+
justify-content: flex-end;
|
|
366
|
+
gap: var(--pair-space-2);
|
|
326
367
|
}
|
|
327
368
|
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
369
|
+
/* The copy control's three labels share one grid cell, so the button keeps one
|
|
370
|
+
width and the row keeps its gaps while the label changes (A4/M3). Only the
|
|
371
|
+
active label is exposed to assistive technology. */
|
|
372
|
+
.labels {
|
|
373
|
+
display: grid;
|
|
331
374
|
}
|
|
332
375
|
|
|
333
|
-
.
|
|
334
|
-
|
|
376
|
+
.label {
|
|
377
|
+
grid-area: 1 / 1;
|
|
335
378
|
}
|
|
336
379
|
|
|
337
|
-
.
|
|
338
|
-
|
|
380
|
+
.label[data-visible='false'] {
|
|
381
|
+
visibility: hidden;
|
|
339
382
|
}
|
|
340
383
|
|
|
341
|
-
.
|
|
342
|
-
|
|
343
|
-
|
|
384
|
+
/* The copy outcome as a live region. The label swap above confirms the result
|
|
385
|
+
on screen, but a control's name is spoken when focus lands on it, so the
|
|
386
|
+
change itself can pass unheard; this region says it instead. It takes no part
|
|
387
|
+
in the row: out of flow, no box, clipped away, with no type, colour or length
|
|
388
|
+
of its own, so the action row keeps the geometry it had. */
|
|
389
|
+
.announce {
|
|
390
|
+
position: absolute;
|
|
391
|
+
width: 0;
|
|
392
|
+
height: 0;
|
|
393
|
+
margin: 0;
|
|
394
|
+
overflow: hidden;
|
|
395
|
+
clip: rect(0, 0, 0, 0);
|
|
396
|
+
clip-path: inset(0);
|
|
344
397
|
}
|