dsh-coding-subscription-oauth 0.5.8 → 0.6.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.
- package/CHANGELOG.md +217 -188
- package/CONTRIBUTING.md +120 -120
- package/INSTALL.md +241 -209
- package/LICENSE +19 -19
- package/NOTICE +11 -11
- package/README.de.md +298 -294
- package/README.es.md +299 -295
- package/README.fr.md +299 -295
- package/README.ja.md +299 -295
- package/README.ko.md +299 -295
- package/README.md +313 -307
- package/README.pt-BR.md +299 -295
- package/README.ru.md +299 -295
- package/README.zh-CN.md +311 -305
- package/compatibility/dsh-bom.json +30 -0
- package/cordis.patch.yml +13 -13
- package/docs/00-project-rules.md +195 -195
- package/docs/02-architecture.md +134 -129
- package/docs/02-architecture.zh-CN.md +134 -129
- package/lib/adapter.d.ts.map +1 -1
- package/lib/alias-adapter.d.ts +3 -1
- package/lib/alias-adapter.d.ts.map +1 -1
- package/lib/auth-routes.d.ts +8 -15
- package/lib/auth-routes.d.ts.map +1 -1
- package/lib/bin.js +746 -1402
- package/lib/bin.js.map +4 -4
- package/lib/capability-routes.d.ts +3 -3
- package/lib/capability-routes.d.ts.map +1 -1
- package/lib/capability-settings.d.ts +5 -4
- package/lib/capability-settings.d.ts.map +1 -1
- package/lib/client.js +27 -8
- package/lib/client.js.map +4 -4
- package/lib/compatibility.d.ts +46 -0
- package/lib/compatibility.d.ts.map +1 -0
- package/lib/dsh-host-adapter.d.ts +18 -0
- package/lib/dsh-host-adapter.d.ts.map +1 -0
- package/lib/gateway-auth.d.ts +1 -2
- package/lib/gateway-auth.d.ts.map +1 -1
- package/lib/gateway-routes.d.ts +3 -4
- package/lib/gateway-routes.d.ts.map +1 -1
- package/lib/gateway.d.ts +4 -0
- package/lib/gateway.d.ts.map +1 -1
- package/lib/ids.d.ts +3 -32
- package/lib/ids.d.ts.map +1 -1
- package/lib/imagine-routes.d.ts +2 -0
- package/lib/imagine-routes.d.ts.map +1 -1
- package/lib/index.d.ts +19 -4
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +26627 -1047
- package/lib/index.js.map +4 -4
- package/lib/invariant.js.map +1 -1
- package/lib/oauth-import-routes.d.ts +3 -4
- package/lib/oauth-import-routes.d.ts.map +1 -1
- package/lib/proxy.d.ts +3 -16
- package/lib/proxy.d.ts.map +1 -1
- package/lib/web-origin.d.ts +28 -4
- package/lib/web-origin.d.ts.map +1 -1
- package/lib/web-routes.d.ts.map +1 -1
- package/media/en/settings_accounts.png +0 -0
- package/media/en/settings_capabilities.png +0 -0
- package/media/en/settings_gateway.png +0 -0
- package/media/settings_accounts.png +0 -0
- package/media/settings_capabilities.png +0 -0
- package/media/settings_gateway.png +0 -0
- package/media/settings_overview.png +0 -0
- package/media/zh-CN/settings_accounts.png +0 -0
- package/media/zh-CN/settings_capabilities.png +0 -0
- package/media/zh-CN/settings_gateway.png +0 -0
- package/package.json +211 -174
- package/patches/dsh-agy@0.1.2.patch +25 -25
- package/scripts/release.mjs +186 -170
- package/scripts/smoke-deployed-routes.mjs +146 -146
- package/scripts/verify-deployed-catalog.mjs +87 -87
- package/src/adapter.ts +329 -268
- package/src/alias-adapter.ts +141 -147
- package/src/auth-routes.ts +921 -871
- package/src/auth.ts +67 -67
- package/src/bin.ts +350 -350
- package/src/capability-routes.ts +279 -275
- package/src/capability-runtime.ts +313 -313
- package/src/capability-settings.ts +658 -657
- package/src/capability-tools.ts +666 -666
- package/src/catalog.ts +271 -271
- package/src/client/GrokBuildSettings.tsx +770 -718
- package/src/client/api.ts +88 -88
- package/src/client/components/AboutTab.tsx +30 -30
- package/src/client/components/AccountsTab.tsx +241 -224
- package/src/client/components/Badge.tsx +33 -33
- package/src/client/components/CapabilitiesTab.tsx +265 -227
- package/src/client/components/CliPullPreview.tsx +116 -107
- package/src/client/components/CopyButton.tsx +57 -57
- package/src/client/components/GatewayTab.tsx +469 -409
- package/src/client/components/NoticeBanner.tsx +46 -46
- package/src/client/components/ProgressBar.tsx +53 -53
- package/src/client/components/ProviderCard.tsx +606 -502
- package/src/client/components/SettingsTabs.tsx +75 -75
- package/src/client/components/ToggleSwitch.tsx +71 -62
- package/src/client/constants.ts +224 -206
- package/src/client/display.ts +61 -61
- package/src/client/dshClientAdapter.ts +127 -0
- package/src/client/gatewaySnippets.ts +37 -36
- package/src/client/index.tsx +156 -37
- package/src/client/locales.ts +535 -491
- package/src/client/microStyles.ts +52 -33
- package/src/client/parsers.ts +396 -386
- package/src/client/styles.ts +325 -307
- package/src/client/types.ts +197 -185
- package/src/codex-http.ts +447 -447
- package/src/codex-images.ts +485 -485
- package/src/codex-model-capabilities.ts +320 -320
- package/src/codex-search.ts +245 -245
- package/src/codex-usage.ts +263 -263
- package/src/compatibility.ts +55 -0
- package/src/dsh-host-adapter.ts +173 -0
- package/src/gateway-anthropic-messages.ts +84 -84
- package/src/gateway-auth.ts +102 -100
- package/src/gateway-backend.ts +274 -274
- package/src/gateway-body.ts +49 -49
- package/src/gateway-config.ts +76 -76
- package/src/gateway-http.ts +104 -104
- package/src/gateway-openai-chat.ts +124 -124
- package/src/gateway-openai-responses.ts +53 -53
- package/src/gateway-parse.ts +224 -224
- package/src/gateway-protocol.ts +52 -52
- package/src/gateway-routes.ts +158 -152
- package/src/gateway.ts +258 -242
- package/src/grok-errors.ts +24 -24
- package/src/grok-imagine.ts +1627 -1627
- package/src/grok-import.ts +151 -151
- package/src/http-json.ts +82 -82
- package/src/ids.ts +59 -45
- package/src/imagine-routes.ts +463 -461
- package/src/index.ts +729 -592
- package/src/invariant.ts +17 -17
- package/src/kimi-errors.ts +26 -26
- package/src/media-store.ts +927 -927
- package/src/oauth-import-routes.ts +324 -314
- package/src/oauth-providers.ts +152 -152
- package/src/oauth-session.ts +183 -183
- package/src/oauth-sources.ts +1104 -1104
- package/src/oauth.ts +620 -620
- package/src/provider.ts +128 -128
- package/src/proxy.ts +11 -99
- package/src/redact.ts +72 -72
- package/src/session.ts +218 -218
- package/src/store.ts +217 -217
- package/src/web-origin.ts +296 -60
- package/src/web-routes.ts +38 -75
package/src/client/styles.ts
CHANGED
|
@@ -1,307 +1,325 @@
|
|
|
1
|
-
/** Shared inline styles using DSH design tokens. */
|
|
2
|
-
|
|
3
|
-
import type { CSSProperties } from "react";
|
|
4
|
-
import type { ProviderStatus } from "./types.ts";
|
|
5
|
-
|
|
6
|
-
export const TRANSITION = "all 0.15s ease";
|
|
7
|
-
|
|
8
|
-
export const pageStyle: CSSProperties = {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
};
|
|
16
|
-
export const
|
|
17
|
-
margin: 0,
|
|
18
|
-
fontSize:
|
|
19
|
-
lineHeight: "
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
};
|
|
39
|
-
export const
|
|
40
|
-
display: "flex",
|
|
41
|
-
alignItems: "center",
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
};
|
|
79
|
-
export const
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
borderRadius: 8,
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
};
|
|
108
|
-
export const
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
};
|
|
138
|
-
export const
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
};
|
|
198
|
-
export const
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
};
|
|
205
|
-
export const
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
export function
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
:
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
1
|
+
/** Shared inline styles using DSH design tokens. */
|
|
2
|
+
|
|
3
|
+
import type { CSSProperties } from "react";
|
|
4
|
+
import type { ProviderStatus } from "./types.ts";
|
|
5
|
+
|
|
6
|
+
export const TRANSITION = "all 0.15s ease";
|
|
7
|
+
|
|
8
|
+
export const pageStyle: CSSProperties = {
|
|
9
|
+
display: "flex",
|
|
10
|
+
flexDirection: "column",
|
|
11
|
+
gap: 16,
|
|
12
|
+
width: "100%",
|
|
13
|
+
maxWidth: 780,
|
|
14
|
+
minWidth: 0,
|
|
15
|
+
};
|
|
16
|
+
export const titleStyle: CSSProperties = {
|
|
17
|
+
margin: 0,
|
|
18
|
+
fontSize: 20,
|
|
19
|
+
lineHeight: "28px",
|
|
20
|
+
fontWeight: 600,
|
|
21
|
+
color: "var(--dsw-alias-label-primary)",
|
|
22
|
+
};
|
|
23
|
+
export const bodyStyle: CSSProperties = {
|
|
24
|
+
margin: 0,
|
|
25
|
+
fontSize: 14,
|
|
26
|
+
lineHeight: "22px",
|
|
27
|
+
color: "var(--dsw-alias-label-secondary)",
|
|
28
|
+
};
|
|
29
|
+
export const cardStyle: CSSProperties = {
|
|
30
|
+
display: "flex",
|
|
31
|
+
flexDirection: "column",
|
|
32
|
+
gap: 14,
|
|
33
|
+
padding: "18px 20px",
|
|
34
|
+
border: "1px solid var(--dsw-alias-border-l2)",
|
|
35
|
+
borderRadius: 12,
|
|
36
|
+
background: "var(--dsw-alias-bg-module-platform)",
|
|
37
|
+
transition: TRANSITION,
|
|
38
|
+
};
|
|
39
|
+
export const rowStyle: CSSProperties = {
|
|
40
|
+
display: "flex",
|
|
41
|
+
alignItems: "center",
|
|
42
|
+
justifyContent: "space-between",
|
|
43
|
+
flexWrap: "wrap",
|
|
44
|
+
gap: 12,
|
|
45
|
+
};
|
|
46
|
+
export const statusStyle: CSSProperties = {
|
|
47
|
+
display: "flex",
|
|
48
|
+
alignItems: "center",
|
|
49
|
+
gap: 9,
|
|
50
|
+
fontSize: 14,
|
|
51
|
+
fontWeight: 500,
|
|
52
|
+
color: "var(--dsw-alias-label-primary)",
|
|
53
|
+
};
|
|
54
|
+
export const buttonStyle: CSSProperties = {
|
|
55
|
+
boxSizing: "border-box",
|
|
56
|
+
minHeight: 34,
|
|
57
|
+
padding: "6px 14px",
|
|
58
|
+
border: "1px solid var(--dsw-alias-border-l4, rgba(127, 127, 127, 0.4))",
|
|
59
|
+
borderRadius: 18,
|
|
60
|
+
background: "var(--dsw-alias-button-elevated-fill, var(--dsw-alias-bg-layer-1))",
|
|
61
|
+
color: "var(--dsw-alias-label-primary)",
|
|
62
|
+
boxShadow: "0 1px 2px rgba(0, 0, 0, 0.18)",
|
|
63
|
+
font: "inherit",
|
|
64
|
+
fontSize: 14,
|
|
65
|
+
fontWeight: 500,
|
|
66
|
+
cursor: "pointer",
|
|
67
|
+
transition: TRANSITION,
|
|
68
|
+
};
|
|
69
|
+
export const primaryButtonStyle: CSSProperties = {
|
|
70
|
+
...buttonStyle,
|
|
71
|
+
// DSH dark theme flips brand-primary to near-white; use the button/foreground
|
|
72
|
+
// pair so primary CTAs stay readable in both light and dark mode.
|
|
73
|
+
border: "none",
|
|
74
|
+
background: "var(--dsw-alias-button-primary-fill)",
|
|
75
|
+
color: "var(--dsw-alias-label-primary-foreground)",
|
|
76
|
+
boxShadow: "0 1px 3px rgba(0, 0, 0, 0.28)",
|
|
77
|
+
fontWeight: 600,
|
|
78
|
+
};
|
|
79
|
+
export const compactButtonStyle: CSSProperties = {
|
|
80
|
+
...buttonStyle,
|
|
81
|
+
minHeight: 28,
|
|
82
|
+
padding: "4px 10px",
|
|
83
|
+
fontSize: 13,
|
|
84
|
+
borderRadius: 8,
|
|
85
|
+
};
|
|
86
|
+
export const errorStyle: CSSProperties = { ...bodyStyle, color: "var(--dsw-alias-state-error-primary)" };
|
|
87
|
+
export const successStyle: CSSProperties = { ...bodyStyle, color: "var(--dsw-alias-state-success-primary, #22a06b)" };
|
|
88
|
+
export const warningStyle: CSSProperties = {
|
|
89
|
+
...bodyStyle,
|
|
90
|
+
padding: "10px 12px",
|
|
91
|
+
borderRadius: 8,
|
|
92
|
+
border: "1px solid color-mix(in srgb, var(--dsw-alias-state-warn-primary, #e06c00) 35%, transparent)",
|
|
93
|
+
background: "color-mix(in srgb, var(--dsw-alias-state-warn-primary, #e06c00) 10%, transparent)",
|
|
94
|
+
color: "var(--dsw-alias-label-primary)",
|
|
95
|
+
};
|
|
96
|
+
export const tipStyle: CSSProperties = {
|
|
97
|
+
...bodyStyle,
|
|
98
|
+
padding: "10px 12px",
|
|
99
|
+
borderRadius: 8,
|
|
100
|
+
border: "1px solid var(--dsw-alias-border-l2)",
|
|
101
|
+
background: "var(--dsw-alias-bg-layer-1)",
|
|
102
|
+
color: "var(--dsw-alias-label-primary)",
|
|
103
|
+
};
|
|
104
|
+
export const noticeStyle: CSSProperties = {
|
|
105
|
+
...tipStyle,
|
|
106
|
+
animation: "dsh-coding-oauth-fade-in 0.2s ease",
|
|
107
|
+
};
|
|
108
|
+
export const codeStyle: CSSProperties = {
|
|
109
|
+
fontFamily: "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace",
|
|
110
|
+
fontSize: 20,
|
|
111
|
+
letterSpacing: "0.08em",
|
|
112
|
+
fontWeight: 600,
|
|
113
|
+
color: "var(--dsw-alias-label-primary)",
|
|
114
|
+
};
|
|
115
|
+
export const monoStyle: CSSProperties = { fontFamily: "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" };
|
|
116
|
+
export const snippetStyle: CSSProperties = {
|
|
117
|
+
...monoStyle,
|
|
118
|
+
display: "block",
|
|
119
|
+
fontSize: 12,
|
|
120
|
+
lineHeight: "18px",
|
|
121
|
+
padding: "10px 12px",
|
|
122
|
+
borderRadius: 8,
|
|
123
|
+
border: "1px solid var(--dsw-alias-border-l2)",
|
|
124
|
+
background: "var(--dsw-alias-bg-layer-1)",
|
|
125
|
+
color: "var(--dsw-alias-label-primary)",
|
|
126
|
+
overflowWrap: "anywhere",
|
|
127
|
+
whiteSpace: "pre-wrap",
|
|
128
|
+
};
|
|
129
|
+
export const linkStyle: CSSProperties = { color: "var(--dsw-alias-brand-primary)", wordBreak: "break-all" };
|
|
130
|
+
export const listStyle: CSSProperties = {
|
|
131
|
+
display: "flex",
|
|
132
|
+
flexDirection: "column",
|
|
133
|
+
gap: 8,
|
|
134
|
+
margin: 0,
|
|
135
|
+
padding: 0,
|
|
136
|
+
listStyle: "none",
|
|
137
|
+
};
|
|
138
|
+
export const checkRowStyle: CSSProperties = {
|
|
139
|
+
display: "flex",
|
|
140
|
+
alignItems: "flex-start",
|
|
141
|
+
gap: 8,
|
|
142
|
+
fontSize: 14,
|
|
143
|
+
color: "var(--dsw-alias-label-primary)",
|
|
144
|
+
};
|
|
145
|
+
export const inputStyle: CSSProperties = {
|
|
146
|
+
boxSizing: "border-box",
|
|
147
|
+
width: "100%",
|
|
148
|
+
minHeight: 34,
|
|
149
|
+
padding: "6px 12px",
|
|
150
|
+
border: "1px solid var(--dsw-alias-border-l2)",
|
|
151
|
+
borderRadius: 8,
|
|
152
|
+
background: "var(--dsw-alias-bg-layer-1)",
|
|
153
|
+
color: "var(--dsw-alias-label-primary)",
|
|
154
|
+
font: "inherit",
|
|
155
|
+
fontSize: 13,
|
|
156
|
+
transition: TRANSITION,
|
|
157
|
+
};
|
|
158
|
+
export const nestedStyle: CSSProperties = {
|
|
159
|
+
display: "flex",
|
|
160
|
+
flexDirection: "column",
|
|
161
|
+
gap: 8,
|
|
162
|
+
padding: "12px 14px",
|
|
163
|
+
border: "1px solid var(--dsw-alias-border-l2)",
|
|
164
|
+
borderRadius: 8,
|
|
165
|
+
background: "var(--dsw-alias-bg-layer-1)",
|
|
166
|
+
};
|
|
167
|
+
export const hintStyle: CSSProperties = { ...bodyStyle, fontSize: 13 };
|
|
168
|
+
export const visuallyHiddenStyle: CSSProperties = {
|
|
169
|
+
position: "absolute",
|
|
170
|
+
width: 1,
|
|
171
|
+
height: 1,
|
|
172
|
+
padding: 0,
|
|
173
|
+
margin: -1,
|
|
174
|
+
overflow: "hidden",
|
|
175
|
+
clip: "rect(0, 0, 0, 0)",
|
|
176
|
+
whiteSpace: "nowrap",
|
|
177
|
+
border: 0,
|
|
178
|
+
};
|
|
179
|
+
export const segmentedNavStyle: CSSProperties = {
|
|
180
|
+
display: "inline-flex",
|
|
181
|
+
flexWrap: "wrap",
|
|
182
|
+
gap: 2,
|
|
183
|
+
padding: 3,
|
|
184
|
+
borderRadius: 10,
|
|
185
|
+
border: "1px solid var(--dsw-alias-border-l2)",
|
|
186
|
+
background: "var(--dsw-alias-bg-layer-1)",
|
|
187
|
+
};
|
|
188
|
+
export const segmentedTabStyle: CSSProperties = {
|
|
189
|
+
...buttonStyle,
|
|
190
|
+
border: "none",
|
|
191
|
+
borderRadius: 8,
|
|
192
|
+
boxShadow: "none",
|
|
193
|
+
background: "transparent",
|
|
194
|
+
minHeight: 32,
|
|
195
|
+
padding: "5px 12px",
|
|
196
|
+
fontSize: 13,
|
|
197
|
+
};
|
|
198
|
+
export const segmentedTabActiveStyle: CSSProperties = {
|
|
199
|
+
...segmentedTabStyle,
|
|
200
|
+
background: "var(--dsw-alias-bg-module-platform)",
|
|
201
|
+
color: "var(--dsw-alias-label-primary)",
|
|
202
|
+
boxShadow: "0 1px 2px rgba(0, 0, 0, 0.12)",
|
|
203
|
+
fontWeight: 600,
|
|
204
|
+
};
|
|
205
|
+
export const panelStyle: CSSProperties = {
|
|
206
|
+
display: "flex",
|
|
207
|
+
flexDirection: "column",
|
|
208
|
+
gap: 14,
|
|
209
|
+
minWidth: 0,
|
|
210
|
+
};
|
|
211
|
+
export const accountGridStyle: CSSProperties = {
|
|
212
|
+
display: "grid",
|
|
213
|
+
gridTemplateColumns: "repeat(auto-fill, minmax(min(320px, 100%), 1fr))",
|
|
214
|
+
gap: 14,
|
|
215
|
+
};
|
|
216
|
+
export const copyRowStyle: CSSProperties = {
|
|
217
|
+
display: "flex",
|
|
218
|
+
alignItems: "center",
|
|
219
|
+
justifyContent: "space-between",
|
|
220
|
+
flexWrap: "wrap",
|
|
221
|
+
gap: 8,
|
|
222
|
+
};
|
|
223
|
+
export const skeletonStyle: CSSProperties = {
|
|
224
|
+
...cardStyle,
|
|
225
|
+
minHeight: 88,
|
|
226
|
+
background:
|
|
227
|
+
"linear-gradient(90deg, var(--dsw-alias-bg-layer-1) 0%, var(--dsw-alias-bg-module-platform) 50%, var(--dsw-alias-bg-layer-1) 100%)",
|
|
228
|
+
backgroundSize: "200% 100%",
|
|
229
|
+
animation: "dsh-coding-oauth-skeleton-pulse 1.4s ease-in-out infinite",
|
|
230
|
+
};
|
|
231
|
+
export const stepRowStyle: CSSProperties = {
|
|
232
|
+
display: "flex",
|
|
233
|
+
alignItems: "flex-start",
|
|
234
|
+
gap: 10,
|
|
235
|
+
fontSize: 14,
|
|
236
|
+
color: "var(--dsw-alias-label-secondary)",
|
|
237
|
+
};
|
|
238
|
+
export const stepActiveStyle: CSSProperties = {
|
|
239
|
+
...stepRowStyle,
|
|
240
|
+
color: "var(--dsw-alias-label-primary)",
|
|
241
|
+
fontWeight: 500,
|
|
242
|
+
};
|
|
243
|
+
export const stepNumberStyle: CSSProperties = {
|
|
244
|
+
display: "inline-flex",
|
|
245
|
+
alignItems: "center",
|
|
246
|
+
justifyContent: "center",
|
|
247
|
+
width: 22,
|
|
248
|
+
height: 22,
|
|
249
|
+
borderRadius: "50%",
|
|
250
|
+
flex: "0 0 auto",
|
|
251
|
+
fontSize: 12,
|
|
252
|
+
fontWeight: 600,
|
|
253
|
+
background: "var(--dsw-alias-bg-layer-1)",
|
|
254
|
+
border: "1px solid var(--dsw-alias-border-l2)",
|
|
255
|
+
color: "var(--dsw-alias-label-secondary)",
|
|
256
|
+
};
|
|
257
|
+
export const stepNumberActiveStyle: CSSProperties = {
|
|
258
|
+
...stepNumberStyle,
|
|
259
|
+
background: "var(--dsw-alias-button-primary-fill)",
|
|
260
|
+
borderColor: "var(--dsw-alias-button-primary-fill)",
|
|
261
|
+
color: "var(--dsw-alias-label-primary-foreground)",
|
|
262
|
+
};
|
|
263
|
+
|
|
264
|
+
export type StatusTone = "success" | "error" | "warning" | "info" | "neutral";
|
|
265
|
+
|
|
266
|
+
export function statusToneColor(tone: StatusTone): string {
|
|
267
|
+
switch (tone) {
|
|
268
|
+
case "success":
|
|
269
|
+
return "var(--dsw-alias-state-success-primary, #22a06b)";
|
|
270
|
+
case "error":
|
|
271
|
+
return "var(--dsw-alias-state-error-primary, #d92d20)";
|
|
272
|
+
case "warning":
|
|
273
|
+
// DSH token is `state-warn-*` (not `state-warning-*`).
|
|
274
|
+
return "var(--dsw-alias-state-warn-primary, #e06c00)";
|
|
275
|
+
case "info":
|
|
276
|
+
// Accent/text color (not a solid fill + white text pair).
|
|
277
|
+
return "var(--dsw-alias-brand-primary, #1677ff)";
|
|
278
|
+
default:
|
|
279
|
+
// Prefer tertiary over dimmed: dimmed is near-invisible on light cards
|
|
280
|
+
// and too dark on dark cards.
|
|
281
|
+
return "var(--dsw-alias-label-tertiary, #81858c)";
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
export function badgeStyle(tone: StatusTone): CSSProperties {
|
|
286
|
+
const color = statusToneColor(tone);
|
|
287
|
+
return {
|
|
288
|
+
display: "inline-flex",
|
|
289
|
+
alignItems: "center",
|
|
290
|
+
gap: 6,
|
|
291
|
+
padding: "3px 10px",
|
|
292
|
+
borderRadius: 999,
|
|
293
|
+
fontSize: 12,
|
|
294
|
+
fontWeight: 600,
|
|
295
|
+
lineHeight: "18px",
|
|
296
|
+
color,
|
|
297
|
+
background: `color-mix(in srgb, ${color} 14%, transparent)`,
|
|
298
|
+
border: `1px solid color-mix(in srgb, ${color} 28%, transparent)`,
|
|
299
|
+
whiteSpace: "nowrap",
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
export function dotStyle(
|
|
304
|
+
status: ProviderStatus["status"] | "loading" | "available" | "unavailable",
|
|
305
|
+
installed = true,
|
|
306
|
+
): CSSProperties {
|
|
307
|
+
const color = !installed
|
|
308
|
+
? "var(--dsw-alias-label-tertiary, #81858c)"
|
|
309
|
+
: status === "signed-in" || status === "available"
|
|
310
|
+
? "var(--dsw-alias-state-success-primary, #22a06b)"
|
|
311
|
+
: status === "error"
|
|
312
|
+
? "var(--dsw-alias-state-error-primary, #d92d20)"
|
|
313
|
+
: status === "signing-in" || status === "loading"
|
|
314
|
+
? "var(--dsw-alias-brand-primary, #1677ff)"
|
|
315
|
+
: "var(--dsw-alias-label-tertiary, #81858c)";
|
|
316
|
+
return { width: 9, height: 9, borderRadius: "50%", flex: "0 0 auto", background: color };
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
export function providerStatusTone(status: ProviderStatus["status"], installed = true): StatusTone {
|
|
320
|
+
if (!installed) return "neutral";
|
|
321
|
+
if (status === "signed-in") return "success";
|
|
322
|
+
if (status === "error") return "error";
|
|
323
|
+
if (status === "signing-in") return "info";
|
|
324
|
+
return "neutral";
|
|
325
|
+
}
|