@shipload/item-renderer 1.0.0-next.2 → 1.0.0-next.20
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/package.json +2 -2
- package/src/index.ts +13 -3
- package/src/links.ts +11 -8
- package/src/meta.ts +1 -1
- package/src/payload/codec.ts +24 -2
- package/src/primitives/module-slot.ts +4 -4
- package/src/primitives/quantity-badge.ts +15 -5
- package/src/primitives/span-paragraph.ts +1 -1
- package/src/primitives/stat-bar.ts +3 -1
- package/src/primitives/text.ts +27 -1
- package/src/render.ts +12 -7
- package/src/templates/_shared.ts +113 -2
- package/src/templates/component.ts +41 -61
- package/src/templates/index.ts +2 -1
- package/src/templates/module.ts +59 -145
- package/src/templates/packed-entity.ts +25 -5
- package/src/templates/resource.ts +39 -64
- package/src/templates/ship-panel.ts +80 -85
- package/src/tokens/colors.ts +2 -2
- package/test/fixtures/cargo-items.ts +3 -3
- package/src/primitives/compact-row.ts +0 -38
|
@@ -49,7 +49,7 @@ export function cargoShipT1Packed(opts?: {
|
|
|
49
49
|
})
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
export const
|
|
52
|
+
export const ITEM_PLATE = 10001
|
|
53
53
|
|
|
54
54
|
export const FIXTURES = {
|
|
55
55
|
oreT1: cargoOreT1('0x123456789ABCDEF'),
|
|
@@ -61,8 +61,8 @@ export const FIXTURES = {
|
|
|
61
61
|
stats: '0xDEADBEEF1234',
|
|
62
62
|
modules: [],
|
|
63
63
|
}),
|
|
64
|
-
|
|
65
|
-
item_id:
|
|
64
|
+
plate: ServerContract.Types.cargo_item.from({
|
|
65
|
+
item_id: ITEM_PLATE,
|
|
66
66
|
quantity: 1,
|
|
67
67
|
stats: '0x7FFF',
|
|
68
68
|
modules: [],
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import {text} from './text.ts'
|
|
2
|
-
import {tokens} from '../tokens/index.ts'
|
|
3
|
-
|
|
4
|
-
export interface CompactRowProps {
|
|
5
|
-
x: number
|
|
6
|
-
y: number
|
|
7
|
-
width: number
|
|
8
|
-
label: string
|
|
9
|
-
value: string
|
|
10
|
-
labelColor?: string
|
|
11
|
-
valueColor?: string
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export function compactRow(p: CompactRowProps): string {
|
|
15
|
-
const labelColor = p.labelColor ?? tokens.colors.text.secondary
|
|
16
|
-
const valueColor = p.valueColor ?? tokens.colors.text.primary
|
|
17
|
-
return (
|
|
18
|
-
text({
|
|
19
|
-
x: p.x,
|
|
20
|
-
y: p.y,
|
|
21
|
-
value: p.label,
|
|
22
|
-
size: 11,
|
|
23
|
-
weight: 500,
|
|
24
|
-
family: tokens.typography.sans,
|
|
25
|
-
color: labelColor,
|
|
26
|
-
}) +
|
|
27
|
-
text({
|
|
28
|
-
x: p.x + p.width,
|
|
29
|
-
y: p.y,
|
|
30
|
-
value: p.value,
|
|
31
|
-
size: 11,
|
|
32
|
-
weight: 700,
|
|
33
|
-
family: tokens.typography.sans,
|
|
34
|
-
color: valueColor,
|
|
35
|
-
anchor: 'end',
|
|
36
|
-
})
|
|
37
|
-
)
|
|
38
|
-
}
|