@dsh-workbench/shared 0.2.11 → 0.2.12
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/MockStrip.css +5 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/package.json +1 -1
- package/src/index.ts +0 -1
- package/src/components/MockStrip.css +0 -45
- package/src/components/MockStrip.tsx +0 -41
package/dist/index.d.ts
CHANGED
|
@@ -20,7 +20,6 @@ export * from './components/CardBoundary.js';
|
|
|
20
20
|
export * from './components/CardHead.js';
|
|
21
21
|
export * from './components/ChoiceGroup.js';
|
|
22
22
|
export * from './components/LongTaskRow.js';
|
|
23
|
-
export * from './components/MockStrip.js';
|
|
24
23
|
export * from './components/Note.js';
|
|
25
24
|
export * from './components/ResourceStates.js';
|
|
26
25
|
export * from './components/Rows.js';
|
package/dist/index.js
CHANGED
|
@@ -20,7 +20,6 @@ export * from './components/CardBoundary.js';
|
|
|
20
20
|
export * from './components/CardHead.js';
|
|
21
21
|
export * from './components/ChoiceGroup.js';
|
|
22
22
|
export * from './components/LongTaskRow.js';
|
|
23
|
-
export * from './components/MockStrip.js';
|
|
24
23
|
export * from './components/Note.js';
|
|
25
24
|
export * from './components/ResourceStates.js';
|
|
26
25
|
export * from './components/Rows.js';
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -20,7 +20,6 @@ export * from './components/CardBoundary.js';
|
|
|
20
20
|
export * from './components/CardHead.js';
|
|
21
21
|
export * from './components/ChoiceGroup.js';
|
|
22
22
|
export * from './components/LongTaskRow.js';
|
|
23
|
-
export * from './components/MockStrip.js';
|
|
24
23
|
export * from './components/Note.js';
|
|
25
24
|
export * from './components/ResourceStates.js';
|
|
26
25
|
export * from './components/Rows.js';
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
.wb-mockStrip {
|
|
3
|
-
display: flex;
|
|
4
|
-
flex-wrap: wrap;
|
|
5
|
-
gap: var(--wb-len-4);
|
|
6
|
-
padding: var(--wb-len-8) var(--wb-len-12);
|
|
7
|
-
border-bottom: 0.5px solid var(--dsw-alias-border-l2);
|
|
8
|
-
flex: none;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.wb-mockNote {
|
|
12
|
-
flex: 1 0 100%;
|
|
13
|
-
font-size: var(--wb-font-10);
|
|
14
|
-
line-height: var(--wb-line-14);
|
|
15
|
-
color: var(--dsw-alias-label-tertiary);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.wb-mockChip {
|
|
19
|
-
flex: none;
|
|
20
|
-
padding: var(--wb-len-2) var(--wb-len-7);
|
|
21
|
-
border: 0.5px solid var(--dsw-alias-border-l2);
|
|
22
|
-
border-radius: var(--wb-radius-pill);
|
|
23
|
-
corner-shape: round;
|
|
24
|
-
background: transparent;
|
|
25
|
-
font-size: var(--wb-font-10);
|
|
26
|
-
line-height: var(--wb-line-14);
|
|
27
|
-
color: var(--dsw-alias-label-secondary);
|
|
28
|
-
cursor: pointer;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.wb-mockChip:hover {
|
|
32
|
-
color: var(--dsw-alias-label-primary);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.wb-mockChipOn {
|
|
36
|
-
border-color: transparent;
|
|
37
|
-
background: var(--dsw-alias-brand-primary);
|
|
38
|
-
color: var(--dsw-alias-label-primary-foreground);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.wb-mockChipOn:hover {
|
|
42
|
-
border-color: transparent;
|
|
43
|
-
background: var(--dsw-alias-brand-primary);
|
|
44
|
-
color: var(--dsw-alias-label-primary-foreground);
|
|
45
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { h } from '../lib/react.js';
|
|
2
|
-
import './MockStrip.css';
|
|
3
|
-
|
|
4
|
-
export function MockStrip({
|
|
5
|
-
mocks,
|
|
6
|
-
index,
|
|
7
|
-
onPick,
|
|
8
|
-
note,
|
|
9
|
-
real,
|
|
10
|
-
}: {
|
|
11
|
-
readonly mocks: readonly { readonly id: string; readonly label: string }[];
|
|
12
|
-
readonly index: number;
|
|
13
|
-
readonly onPick: (next: number) => void;
|
|
14
|
-
readonly note?: string;
|
|
15
|
-
readonly real?: { readonly label: string; readonly active: boolean; readonly onPick: () => void } | undefined;
|
|
16
|
-
}) {
|
|
17
|
-
return (
|
|
18
|
-
<div className="wb-mockStrip">
|
|
19
|
-
<span className="wb-mockNote">{note ?? '夹具:只切状态,不发请求'}</span>
|
|
20
|
-
{real === undefined ? null : (
|
|
21
|
-
<button
|
|
22
|
-
type="button"
|
|
23
|
-
className={`wb-mockChip${real.active ? ' wb-mockChipOn' : ''}`}
|
|
24
|
-
onClick={real.onPick}
|
|
25
|
-
>
|
|
26
|
-
{real.label}
|
|
27
|
-
</button>
|
|
28
|
-
)}
|
|
29
|
-
{mocks.map((mock, at) => (
|
|
30
|
-
<button
|
|
31
|
-
key={mock.id}
|
|
32
|
-
type="button"
|
|
33
|
-
className={`wb-mockChip${at === index ? ' wb-mockChipOn' : ''}`}
|
|
34
|
-
onClick={() => onPick(at)}
|
|
35
|
-
>
|
|
36
|
-
{mock.label}
|
|
37
|
-
</button>
|
|
38
|
-
))}
|
|
39
|
-
</div>
|
|
40
|
-
);
|
|
41
|
-
}
|