@molecule/app-comparison-row-svelte 0.0.1-stage → 1.1.1
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.md
CHANGED
|
@@ -3,7 +3,7 @@ AUTO-GENERATED — DO NOT EDIT THIS FILE.
|
|
|
3
3
|
Generated by `mlcl sync-docs` from the package's src/index.ts JSDoc + mlcl/registry.json.
|
|
4
4
|
Edits here are overwritten on the next commit (molecule's pre-commit hook regenerates).
|
|
5
5
|
To change this document, edit the module-level JSDoc in src/index.ts.
|
|
6
|
-
Generated: 2026-11-
|
|
6
|
+
Generated: 2026-11-16T20:21:24.929Z
|
|
7
7
|
-->
|
|
8
8
|
|
|
9
9
|
# @molecule/app-comparison-row-svelte
|
|
@@ -88,7 +88,7 @@ const ComparisonRow: LegacyComponentType
|
|
|
88
88
|
Peer dependencies:
|
|
89
89
|
|
|
90
90
|
- `@molecule/app-svelte` ^3.5.0
|
|
91
|
-
- `@molecule/app-ui` ^1.0
|
|
91
|
+
- `@molecule/app-ui` ^1.4.0
|
|
92
92
|
- `@molecule/app-ui-svelte` ^1.1.0
|
|
93
93
|
- `svelte` ^5.0.0
|
|
94
94
|
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
ComparisonRow: the Svelte counterpart of `@molecule/app-comparison-row-react`'s
|
|
3
3
|
`ComparisonRow` — period-over-period stat comparison row: current value,
|
|
4
4
|
optional previous value, and a coloured delta% chip. Same props (React
|
|
5
|
-
names), same DOM for the same input; the delta
|
|
6
|
-
|
|
5
|
+
names), same DOM for the same input; the delta's tone class and the layout
|
|
6
|
+
and type classes come from the ClassMap bond.
|
|
7
7
|
-->
|
|
8
8
|
<script lang="ts">
|
|
9
9
|
import { getClassMap } from '@molecule/app-ui'
|
|
@@ -25,8 +25,12 @@
|
|
|
25
25
|
const arrow = $derived(
|
|
26
26
|
deltaPct === undefined ? '' : deltaPct > 0 ? '▲' : deltaPct < 0 ? '▼' : '–',
|
|
27
27
|
)
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
// The delta's tone class: the theme's success green for a rise, its error
|
|
29
|
+
// red for a fall, its secondary grey for no change.
|
|
30
|
+
const deltaToneClass = $derived(
|
|
31
|
+
deltaPct === undefined
|
|
32
|
+
? ''
|
|
33
|
+
: cm.textTone(deltaPct > 0 ? 'success' : deltaPct < 0 ? 'error' : 'secondary'),
|
|
30
34
|
)
|
|
31
35
|
const pct = $derived(deltaPct === undefined ? '' : Math.abs(deltaPct).toFixed(1))
|
|
32
36
|
</script>
|
|
@@ -55,7 +59,7 @@
|
|
|
55
59
|
</span>
|
|
56
60
|
{/if}
|
|
57
61
|
{#if deltaPct !== undefined}
|
|
58
|
-
<span class={cm.cn(cm.textSize('xs'), cm.fontWeight('semibold'))}
|
|
62
|
+
<span class={cm.cn(cm.textSize('xs'), cm.fontWeight('semibold'), deltaToneClass)}>
|
|
59
63
|
{#if formatDelta}{@render formatDelta(deltaPct)}{:else}{arrow} {pct}%{/if}
|
|
60
64
|
</span>
|
|
61
65
|
{/if}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ComparisonRow.svelte.d.ts","sourceRoot":"","sources":["../src/ComparisonRow.svelte"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"ComparisonRow.svelte.d.ts","sourceRoot":"","sources":["../src/ComparisonRow.svelte"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AA+DrD,QAAA,MAAM,aAAa,wDAAwC,CAAC;AAC5D,KAAK,aAAa,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC;AACtD,eAAe,aAAa,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@molecule/app-comparison-row-svelte",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "Period-over-period stat comparison (\"$X vs $Y\", with delta)",
|
|
5
5
|
"homepage": "https://www.molecule.dev/packages/app-comparison-row-svelte",
|
|
6
6
|
"type": "module",
|
|
@@ -49,17 +49,17 @@
|
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
51
|
"@molecule/app-svelte": "^3.5.0",
|
|
52
|
-
"@molecule/app-ui": "^1.0
|
|
52
|
+
"@molecule/app-ui": "^1.4.0",
|
|
53
53
|
"@molecule/app-ui-svelte": "^1.1.0",
|
|
54
54
|
"svelte": "^5.0.0"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"@molecule/app-framework-conformance": "0.0.0",
|
|
58
|
-
"@molecule/app-i18n": "1.2.
|
|
58
|
+
"@molecule/app-i18n": "1.2.2",
|
|
59
59
|
"@molecule/app-icons": "1.0.4",
|
|
60
|
-
"@molecule/app-svelte": "3.
|
|
61
|
-
"@molecule/app-ui": "1.
|
|
62
|
-
"@molecule/app-ui-svelte": "1.1.
|
|
60
|
+
"@molecule/app-svelte": "3.7.1",
|
|
61
|
+
"@molecule/app-ui": "1.4.0",
|
|
62
|
+
"@molecule/app-ui-svelte": "1.1.6",
|
|
63
63
|
"@sveltejs/package": "3.0.2",
|
|
64
64
|
"@sveltejs/vite-plugin-svelte": "7.1.2",
|
|
65
65
|
"@types/node": "26.6.5",
|