@dsh-workbench/shared 1.5.2-alpha.4 → 1.5.2-alpha.5
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/dist/components/Activity.css +69 -0
- package/dist/components/Activity.d.ts +56 -0
- package/dist/components/Activity.js +47 -0
- package/dist/components/ApprovalDetail.css +3 -0
- package/dist/components/ApprovalDetail.d.ts +42 -0
- package/dist/components/ApprovalDetail.js +53 -0
- package/dist/components/ApprovalPlan.css +39 -0
- package/dist/components/ApprovalPlan.d.ts +27 -0
- package/dist/components/ApprovalPlan.js +19 -0
- package/dist/components/Card.css +19 -0
- package/dist/components/Card.d.ts +26 -0
- package/dist/components/Card.js +18 -0
- package/dist/components/CardAnchor.d.ts +21 -0
- package/dist/components/CardAnchor.js +19 -0
- package/dist/components/CardAnchor.module.css +3 -0
- package/dist/components/CardBoundary.d.ts +42 -0
- package/dist/components/CardBoundary.js +58 -0
- package/dist/components/CardBoundary.module.css +5 -0
- package/dist/components/CardHead.css +87 -0
- package/dist/components/CardHead.d.ts +30 -0
- package/dist/components/CardHead.js +27 -0
- package/dist/components/ChoiceGroup.css +182 -0
- package/dist/components/ChoiceGroup.d.ts +54 -0
- package/dist/components/ChoiceGroup.js +63 -0
- package/dist/components/ConfirmBar.css +26 -0
- package/dist/components/ConfirmBar.d.ts +36 -0
- package/dist/components/ConfirmBar.js +26 -0
- package/dist/components/EmptyIllustration.d.ts +12 -0
- package/dist/components/EmptyIllustration.js +32 -0
- package/dist/components/Field.css +20 -0
- package/dist/components/Field.d.ts +18 -0
- package/dist/components/Field.js +15 -0
- package/dist/components/Form.css +6 -0
- package/dist/components/Form.d.ts +22 -0
- package/dist/components/Form.js +60 -0
- package/dist/components/FormActions.css +13 -0
- package/dist/components/FormActions.d.ts +29 -0
- package/dist/components/FormActions.js +43 -0
- package/dist/components/FormNodes.d.ts +107 -0
- package/dist/components/FormNodes.js +165 -0
- package/dist/components/FormRows.css +107 -0
- package/dist/components/FormRows.d.ts +36 -0
- package/dist/components/FormRows.js +26 -0
- package/dist/components/FormTypes.d.ts +84 -0
- package/dist/components/FormTypes.js +1 -0
- package/dist/components/Link.css +22 -0
- package/dist/components/Link.d.ts +22 -0
- package/dist/components/Link.js +17 -0
- package/dist/components/LongTaskRow.css +171 -0
- package/dist/components/LongTaskRow.d.ts +94 -0
- package/dist/components/LongTaskRow.js +103 -0
- package/dist/components/Note.css +13 -0
- package/dist/components/Note.d.ts +20 -0
- package/dist/components/Note.js +14 -0
- package/dist/components/ResourceStates.css +114 -0
- package/dist/components/ResourceStates.d.ts +44 -0
- package/dist/components/ResourceStates.js +41 -0
- package/dist/components/Rows.css +42 -0
- package/dist/components/Rows.d.ts +28 -0
- package/dist/components/Rows.js +21 -0
- package/dist/components/SaveBar.d.ts +24 -0
- package/dist/components/SaveBar.js +25 -0
- package/dist/components/SelectField.css +182 -0
- package/dist/components/SelectField.d.ts +89 -0
- package/dist/components/SelectField.js +260 -0
- package/dist/components/SelectFieldNodes.d.ts +49 -0
- package/dist/components/SelectFieldNodes.js +43 -0
- package/dist/components/SettingsSection.css +25 -0
- package/dist/components/SettingsSection.d.ts +20 -0
- package/dist/components/SettingsSection.js +17 -0
- package/dist/components/SetupShell.d.ts +93 -0
- package/dist/components/SetupShell.js +64 -0
- package/dist/components/SetupShell.module.css +81 -0
- package/dist/components/Spinner.css +5 -0
- package/dist/components/Spinner.d.ts +15 -0
- package/dist/components/Spinner.js +13 -0
- package/dist/components/Stack.css +6 -0
- package/dist/components/Stack.d.ts +14 -0
- package/dist/components/Stack.js +10 -0
- package/dist/components/StateBlock.css +38 -0
- package/dist/components/StateBlock.d.ts +24 -0
- package/dist/components/StateBlock.js +22 -0
- package/dist/components/TextField.css +32 -0
- package/dist/components/TextField.d.ts +14 -0
- package/dist/components/TextField.js +10 -0
- package/dist/components/board-module.d.ts +307 -0
- package/dist/components/board-module.js +1 -0
- package/dist/components/card-view-validate.d.ts +5 -0
- package/dist/components/card-view-validate.js +256 -0
- package/dist/components/icons.d.ts +63 -0
- package/dist/components/icons.js +107 -0
- package/dist/components/layout/icon-command.d.ts +8 -0
- package/dist/components/layout/icon-command.js +21 -0
- package/dist/contract/capture.d.ts +16 -0
- package/dist/contract/capture.js +1 -0
- package/dist/contract/diagnostics.d.ts +34 -0
- package/dist/contract/diagnostics.js +124 -0
- package/dist/contract/protocol/unit-manager.d.ts +50 -0
- package/dist/contract/protocol/unit-manager.js +2 -0
- package/dist/host/adapter-contract.d.ts +3 -0
- package/dist/host/adapter-contract.js +95 -0
- package/dist/host/adapter-set.d.ts +27 -0
- package/dist/host/adapter-set.js +258 -0
- package/dist/host/adapter-types.d.ts +87 -0
- package/dist/host/adapter-types.js +23 -0
- package/dist/host/adapters/platform.d.ts +14 -0
- package/dist/host/adapters/platform.js +40 -0
- package/dist/host/adapters.d.ts +28 -0
- package/dist/host/adapters.js +9 -0
- package/dist/host/auth-loss.d.ts +33 -0
- package/dist/host/auth-loss.js +107 -0
- package/dist/host/board-fact.d.ts +8 -0
- package/dist/host/board-fact.js +16 -0
- package/dist/host/boot-record.d.ts +11 -0
- package/dist/host/boot-record.js +31 -0
- package/dist/host/browser.d.ts +3 -0
- package/dist/host/browser.js +3 -0
- package/dist/host/bundle-manager.d.ts +4 -0
- package/dist/host/bundle-manager.js +338 -0
- package/dist/host/changelog.d.ts +28 -0
- package/dist/host/changelog.js +201 -0
- package/dist/host/cli-error.d.ts +8 -0
- package/dist/host/cli-error.js +70 -0
- package/dist/host/cli.d.ts +4 -0
- package/dist/host/cli.js +9 -0
- package/dist/host/config-sync.d.ts +40 -0
- package/dist/host/config-sync.js +267 -0
- package/dist/host/context-ref.d.ts +13 -0
- package/dist/host/context-ref.js +41 -0
- package/dist/host/data-error.d.ts +15 -0
- package/dist/host/data-error.js +23 -0
- package/dist/host/data-plan-check.d.ts +10 -0
- package/dist/host/data-plan-check.js +315 -0
- package/dist/host/data-plan.d.ts +15 -0
- package/dist/host/data-plan.js +283 -0
- package/dist/host/data-root.d.ts +5 -0
- package/dist/host/data-root.js +23 -0
- package/dist/host/diy-debug.d.ts +80 -0
- package/dist/host/diy-debug.js +89 -0
- package/dist/host/diy-preset.d.ts +26 -0
- package/dist/host/diy-preset.js +115 -0
- package/dist/host/diy-record.d.ts +135 -0
- package/dist/host/diy-record.js +163 -0
- package/dist/host/dsh-compat.d.ts +27 -0
- package/dist/host/dsh-compat.js +75 -0
- package/dist/host/dsh-plugins.d.ts +5 -0
- package/dist/host/dsh-plugins.js +51 -0
- package/dist/host/env-policy.d.ts +82 -0
- package/dist/host/env-policy.js +181 -0
- package/dist/host/extension.d.ts +7 -0
- package/dist/host/extension.js +40 -0
- package/dist/host/facts.d.ts +31 -0
- package/dist/host/facts.js +58 -0
- package/dist/host/fs-write.d.ts +96 -0
- package/dist/host/fs-write.js +183 -0
- package/dist/host/git.d.ts +5 -0
- package/dist/host/git.js +1 -0
- package/dist/host/host-actions.d.ts +2 -0
- package/dist/host/host-actions.js +5 -0
- package/dist/host/host-kit.d.ts +37 -0
- package/dist/host/host-kit.js +27 -0
- package/dist/host/http.d.ts +47 -0
- package/dist/host/http.js +289 -0
- package/dist/host/install-failure.d.ts +50 -0
- package/dist/host/install-failure.js +184 -0
- package/dist/host/installed-module.d.ts +25 -0
- package/dist/host/installed-module.js +289 -0
- package/dist/host/installed-sources.d.ts +10 -0
- package/dist/host/installed-sources.js +63 -0
- package/dist/host/lease.d.ts +70 -0
- package/dist/host/lease.js +264 -0
- package/dist/host/lib-capabilities.d.ts +22 -0
- package/dist/host/lib-capabilities.js +37 -0
- package/dist/host/lib-install.d.ts +19 -0
- package/dist/host/lib-install.js +40 -0
- package/dist/host/lib-runners.d.ts +18 -0
- package/dist/host/lib-runners.js +46 -0
- package/dist/host/local-declaration.d.ts +7 -0
- package/dist/host/local-declaration.js +33 -0
- package/dist/host/long-task.d.ts +97 -0
- package/dist/host/long-task.js +297 -0
- package/dist/host/market-index-claim.d.ts +19 -0
- package/dist/host/market-index-claim.js +87 -0
- package/dist/host/market-index-doc.d.ts +12 -0
- package/dist/host/market-index-doc.js +1 -0
- package/dist/host/market-index-parse.d.ts +28 -0
- package/dist/host/market-index-parse.js +413 -0
- package/dist/host/market-index.d.ts +13 -0
- package/dist/host/market-index.js +105 -0
- package/dist/host/module-root.d.ts +1 -0
- package/dist/host/module-root.js +5 -0
- package/dist/host/needs.d.ts +4 -0
- package/dist/host/needs.js +2 -0
- package/dist/host/npm-registry.d.ts +10 -0
- package/dist/host/npm-registry.js +16 -0
- package/dist/host/package-content.d.ts +8 -0
- package/dist/host/package-content.js +90 -0
- package/dist/host/package-kind.d.ts +13 -0
- package/dist/host/package-kind.js +51 -0
- package/dist/host/package-route.d.ts +33 -0
- package/dist/host/package-route.js +68 -0
- package/dist/host/panel-state.d.ts +120 -0
- package/dist/host/panel-state.js +177 -0
- package/dist/host/patch-blocks.d.ts +13 -0
- package/dist/host/patch-blocks.js +52 -0
- package/dist/host/patch.d.ts +4 -0
- package/dist/host/patch.js +7 -0
- package/dist/host/paths.d.ts +12 -0
- package/dist/host/paths.js +20 -0
- package/dist/host/payload.d.ts +12 -0
- package/dist/host/payload.js +16 -0
- package/dist/host/plan-results.d.ts +5 -0
- package/dist/host/plan-results.js +71 -0
- package/dist/host/plan-run.d.ts +41 -0
- package/dist/host/plan-run.js +87 -0
- package/dist/host/platform.d.ts +14 -0
- package/dist/host/platform.js +40 -0
- package/dist/host/plugin-ledger.d.ts +32 -0
- package/dist/host/plugin-ledger.js +106 -0
- package/dist/host/plugin.d.ts +3 -0
- package/dist/host/plugin.js +38 -0
- package/dist/host/port-types.d.ts +233 -0
- package/dist/host/port-types.js +1 -0
- package/dist/host/preflight.d.ts +32 -0
- package/dist/host/preflight.js +1 -0
- package/dist/host/process-alive.d.ts +6 -0
- package/dist/host/process-alive.js +16 -0
- package/dist/host/profile-bundles.d.ts +20 -0
- package/dist/host/profile-bundles.js +48 -0
- package/dist/host/profile-create.d.ts +19 -0
- package/dist/host/profile-create.js +124 -0
- package/dist/host/profile-port.d.ts +4 -0
- package/dist/host/profile-port.js +4 -0
- package/dist/host/profile-registries.d.ts +10 -0
- package/dist/host/profile-registries.js +149 -0
- package/dist/host/provision.d.ts +32 -0
- package/dist/host/provision.js +105 -0
- package/dist/host/read-json.d.ts +1 -0
- package/dist/host/read-json.js +11 -0
- package/dist/host/recipe-rules.d.ts +5 -0
- package/dist/host/recipe-rules.js +412 -0
- package/dist/host/recipe.d.ts +14 -0
- package/dist/host/recipe.js +332 -0
- package/dist/host/registry-declaration.d.ts +21 -0
- package/dist/host/registry-declaration.js +42 -0
- package/dist/host/reinstall-record.d.ts +16 -0
- package/dist/host/reinstall-record.js +54 -0
- package/dist/host/release-age.d.ts +24 -0
- package/dist/host/release-age.js +92 -0
- package/dist/host/release-packages.generated.d.ts +1 -0
- package/dist/host/release-packages.generated.js +10 -0
- package/dist/host/release-probe.d.ts +37 -0
- package/dist/host/release-probe.js +156 -0
- package/dist/host/runtime/browser-argv.d.ts +1 -0
- package/dist/host/runtime/browser-argv.js +9 -0
- package/dist/host/runtime/front-app.d.ts +6 -0
- package/dist/host/runtime/front-app.js +70 -0
- package/dist/host/shell-render.d.ts +52 -0
- package/dist/host/shell-render.js +117 -0
- package/dist/host/shell-text.d.ts +30 -0
- package/dist/host/shell-text.js +40 -0
- package/dist/host/shell.d.ts +25 -0
- package/dist/host/shell.js +55 -0
- package/dist/host/site.d.ts +45 -0
- package/dist/host/site.js +182 -0
- package/dist/host/spec.d.ts +8 -0
- package/dist/host/spec.js +24 -0
- package/dist/host/submit-confirm.d.ts +19 -0
- package/dist/host/submit-confirm.js +45 -0
- package/dist/host/supply-index.d.ts +38 -0
- package/dist/host/supply-index.js +209 -0
- package/dist/host/supply-port.d.ts +5 -0
- package/dist/host/supply-port.js +50 -0
- package/dist/host/time.d.ts +22 -0
- package/dist/host/time.js +33 -0
- package/dist/host/tokens.d.ts +26 -0
- package/dist/host/tokens.js +154 -0
- package/dist/host/tool-approval.d.ts +86 -0
- package/dist/host/tool-approval.js +118 -0
- package/dist/host/tool-kit.d.ts +8 -0
- package/dist/host/tool-kit.js +22 -0
- package/dist/host/toolbox-port.d.ts +16 -0
- package/dist/host/toolbox-port.js +1 -0
- package/dist/host/unit-config.d.ts +34 -0
- package/dist/host/unit-config.js +28 -0
- package/dist/host/unit-data.d.ts +3 -0
- package/dist/host/unit-data.js +127 -0
- package/dist/host/unit-face.d.ts +95 -0
- package/dist/host/unit-face.js +1 -0
- package/dist/host/unit-plugin.d.ts +24 -0
- package/dist/host/unit-plugin.js +25 -0
- package/dist/host/update-journal-manifest.d.ts +19 -0
- package/dist/host/update-journal-manifest.js +134 -0
- package/dist/host/update-journal-types.d.ts +33 -0
- package/dist/host/update-journal-types.js +2 -0
- package/dist/host/update-journal.d.ts +43 -0
- package/dist/host/update-journal.js +409 -0
- package/dist/host/value-handoff.d.ts +16 -0
- package/dist/host/value-handoff.js +22 -0
- package/dist/host/version-range.d.ts +2 -0
- package/dist/host/version-range.js +13 -0
- package/dist/host/version.d.ts +4 -0
- package/dist/host/version.js +32 -0
- package/dist/host/workspace-store.d.ts +19 -0
- package/dist/host/workspace-store.js +133 -0
- package/dist/host/write-result.d.ts +1 -0
- package/dist/host/write-result.js +18 -0
- package/dist/lib/dsh-client.d.ts +1 -1
- package/package.json +51 -47
- package/src/lib/dsh-client.ts +2 -1
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
.wb-cardHead {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
gap: var(--wb-len-6);
|
|
5
|
+
flex: none;
|
|
6
|
+
padding: var(--wb-len-8) var(--wb-len-10) var(--wb-len-8) var(--wb-card-gutter);
|
|
7
|
+
border-bottom: 0.5px solid var(--dsw-alias-border-l2);
|
|
8
|
+
background: var(--dsw-alias-bg-layer-2);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.wb-cardTitle {
|
|
12
|
+
margin: 0;
|
|
13
|
+
font-size: var(--dsw-font-xxs-12-font-size);
|
|
14
|
+
line-height: var(--wb-line-18);
|
|
15
|
+
font-weight: 600;
|
|
16
|
+
color: var(--dsw-alias-label-secondary);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.wb-cardMeta {
|
|
20
|
+
font-size: var(--dsw-font-xxxs-11-font-size);
|
|
21
|
+
line-height: var(--wb-line-16);
|
|
22
|
+
color: var(--dsw-alias-label-tertiary);
|
|
23
|
+
min-width: 0;
|
|
24
|
+
overflow: hidden;
|
|
25
|
+
text-overflow: ellipsis;
|
|
26
|
+
white-space: nowrap;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.wb-cardMeta::before {
|
|
30
|
+
content: '\00b7';
|
|
31
|
+
margin-right: var(--wb-len-6);
|
|
32
|
+
color: var(--dsw-alias-label-tertiary);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.wb-cardOpen {
|
|
36
|
+
display: inline-flex;
|
|
37
|
+
align-items: center;
|
|
38
|
+
justify-content: center;
|
|
39
|
+
box-sizing: border-box;
|
|
40
|
+
margin-left: auto;
|
|
41
|
+
flex: none;
|
|
42
|
+
width: var(--wb-len-22);
|
|
43
|
+
height: var(--wb-len-22);
|
|
44
|
+
padding: var(--wb-len-4);
|
|
45
|
+
border-radius: var(--wb-radius-6);
|
|
46
|
+
color: var(--dsw-alias-label-tertiary);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.wb-cardOpen ~ .wb-cardRefresh {
|
|
50
|
+
margin-left: 0;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.wb-cardOpen:hover {
|
|
54
|
+
color: var(--dsw-alias-label-primary);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.wb-cardRefresh {
|
|
58
|
+
margin-left: auto;
|
|
59
|
+
flex: none;
|
|
60
|
+
width: var(--wb-len-22);
|
|
61
|
+
height: var(--wb-len-22);
|
|
62
|
+
padding: var(--wb-len-4);
|
|
63
|
+
border-radius: var(--wb-radius-6);
|
|
64
|
+
color: var(--dsw-alias-label-tertiary);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.wb-cardRefresh:hover:not(:disabled) {
|
|
68
|
+
color: var(--dsw-alias-label-primary);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.wb-cardRefresh:disabled {
|
|
72
|
+
cursor: default;
|
|
73
|
+
opacity: 1;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.wb-cardGear {
|
|
77
|
+
flex: none;
|
|
78
|
+
width: var(--wb-len-22);
|
|
79
|
+
height: var(--wb-len-22);
|
|
80
|
+
padding: var(--wb-len-3);
|
|
81
|
+
border-radius: var(--wb-radius-6);
|
|
82
|
+
color: var(--dsw-alias-label-tertiary);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.wb-cardGear:hover:not(:disabled) {
|
|
86
|
+
color: var(--dsw-alias-label-primary);
|
|
87
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { ReactNode } from '../lib/react.js';
|
|
2
|
+
import type { Translate } from '../lib/dsh-client.js';
|
|
3
|
+
import './CardHead.css';
|
|
4
|
+
/**
|
|
5
|
+
* `CardHead` 的契约:标题、补充、刷新,外加齿轮与平台跳转两格。
|
|
6
|
+
*/
|
|
7
|
+
export interface CardHeadProps {
|
|
8
|
+
readonly t: Translate;
|
|
9
|
+
readonly title: string;
|
|
10
|
+
readonly meta?: ReactNode | undefined;
|
|
11
|
+
readonly refreshing: boolean;
|
|
12
|
+
readonly onRefresh: () => void;
|
|
13
|
+
readonly gear?: string | undefined;
|
|
14
|
+
readonly gearOpen?: boolean | undefined;
|
|
15
|
+
readonly onToggleGear?: (() => void) | undefined;
|
|
16
|
+
readonly platformHref?: string | undefined;
|
|
17
|
+
readonly platform?: string | undefined;
|
|
18
|
+
readonly platformTitle?: string | undefined;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* 卡头:标题 + 补充 + 刷新钮(`Card` 内部就是它),要自己拼卡头或加齿轮 / 平台跳转时直接用。
|
|
22
|
+
* @param props.t - 刷新那两句文案(刷新 / 刷新中)的翻译函数。
|
|
23
|
+
* @param props.title - 卡标题;`props.meta` 是它右侧那一小段补充,不给不占位。
|
|
24
|
+
* @param props.refreshing - 正在刷新:刷新钮禁用并转圈。
|
|
25
|
+
* @param props.onRefresh - 点刷新钮做什么。
|
|
26
|
+
* @param props.gear - 齿轮钮的读屏名;`gearOpen` 控制它高亮、`onToggleGear` 是点击回调,三者一起给才画。
|
|
27
|
+
* @param props.platformHref - 整张卡对应系统的地址:给了就画那颗 ↗(新窗口),tooltip 用 `platformTitle`,缺了退化用 `platform`。
|
|
28
|
+
* @returns 一个 `<header>`。
|
|
29
|
+
*/
|
|
30
|
+
export declare function CardHead({ t, title, meta, refreshing, onRefresh, gear, gearOpen, onToggleGear, platformHref, platform, platformTitle, }: CardHeadProps): JSX.Element;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Button, IconRefreshOutlineRegular, IconRightUpOutlineRegular, IconSettingsOutlineRegular, Tooltip, } from '@deepseek-ai/dsh-client-ui-primitives';
|
|
2
|
+
import { h } from '../lib/react.js';
|
|
3
|
+
import './CardHead.css';
|
|
4
|
+
/**
|
|
5
|
+
* 卡头:标题 + 补充 + 刷新钮(`Card` 内部就是它),要自己拼卡头或加齿轮 / 平台跳转时直接用。
|
|
6
|
+
* @param props.t - 刷新那两句文案(刷新 / 刷新中)的翻译函数。
|
|
7
|
+
* @param props.title - 卡标题;`props.meta` 是它右侧那一小段补充,不给不占位。
|
|
8
|
+
* @param props.refreshing - 正在刷新:刷新钮禁用并转圈。
|
|
9
|
+
* @param props.onRefresh - 点刷新钮做什么。
|
|
10
|
+
* @param props.gear - 齿轮钮的读屏名;`gearOpen` 控制它高亮、`onToggleGear` 是点击回调,三者一起给才画。
|
|
11
|
+
* @param props.platformHref - 整张卡对应系统的地址:给了就画那颗 ↗(新窗口),tooltip 用 `platformTitle`,缺了退化用 `platform`。
|
|
12
|
+
* @returns 一个 `<header>`。
|
|
13
|
+
*/
|
|
14
|
+
export function CardHead({ t, title, meta, refreshing, onRefresh, gear, gearOpen, onToggleGear, platformHref, platform, platformTitle, }) {
|
|
15
|
+
const refreshLabel = refreshing ? t('rightbar.refreshing') : t('rightbar.refresh');
|
|
16
|
+
const platformLabel = platformTitle ?? platform ?? t('rightbar.openPlatform');
|
|
17
|
+
return (h("header", { className: "wb-cardHead" },
|
|
18
|
+
h("h2", { className: "wb-cardTitle" }, title),
|
|
19
|
+
meta === undefined ? null : h("span", { className: "wb-cardMeta" }, meta),
|
|
20
|
+
platformHref === undefined ? null : (h(Tooltip, { side: "bottom", align: "end", gap: 6, portal: true, label: platformLabel },
|
|
21
|
+
h("a", { className: "wb-iconButton wb-cardOpen", href: platformHref, target: "_blank", rel: "noreferrer noopener", "aria-label": platform ?? platformLabel },
|
|
22
|
+
h(IconRightUpOutlineRegular, { size: 14 })))),
|
|
23
|
+
h(Tooltip, { side: "bottom", align: "end", gap: 6, portal: true, label: refreshLabel },
|
|
24
|
+
h(Button, { type: "button", size: "sm", variant: "ghost", className: `wb-cardRefresh${refreshing ? ' wb-spinning' : ''}`, "aria-label": refreshLabel, disabled: refreshing, icon: h(IconRefreshOutlineRegular, { size: 14 }), onClick: onRefresh })),
|
|
25
|
+
gear === undefined || onToggleGear === undefined ? null : (h(Tooltip, { side: "bottom", align: "end", gap: 6, portal: true, label: gear },
|
|
26
|
+
h(Button, { type: "button", size: "sm", variant: "ghost", className: `wb-cardGear${gearOpen === true ? ' wb-iconButtonActive' : ''}`, "aria-label": gear, "aria-expanded": gearOpen === true, icon: h(IconSettingsOutlineRegular, { size: 15 }), onClick: onToggleGear })))));
|
|
27
|
+
}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
.wb-choiceMenu {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
gap: var(--wb-len-2);
|
|
5
|
+
background: transparent;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.wb-choiceMenu[data-variant='boxed'] {
|
|
9
|
+
padding: var(--wb-len-4);
|
|
10
|
+
border: 0.5px solid var(--dsw-alias-border-l3);
|
|
11
|
+
border-radius: var(--dsw-radius-md);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.wb-choiceOption {
|
|
15
|
+
position: relative;
|
|
16
|
+
display: flex;
|
|
17
|
+
align-items: center;
|
|
18
|
+
gap: var(--wb-len-6);
|
|
19
|
+
min-height: var(--wb-len-28);
|
|
20
|
+
padding: var(--wb-len-4) var(--wb-len-8);
|
|
21
|
+
border-radius: var(--dsw-radius-md);
|
|
22
|
+
cursor: pointer;
|
|
23
|
+
font-size: var(--dsw-font-xs-13-font-size);
|
|
24
|
+
line-height: var(--wb-line-20);
|
|
25
|
+
color: var(--dsw-alias-label-primary);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.wb-choiceOptionOn {
|
|
29
|
+
background: var(--dsw-alias-interactive-bg-hover);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.wb-checkbox {
|
|
33
|
+
position: absolute;
|
|
34
|
+
width: var(--wb-len-16);
|
|
35
|
+
height: var(--wb-len-16);
|
|
36
|
+
margin: 0;
|
|
37
|
+
opacity: 0;
|
|
38
|
+
pointer-events: none;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.wb-checkboxBox {
|
|
42
|
+
display: inline-flex;
|
|
43
|
+
align-items: center;
|
|
44
|
+
justify-content: center;
|
|
45
|
+
box-sizing: border-box;
|
|
46
|
+
flex: none;
|
|
47
|
+
width: var(--wb-len-16);
|
|
48
|
+
height: var(--wb-len-16);
|
|
49
|
+
border: 1px solid var(--dsw-alias-border-l3);
|
|
50
|
+
border-radius: var(--dsw-radius-xs);
|
|
51
|
+
corner-shape: round;
|
|
52
|
+
color: var(--dsw-alias-label-primary-foreground);
|
|
53
|
+
transition:
|
|
54
|
+
background-color var(--wb-dur-0-12) ease, border-color var(--wb-dur-0-12) ease;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.wb-choiceOption:hover .wb-checkboxBox {
|
|
58
|
+
border-color: var(--dsw-alias-label-tertiary);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.wb-checkbox:checked + .wb-checkboxBox {
|
|
62
|
+
border-color: var(--dsw-alias-brand-primary);
|
|
63
|
+
background: var(--dsw-alias-brand-primary);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.wb-checkbox:disabled + .wb-checkboxBox {
|
|
67
|
+
cursor: default;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.wb-checkbox:focus-visible + .wb-checkboxBox {
|
|
71
|
+
outline: var(--dsw-focus-ring-width, var(--wb-len-2)) solid
|
|
72
|
+
var(--dsw-focus-ring-color, var(--dsw-alias-state-business-primary));
|
|
73
|
+
outline-offset: 2px;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.wb-choiceOption:hover {
|
|
77
|
+
background: var(--dsw-alias-interactive-bg-hover);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.wb-choiceOption:has(:disabled) {
|
|
81
|
+
cursor: default;
|
|
82
|
+
opacity: 0.5;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.wb-choiceOption:has(:disabled),
|
|
86
|
+
.wb-choiceOption:has(:disabled):hover {
|
|
87
|
+
background: transparent;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.wb-choiceLabel {
|
|
91
|
+
flex: 1;
|
|
92
|
+
min-width: 0;
|
|
93
|
+
display: flex;
|
|
94
|
+
flex-direction: column;
|
|
95
|
+
overflow: hidden;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.wb-choiceLabelText {
|
|
99
|
+
overflow: hidden;
|
|
100
|
+
text-overflow: ellipsis;
|
|
101
|
+
white-space: nowrap;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.wb-choiceLabel:has(.wb-choiceDescription) .wb-choiceLabelText {
|
|
105
|
+
overflow: visible;
|
|
106
|
+
white-space: normal;
|
|
107
|
+
overflow-wrap: anywhere;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.wb-choiceDescription {
|
|
111
|
+
font-size: var(--dsw-font-xxs-12-font-size);
|
|
112
|
+
line-height: var(--wb-line-18);
|
|
113
|
+
color: var(--dsw-alias-label-tertiary);
|
|
114
|
+
overflow-wrap: anywhere;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.wb-choiceLoading {
|
|
118
|
+
display: flex;
|
|
119
|
+
align-items: center;
|
|
120
|
+
gap: var(--wb-len-6);
|
|
121
|
+
min-height: var(--wb-len-28);
|
|
122
|
+
padding: var(--wb-len-4) var(--wb-len-8);
|
|
123
|
+
font-size: var(--dsw-font-xs-13-font-size);
|
|
124
|
+
line-height: var(--wb-line-20);
|
|
125
|
+
color: var(--dsw-alias-label-secondary);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.wb-choiceLoadingText {
|
|
129
|
+
min-width: 0;
|
|
130
|
+
overflow: hidden;
|
|
131
|
+
text-overflow: ellipsis;
|
|
132
|
+
white-space: nowrap;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.wb-choiceEmpty {
|
|
136
|
+
display: flex;
|
|
137
|
+
align-items: center;
|
|
138
|
+
min-height: var(--wb-len-28);
|
|
139
|
+
padding: var(--wb-len-4) var(--wb-len-8);
|
|
140
|
+
font-size: var(--dsw-font-xs-13-font-size);
|
|
141
|
+
line-height: var(--wb-line-20);
|
|
142
|
+
color: var(--dsw-alias-label-tertiary);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.wb-radio {
|
|
146
|
+
appearance: none;
|
|
147
|
+
-webkit-appearance: none;
|
|
148
|
+
flex: none;
|
|
149
|
+
box-sizing: border-box;
|
|
150
|
+
width: var(--wb-len-12);
|
|
151
|
+
height: var(--wb-len-12);
|
|
152
|
+
margin: 0;
|
|
153
|
+
border: 1px solid var(--dsw-alias-border-l3);
|
|
154
|
+
border-radius: 50%;
|
|
155
|
+
corner-shape: round;
|
|
156
|
+
background-color: transparent;
|
|
157
|
+
cursor: pointer;
|
|
158
|
+
transition:
|
|
159
|
+
background-color var(--wb-dur-0-12) ease, border-color var(--wb-dur-0-12) ease;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.wb-radio:not(:checked):hover {
|
|
163
|
+
border-color: var(--dsw-alias-label-tertiary);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.wb-radio:checked {
|
|
167
|
+
border-color: var(--dsw-alias-brand-primary);
|
|
168
|
+
background-image: radial-gradient(
|
|
169
|
+
circle at center,
|
|
170
|
+
var(--dsw-alias-brand-primary) 0 3px,
|
|
171
|
+
transparent 3px
|
|
172
|
+
);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.wb-radio:disabled {
|
|
176
|
+
cursor: default;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.wb-radio:focus-visible {
|
|
180
|
+
outline: var(--dsw-focus-ring-width, var(--wb-len-2)) solid var(--dsw-focus-ring-color, var(--dsw-alias-state-business-primary));
|
|
181
|
+
outline-offset: 2px;
|
|
182
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { ReactNode } from '../lib/react.js';
|
|
2
|
+
import './ChoiceGroup.css';
|
|
3
|
+
/**
|
|
4
|
+
* 一个候选项:值、人看的标签,可带一行说明。
|
|
5
|
+
*/
|
|
6
|
+
export interface ChoiceGroupOption {
|
|
7
|
+
readonly value: string;
|
|
8
|
+
readonly label: ReactNode;
|
|
9
|
+
readonly description?: ReactNode | undefined;
|
|
10
|
+
}
|
|
11
|
+
interface ChoiceGroupCommon {
|
|
12
|
+
readonly label: string;
|
|
13
|
+
readonly name: string;
|
|
14
|
+
readonly options: readonly ChoiceGroupOption[];
|
|
15
|
+
readonly disabled?: boolean | undefined;
|
|
16
|
+
readonly variant?: 'boxed' | 'ghost' | undefined;
|
|
17
|
+
readonly loading?: boolean | undefined;
|
|
18
|
+
readonly loadingText?: ReactNode | undefined;
|
|
19
|
+
readonly emptyText?: ReactNode | undefined;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* 单选那一支的契约:`value` + `onChange(next)`;`multi` 不给或给 false。
|
|
23
|
+
*/
|
|
24
|
+
export interface ChoiceGroupSingleProps extends ChoiceGroupCommon {
|
|
25
|
+
readonly multi?: false | undefined;
|
|
26
|
+
readonly value: string;
|
|
27
|
+
readonly onChange: (next: string) => void;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* 多选那一支的契约:`multi: true` + `values` + `onChange(next[])`。
|
|
31
|
+
*/
|
|
32
|
+
export interface ChoiceGroupMultiProps extends ChoiceGroupCommon {
|
|
33
|
+
readonly multi: true;
|
|
34
|
+
readonly values: readonly string[];
|
|
35
|
+
readonly onChange: (next: readonly string[]) => void;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* `ChoiceGroup` 的契约:单选与多选两支的联合。
|
|
39
|
+
*/
|
|
40
|
+
export type ChoiceGroupProps = ChoiceGroupSingleProps | ChoiceGroupMultiProps;
|
|
41
|
+
/**
|
|
42
|
+
* 一组单选或多选:候选少、要一眼看全时用它;候选多或要搜索就用 `SelectField`。
|
|
43
|
+
* @param props.multi - true 走多选那支(`values` / `onChange(string[])`);默认单选(`value` / `onChange(string)`)。
|
|
44
|
+
* @param props.label - 只给读屏的组名(`aria-label`)。
|
|
45
|
+
* @param props.name - 这一组 `input` 的共用 name。
|
|
46
|
+
* @param props.options - 候选项,按给的顺序排;空数组时画 `emptyText`(没给就什么都不画)。
|
|
47
|
+
* @param props.disabled - 禁掉整组(默认 false),不是单颗。
|
|
48
|
+
* @param props.variant - `boxed`(默认,带边框的选项格)或 `ghost`(无边框,跟着父容器走)。
|
|
49
|
+
* @param props.loading - 正在读候选:整组换成转圈,文案取 `loadingText`(不给是 `…`);默认 false。
|
|
50
|
+
* @param props.emptyText - 读到了但一个候选都没有时那句话;不给不画。
|
|
51
|
+
* @returns 一组 `radio` / `checkbox` 选项。
|
|
52
|
+
*/
|
|
53
|
+
export declare function ChoiceGroup(props: ChoiceGroupProps): JSX.Element;
|
|
54
|
+
export {};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { Fragment, h } from '../lib/react.js';
|
|
2
|
+
import { IconCheckOutlineRegular } from '@deepseek-ai/dsh-client-ui-primitives';
|
|
3
|
+
import { Spinner } from './Spinner.js';
|
|
4
|
+
import './ChoiceGroup.css';
|
|
5
|
+
function ChoiceMenu(input) {
|
|
6
|
+
const body = input.loading ? (h("span", { className: "wb-choiceLoading", role: "status" },
|
|
7
|
+
h(Spinner, { size: 14 }),
|
|
8
|
+
h("span", { className: "wb-choiceLoadingText" }, input.loadingText ?? '…'))) : input.options.length === 0 ? (input.emptyText === undefined ? null : (h("span", { className: "wb-choiceEmpty" }, input.emptyText))) : (input.options.map((option) => {
|
|
9
|
+
const row = input.rowOf(option.value);
|
|
10
|
+
return (h(Fragment, { key: option.value },
|
|
11
|
+
h("label", { className: `wb-choiceOption${row.checked ? ' wb-choiceOptionOn' : ''}` },
|
|
12
|
+
h("input", { className: input.multi ? 'wb-checkbox' : 'wb-radio', type: input.multi ? 'checkbox' : 'radio', name: input.name, checked: row.checked, disabled: input.disabled, onChange: row.onSelect }),
|
|
13
|
+
input.multi ? (h("span", { className: "wb-checkboxBox", "aria-hidden": "true" }, row.checked ? h(IconCheckOutlineRegular, { size: 12 }) : null)) : null,
|
|
14
|
+
h("span", { className: "wb-choiceLabel" },
|
|
15
|
+
h("span", { className: "wb-choiceLabelText" }, option.label),
|
|
16
|
+
option.description === undefined ? null : (h("span", { className: "wb-choiceDescription" }, option.description))))));
|
|
17
|
+
}));
|
|
18
|
+
return (h("div", { className: "wb-choiceMenu", "data-variant": input.variant, role: input.multi ? 'group' : 'radiogroup', "aria-label": input.label, "aria-busy": input.loading ? true : undefined }, body));
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* 一组单选或多选:候选少、要一眼看全时用它;候选多或要搜索就用 `SelectField`。
|
|
22
|
+
* @param props.multi - true 走多选那支(`values` / `onChange(string[])`);默认单选(`value` / `onChange(string)`)。
|
|
23
|
+
* @param props.label - 只给读屏的组名(`aria-label`)。
|
|
24
|
+
* @param props.name - 这一组 `input` 的共用 name。
|
|
25
|
+
* @param props.options - 候选项,按给的顺序排;空数组时画 `emptyText`(没给就什么都不画)。
|
|
26
|
+
* @param props.disabled - 禁掉整组(默认 false),不是单颗。
|
|
27
|
+
* @param props.variant - `boxed`(默认,带边框的选项格)或 `ghost`(无边框,跟着父容器走)。
|
|
28
|
+
* @param props.loading - 正在读候选:整组换成转圈,文案取 `loadingText`(不给是 `…`);默认 false。
|
|
29
|
+
* @param props.emptyText - 读到了但一个候选都没有时那句话;不给不画。
|
|
30
|
+
* @returns 一组 `radio` / `checkbox` 选项。
|
|
31
|
+
*/
|
|
32
|
+
export function ChoiceGroup(props) {
|
|
33
|
+
const common = {
|
|
34
|
+
label: props.label,
|
|
35
|
+
name: props.name,
|
|
36
|
+
options: props.options,
|
|
37
|
+
disabled: props.disabled === true,
|
|
38
|
+
variant: props.variant ?? 'boxed',
|
|
39
|
+
loading: props.loading === true,
|
|
40
|
+
loadingText: props.loadingText,
|
|
41
|
+
emptyText: props.emptyText,
|
|
42
|
+
};
|
|
43
|
+
if (props.multi === true) {
|
|
44
|
+
const values = props.values;
|
|
45
|
+
const onChange = props.onChange;
|
|
46
|
+
return (h(ChoiceMenu, { label: common.label, name: common.name, options: common.options, disabled: common.disabled, multi: true, variant: common.variant, loading: common.loading, loadingText: common.loadingText, emptyText: common.emptyText, rowOf: (value) => ({
|
|
47
|
+
checked: values.includes(value),
|
|
48
|
+
onSelect: () => {
|
|
49
|
+
onChange(values.includes(value)
|
|
50
|
+
? values.filter((one) => one !== value)
|
|
51
|
+
: [...values, value]);
|
|
52
|
+
},
|
|
53
|
+
}) }));
|
|
54
|
+
}
|
|
55
|
+
const value = props.value;
|
|
56
|
+
const onChange = props.onChange;
|
|
57
|
+
return (h(ChoiceMenu, { label: common.label, name: common.name, options: common.options, disabled: common.disabled, multi: false, variant: common.variant, loading: common.loading, loadingText: common.loadingText, emptyText: common.emptyText, rowOf: (option) => ({
|
|
58
|
+
checked: option === value,
|
|
59
|
+
onSelect: () => {
|
|
60
|
+
onChange(option);
|
|
61
|
+
},
|
|
62
|
+
}) }));
|
|
63
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
.wb-confirmBar {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
gap: var(--wb-len-8);
|
|
5
|
+
width: 100%;
|
|
6
|
+
box-sizing: border-box;
|
|
7
|
+
padding: var(--wb-len-10) var(--wb-len-12);
|
|
8
|
+
border: 0.5px solid var(--dsw-alias-border-l3);
|
|
9
|
+
border-radius: var(--dsw-radius-md);
|
|
10
|
+
background: var(--dsw-alias-bg-layer-1);
|
|
11
|
+
}
|
|
12
|
+
.wb-confirmBarTitle {
|
|
13
|
+
margin: 0;
|
|
14
|
+
font-size: var(--dsw-font-xxs-12-font-size);
|
|
15
|
+
font-weight: 600;
|
|
16
|
+
line-height: var(--wb-line-18);
|
|
17
|
+
color: var(--dsw-alias-label-primary);
|
|
18
|
+
overflow-wrap: anywhere;
|
|
19
|
+
}
|
|
20
|
+
.wb-confirmBarHint {
|
|
21
|
+
margin: 0;
|
|
22
|
+
font-size: var(--dsw-font-xxxs-11-font-size);
|
|
23
|
+
line-height: var(--wb-line-16);
|
|
24
|
+
color: var(--dsw-alias-label-secondary);
|
|
25
|
+
overflow-wrap: anywhere;
|
|
26
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { ReactNode } from '../lib/react.js';
|
|
2
|
+
import { type FormAction } from './FormActions.js';
|
|
3
|
+
import './ConfirmBar.css';
|
|
4
|
+
/**
|
|
5
|
+
* `ConfirmBar` 的一格键值:`label` 在左、`value` 在右(走 `Rows` 的标签列)。
|
|
6
|
+
*/
|
|
7
|
+
export interface ConfirmRow {
|
|
8
|
+
readonly key: string;
|
|
9
|
+
readonly label: ReactNode;
|
|
10
|
+
readonly value: ReactNode;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* `ConfirmBar` 的契约:标题、说明、键值、失败那句与动作。
|
|
14
|
+
*/
|
|
15
|
+
export interface ConfirmBarProps {
|
|
16
|
+
readonly title: ReactNode;
|
|
17
|
+
readonly hint?: ReactNode | undefined;
|
|
18
|
+
readonly rows?: readonly ConfirmRow[] | undefined;
|
|
19
|
+
readonly actions: readonly FormAction[];
|
|
20
|
+
readonly problem?: ReactNode | undefined;
|
|
21
|
+
readonly busy?: boolean | undefined;
|
|
22
|
+
readonly label?: string | undefined;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* 「先问一句再动手」那一条:标题 + 说明 + 键值 + 失败那句 + 动作区,形状一次收口。
|
|
26
|
+
* **要不要问**归调用点,这一件只回答"问的时候长什么样"。
|
|
27
|
+
* @param props.title - 那一句问话("发布到 prod?")。
|
|
28
|
+
* @param props.hint - 标题下面那句说明或正文;不给不占位。
|
|
29
|
+
* @param props.rows - 键值两格(键值列宽与分隔线归 `Rows` / `Row`);不给或空数组不渲染。值那一格可以放控件。
|
|
30
|
+
* @param props.actions - 动作清单(归 `FormActions`:一个区一颗 `primary`、永远在右、窄了折行)。
|
|
31
|
+
* @param props.problem - 失败那句(走 `Note tone="problem"`,读屏是 `alert`);不给不占位。
|
|
32
|
+
* @param props.busy - 整条在忙(只喂 `aria-busy`;按钮自己的转圈与禁用归 `actions` 里那一颗)。
|
|
33
|
+
* @param props.label - 读屏的组名;不给时 `title` 是字符串就拿它顶上,两者都没有就不设。
|
|
34
|
+
* @returns 一个 `role="group"` 的条;`actions` 空数组时最后那一块不渲染。
|
|
35
|
+
*/
|
|
36
|
+
export declare function ConfirmBar({ title, hint, rows, actions, problem, busy, label }: ConfirmBarProps): JSX.Element;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { h } from '../lib/react.js';
|
|
2
|
+
import { FormActions } from './FormActions.js';
|
|
3
|
+
import { Note } from './Note.js';
|
|
4
|
+
import { Row, Rows } from './Rows.js';
|
|
5
|
+
import './ConfirmBar.css';
|
|
6
|
+
/**
|
|
7
|
+
* 「先问一句再动手」那一条:标题 + 说明 + 键值 + 失败那句 + 动作区,形状一次收口。
|
|
8
|
+
* **要不要问**归调用点,这一件只回答"问的时候长什么样"。
|
|
9
|
+
* @param props.title - 那一句问话("发布到 prod?")。
|
|
10
|
+
* @param props.hint - 标题下面那句说明或正文;不给不占位。
|
|
11
|
+
* @param props.rows - 键值两格(键值列宽与分隔线归 `Rows` / `Row`);不给或空数组不渲染。值那一格可以放控件。
|
|
12
|
+
* @param props.actions - 动作清单(归 `FormActions`:一个区一颗 `primary`、永远在右、窄了折行)。
|
|
13
|
+
* @param props.problem - 失败那句(走 `Note tone="problem"`,读屏是 `alert`);不给不占位。
|
|
14
|
+
* @param props.busy - 整条在忙(只喂 `aria-busy`;按钮自己的转圈与禁用归 `actions` 里那一颗)。
|
|
15
|
+
* @param props.label - 读屏的组名;不给时 `title` 是字符串就拿它顶上,两者都没有就不设。
|
|
16
|
+
* @returns 一个 `role="group"` 的条;`actions` 空数组时最后那一块不渲染。
|
|
17
|
+
*/
|
|
18
|
+
export function ConfirmBar({ title, hint, rows, actions, problem, busy, label }) {
|
|
19
|
+
const name = label ?? (typeof title === 'string' ? title : undefined);
|
|
20
|
+
return (h("div", { className: "wb-confirmBar", role: "group", "aria-label": name, "aria-busy": busy },
|
|
21
|
+
h("p", { className: "wb-confirmBarTitle" }, title),
|
|
22
|
+
hint === undefined ? null : h("p", { className: "wb-confirmBarHint" }, hint),
|
|
23
|
+
rows === undefined || rows.length === 0 ? null : (h(Rows, null, rows.map((row) => (h(Row, { key: row.key, label: row.label, value: row.value }))))),
|
|
24
|
+
problem === undefined ? null : (h(Note, { tone: "problem", role: "alert" }, problem)),
|
|
25
|
+
h(FormActions, { actions: actions })));
|
|
26
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `EmptyIllustration` 的 prop:边长。
|
|
3
|
+
*/
|
|
4
|
+
export interface EmptyIllustrationProps {
|
|
5
|
+
readonly size?: number;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* 空态插画:dsh 那枚 170×170 的空态图(右下角是四宫格,不是时钟)。
|
|
9
|
+
* @param props.size - 边长,默认 110;色值全部走 `--dsw-alias-illustration-*`。
|
|
10
|
+
* @returns 一个 `aria-hidden` 的 SVG。
|
|
11
|
+
*/
|
|
12
|
+
export declare function EmptyIllustration({ size }: EmptyIllustrationProps): JSX.Element;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { h } from '../lib/react.js';
|
|
2
|
+
/**
|
|
3
|
+
* 空态插画:dsh 那枚 170×170 的空态图(右下角是四宫格,不是时钟)。
|
|
4
|
+
* @param props.size - 边长,默认 110;色值全部走 `--dsw-alias-illustration-*`。
|
|
5
|
+
* @returns 一个 `aria-hidden` 的 SVG。
|
|
6
|
+
*/
|
|
7
|
+
export function EmptyIllustration({ size = 110 }) {
|
|
8
|
+
return (h("svg", { width: size, height: size, viewBox: "0 0 170 170", fill: "none", "aria-hidden": "true", focusable: "false" },
|
|
9
|
+
h("path", { d: "M163.819 97.9382C163.819 126.572 144.48 135.329 115.847 135.329C87.2129 135.329 60.1276 126.572 60.1276 97.9382C60.1276 69.3047 101.003 46.0927 129.637 46.0927C158.27 46.0927 163.819 69.3047 163.819 97.9382Z", fill: "var(--dsw-alias-illustration-background)" }),
|
|
10
|
+
h("path", { d: "M9.49521 88.6735C20.8278 111.218 39.5801 110.429 62.2137 99.0519C84.8474 87.6748 102.791 70.018 91.4589 47.4731C80.1263 24.9282 38.6291 22.8935 15.9955 34.2706C-6.63818 45.6478 -1.83735 66.1286 9.49521 88.6735Z", fill: "var(--dsw-alias-illustration-background)" }),
|
|
11
|
+
h("path", { d: "M25.2636 34.442C24.727 29.8132 28.0445 25.6258 32.6733 25.0893L101.373 17.126C106.002 16.5895 110.189 19.9069 110.726 24.5358L120.107 105.466C120.643 110.095 117.326 114.282 112.697 114.818L43.9972 122.782C39.3684 123.318 35.181 120.001 34.6445 115.372L25.2636 34.442Z", fill: "var(--dsw-alias-illustration-backing)" }),
|
|
12
|
+
h("path", { d: "M40.169 25.1368C40.169 20.477 43.9466 16.6995 48.6064 16.6995H117.766C122.426 16.6995 126.204 20.477 126.204 25.1368V106.609C126.204 111.268 122.426 115.046 117.766 115.046H48.6064C43.9466 115.046 40.169 111.268 40.169 106.609V25.1368Z", fill: "var(--dsw-alias-illustration-surface)" }),
|
|
13
|
+
h("path", { d: "M110.258 44.9883V50.3516H72.0831V44.9883H110.258Z", fill: "var(--dsw-alias-illustration-detail)" }),
|
|
14
|
+
h("path", { d: "M110.258 63.2803V68.6436H72.0831V63.2803H110.258Z", fill: "var(--dsw-alias-illustration-detail)" }),
|
|
15
|
+
h("path", { d: "M91.171 81.5713V86.9346H72.0831V81.5713H91.171Z", fill: "var(--dsw-alias-illustration-detail)" }),
|
|
16
|
+
h("path", { d: "M56.1124 43.4998H64.0964V51.4838H56.1124V43.4998Z", fill: "var(--dsw-alias-illustration-detail)" }),
|
|
17
|
+
h("path", { d: "M56.1124 61.97H64.0964V69.954H56.1124V61.97Z", fill: "var(--dsw-alias-illustration-detail)" }),
|
|
18
|
+
h("path", { d: "M56.1124 80.2607H64.0964V88.2448H56.1124V80.2607Z", fill: "var(--dsw-alias-illustration-detail)" }),
|
|
19
|
+
h("path", { d: "M126.205 148.002C126.205 149.615 105.321 150.923 79.5592 150.923C53.7973 150.923 32.9132 149.615 32.9132 148.002C32.9132 146.388 53.7973 145.08 79.5592 145.08C105.321 145.08 126.205 146.388 126.205 148.002Z", fill: "var(--dsw-alias-illustration-shadow)" }),
|
|
20
|
+
h("path", { d: "M13.1544 119.318C14.7101 119.318 16.2657 119.43 17.8214 119.656C17.9942 119.682 18.1671 119.709 18.3399 119.737V120.238C18.1671 120.266 17.9942 120.293 17.8214 120.319C16.2657 120.545 14.7101 120.657 13.1544 120.657C11.5986 120.657 10.0423 120.545 8.48643 120.319C8.31357 120.293 8.14073 120.266 7.96787 120.238V119.737C8.14073 119.709 8.31357 119.682 8.48643 119.656C10.0423 119.43 11.5986 119.318 13.1544 119.318Z", fill: "var(--dsw-alias-illustration-detail)" }),
|
|
21
|
+
h("path", { d: "M125.197 2.96338C126.287 2.96338 127.378 3.076 128.468 3.30225C128.589 3.32738 128.71 3.3544 128.831 3.38232V3.88428C128.71 3.9122 128.589 3.93922 128.468 3.96436C127.378 4.1906 126.287 4.30322 125.197 4.30322C124.108 4.30319 123.018 4.19057 121.928 3.96436C121.807 3.93922 121.686 3.91221 121.565 3.88428V3.38232C121.686 3.3544 121.807 3.32738 121.928 3.30225C123.018 3.07603 124.108 2.96341 125.197 2.96338Z", fill: "var(--dsw-alias-illustration-detail)" }),
|
|
22
|
+
h("path", { d: "M145.187 32.6399C146.742 32.6399 148.298 32.7525 149.854 32.9788C150.026 33.0039 150.199 33.0309 150.372 33.0588V33.5608C150.199 33.5887 150.026 33.6157 149.854 33.6409C148.298 33.8671 146.742 33.9797 145.187 33.9797C143.631 33.9797 142.074 33.8671 140.519 33.6409C140.346 33.6157 140.173 33.5887 140 33.5608V33.0588C140.173 33.0309 140.346 33.0039 140.519 32.9788C142.074 32.7525 143.631 32.6399 145.187 32.6399Z", fill: "var(--dsw-alias-illustration-detail)" }),
|
|
23
|
+
h("path", { d: "M12.4776 119.987C12.4777 118.431 12.5903 116.875 12.8165 115.32C12.8416 115.147 12.8687 114.974 12.8966 114.801H13.3985C13.4265 114.974 13.4535 115.147 13.4786 115.32C13.7048 116.875 13.8175 118.431 13.8175 119.987C13.8175 121.542 13.7049 123.099 13.4786 124.654C13.4535 124.827 13.4265 125 13.3985 125.173H12.8966C12.8687 125 12.8416 124.827 12.8165 124.654C12.5903 123.099 12.4776 121.542 12.4776 119.987Z", fill: "var(--dsw-alias-illustration-detail)" }),
|
|
24
|
+
h("path", { d: "M124.522 3.63379C124.522 2.54381 124.634 1.45326 124.86 0.363281C124.886 0.242199 124.913 0.121083 124.941 2.19411e-08L125.442 0C125.47 0.121082 125.497 0.242199 125.523 0.363281C125.749 1.45326 125.861 2.54381 125.861 3.63379C125.861 4.72362 125.749 5.81349 125.523 6.90332C125.497 7.02442 125.47 7.1455 125.442 7.2666H124.941C124.913 7.1455 124.886 7.02442 124.86 6.90332C124.634 5.81349 124.522 4.72362 124.522 3.63379Z", fill: "var(--dsw-alias-illustration-detail)" }),
|
|
25
|
+
h("path", { d: "M144.509 33.3101C144.509 31.7544 144.622 30.1987 144.848 28.6431C144.873 28.4702 144.9 28.2974 144.928 28.1245H145.43C145.458 28.2974 145.485 28.4702 145.51 28.6431C145.736 30.1987 145.849 31.7544 145.849 33.3101C145.849 34.8659 145.736 36.4222 145.51 37.978C145.485 38.1509 145.458 38.3237 145.43 38.4966H144.928C144.9 38.3237 144.873 38.1509 144.848 37.978C144.622 36.4222 144.509 34.8659 144.509 33.3101Z", fill: "var(--dsw-alias-illustration-detail)" }),
|
|
26
|
+
h("path", { d: "M149.05 98.8527C149.05 112.66 137.857 123.853 124.05 123.853C110.242 123.853 99.0496 112.66 99.0496 98.8527C99.0496 85.0455 110.242 73.8527 124.05 73.8527C137.857 73.8527 149.05 85.0455 149.05 98.8527Z", fill: "var(--dsw-alias-illustration-detail)" }),
|
|
27
|
+
h("path", { d: "M144.192 98.8529C144.192 109.978 135.174 118.997 124.049 118.997C112.923 118.997 103.905 109.978 103.905 98.8529C103.905 87.7278 112.923 78.709 124.049 78.709C135.174 78.709 144.192 87.7278 144.192 98.8529Z", fill: "var(--dsw-alias-illustration-inset)" }),
|
|
28
|
+
h("rect", { x: "112.85", y: "87.65", width: "9.5", height: "9.5", rx: "2.6", fill: "var(--dsw-alias-illustration-detail)" }),
|
|
29
|
+
h("rect", { x: "125.75", y: "87.65", width: "9.5", height: "9.5", rx: "2.6", fill: "var(--dsw-alias-illustration-detail)", fillOpacity: 0.82 }),
|
|
30
|
+
h("rect", { x: "112.85", y: "100.55", width: "9.5", height: "9.5", rx: "2.6", fill: "var(--dsw-alias-illustration-detail)", fillOpacity: 0.82 }),
|
|
31
|
+
h("rect", { x: "125.75", y: "100.55", width: "9.5", height: "9.5", rx: "2.6", fill: "var(--dsw-alias-illustration-detail)" })));
|
|
32
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
.wb-field {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
gap: var(--wb-len-6);
|
|
5
|
+
font-size: var(--dsw-font-xs-13-font-size);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.wb-fieldLabel {
|
|
9
|
+
color: var(--dsw-alias-label-secondary);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.wb-fieldHint {
|
|
13
|
+
font-size: var(--dsw-font-xxs-12-font-size);
|
|
14
|
+
line-height: var(--wb-line-18);
|
|
15
|
+
color: var(--dsw-alias-label-tertiary);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.wb-field:has(:disabled) .wb-fieldLabel {
|
|
19
|
+
opacity: 0.4;
|
|
20
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ReactNode } from '../lib/react.js';
|
|
2
|
+
import './Field.css';
|
|
3
|
+
/**
|
|
4
|
+
* `Field` 的契约:一行"标签 + 控件 + 说明"的排布。
|
|
5
|
+
*/
|
|
6
|
+
export interface FieldProps {
|
|
7
|
+
readonly label: ReactNode;
|
|
8
|
+
readonly hint?: ReactNode | undefined;
|
|
9
|
+
readonly children?: ReactNode | undefined;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* 标签 + 控件的排布:没进 `FormRow` 时用它兜住一个字段的标签与说明。
|
|
13
|
+
* @param props.label - 左侧标签,必给。
|
|
14
|
+
* @param props.hint - 控件下面那行说明;不给不画。
|
|
15
|
+
* @param props.children - 控件本体,落在标签与说明之间。
|
|
16
|
+
* @returns 一个 `<label>`,点标签会聚焦里面的控件。
|
|
17
|
+
*/
|
|
18
|
+
export declare function Field({ label, hint, children }: FieldProps): JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { h } from '../lib/react.js';
|
|
2
|
+
import './Field.css';
|
|
3
|
+
/**
|
|
4
|
+
* 标签 + 控件的排布:没进 `FormRow` 时用它兜住一个字段的标签与说明。
|
|
5
|
+
* @param props.label - 左侧标签,必给。
|
|
6
|
+
* @param props.hint - 控件下面那行说明;不给不画。
|
|
7
|
+
* @param props.children - 控件本体,落在标签与说明之间。
|
|
8
|
+
* @returns 一个 `<label>`,点标签会聚焦里面的控件。
|
|
9
|
+
*/
|
|
10
|
+
export function Field({ label, hint, children }) {
|
|
11
|
+
return (h("label", { className: "wb-field" },
|
|
12
|
+
h("span", { className: "wb-fieldLabel" }, label),
|
|
13
|
+
children,
|
|
14
|
+
hint === undefined ? null : h("span", { className: "wb-fieldHint" }, hint)));
|
|
15
|
+
}
|