@kanso-protocol/stat-card 0.1.0

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.
@@ -0,0 +1,140 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Input, ChangeDetectionStrategy, Component } from '@angular/core';
3
+ import { KpIconComponent } from '@kanso-protocol/icon';
4
+
5
+ /**
6
+ * Kanso Protocol — StatCard
7
+ *
8
+ * Single-metric tile with label, big value, optional icon, optional
9
+ * trend (direction + delta + description), optional sparkline placeholder.
10
+ * Designed to live in a dashboard grid.
11
+ *
12
+ * Slot: `[kpStatCardSparkline]` — drop in your real chart (e.g. recharts);
13
+ * the placeholder shows a styled rectangle when empty.
14
+ *
15
+ * @example
16
+ * <kp-stat-card label="Total revenue" value="$12,482" trendValue="+12.5%" trendDescription="from last month"/>
17
+ */
18
+ class KpStatCardComponent {
19
+ size = 'md';
20
+ label = 'Total revenue';
21
+ value = '$12,482';
22
+ showIcon = false;
23
+ icon = 'trending-up';
24
+ showTrend = true;
25
+ trendDirection = 'up';
26
+ trendAppearance = 'positive';
27
+ trendValue = '+12.5%';
28
+ trendDescription = 'from last month';
29
+ showSparkline = false;
30
+ get trendIconName() {
31
+ if (this.trendDirection === 'up')
32
+ return 'trending-up';
33
+ if (this.trendDirection === 'down')
34
+ return 'trending-down';
35
+ return 'minus';
36
+ }
37
+ get trendTone() {
38
+ if (this.trendDirection === 'neutral')
39
+ return 'neutral';
40
+ const goodWhenUp = this.trendAppearance === 'positive';
41
+ const isUp = this.trendDirection === 'up';
42
+ return (isUp === goodWhenUp) ? 'good' : 'bad';
43
+ }
44
+ get hostClasses() {
45
+ return `kp-stat kp-stat--${this.size}`;
46
+ }
47
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.7", ngImport: i0, type: KpStatCardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
48
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.7", type: KpStatCardComponent, isStandalone: true, selector: "kp-stat-card", inputs: { size: "size", label: "label", value: "value", showIcon: "showIcon", icon: "icon", showTrend: "showTrend", trendDirection: "trendDirection", trendAppearance: "trendAppearance", trendValue: "trendValue", trendDescription: "trendDescription", showSparkline: "showSparkline" }, host: { properties: { "class": "hostClasses" } }, ngImport: i0, template: `
49
+ <div class="kp-stat__header">
50
+ <span class="kp-stat__label">{{ label }}</span>
51
+ @if (showIcon && icon) {
52
+ <span class="kp-stat__icon" aria-hidden="true">
53
+ <kp-icon [name]="icon" />
54
+ </span>
55
+ }
56
+ </div>
57
+
58
+ <span class="kp-stat__value">{{ value }}</span>
59
+
60
+ @if (showTrend) {
61
+ <div class="kp-stat__trend" [attr.data-tone]="trendTone">
62
+ <kp-icon class="kp-stat__trend-icon" [name]="trendIconName" />
63
+ <span class="kp-stat__trend-value">{{ trendValue }}</span>
64
+ @if (trendDescription) {
65
+ <span class="kp-stat__trend-desc">{{ trendDescription }}</span>
66
+ }
67
+ </div>
68
+ }
69
+
70
+ @if (showSparkline) {
71
+ <div class="kp-stat__sparkline">
72
+ <ng-content select="[kpStatCardSparkline]">
73
+ <div class="kp-stat__sparkline-placeholder" aria-hidden="true"></div>
74
+ </ng-content>
75
+ </div>
76
+ }
77
+ `, isInline: true, styles: [":host{box-sizing:border-box;display:flex;flex-direction:column;gap:var(--kp-stat-gap, 12px);padding:var(--kp-stat-pad, 20px);background:var(--kp-color-white, var(--kp-color-white));border:1px solid var(--kp-color-gray-200, var(--kp-color-gray-200));border-radius:12px;font-family:var(--kp-font-family-sans, \"Onest\", system-ui, sans-serif)}:host(.kp-stat--sm){--kp-stat-pad: 16px;--kp-stat-gap: 8px;--kp-stat-value-size: 18px;--kp-stat-label-size: 12px}:host(.kp-stat--md){--kp-stat-pad: 20px;--kp-stat-gap: 12px;--kp-stat-value-size: 24px;--kp-stat-label-size: 13px}:host(.kp-stat--lg){--kp-stat-pad: 24px;--kp-stat-gap: 16px;--kp-stat-value-size: 32px;--kp-stat-label-size: 14px}.kp-stat__header{display:flex;align-items:center;justify-content:space-between;gap:12px}.kp-stat__label{font-size:var(--kp-stat-label-size, 13px);color:var(--kp-color-gray-600, var(--kp-color-gray-600));font-weight:500}.kp-stat__icon{display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;border-radius:50%;background:var(--kp-color-blue-50, var(--kp-color-blue-50));color:var(--kp-color-blue-600, var(--kp-color-blue-600))}.kp-stat__icon .ti{font-size:18px;line-height:1}.kp-stat__value{font-size:var(--kp-stat-value-size, 24px);font-weight:600;color:var(--kp-color-gray-900, var(--kp-color-gray-900));font-variant-numeric:tabular-nums;line-height:1.1}.kp-stat__trend{display:flex;align-items:center;gap:6px}.kp-stat__trend-icon{font-size:14px;line-height:1}.kp-stat__trend-value{font-size:13px;font-weight:600;font-variant-numeric:tabular-nums}.kp-stat__trend-desc{font-size:12px;color:var(--kp-color-gray-500, var(--kp-color-gray-500))}.kp-stat__trend[data-tone=good]{color:var(--kp-color-green-600, var(--kp-color-green-600))}.kp-stat__trend[data-tone=bad]{color:var(--kp-color-red-600, var(--kp-color-red-600))}.kp-stat__trend[data-tone=neutral]{color:var(--kp-color-gray-500, var(--kp-color-gray-500))}.kp-stat__sparkline{margin-top:4px}.kp-stat__sparkline-placeholder{height:32px;background:var(--kp-color-gray-100, var(--kp-color-gray-100));border-radius:4px}\n"], dependencies: [{ kind: "component", type: KpIconComponent, selector: "kp-icon", inputs: ["name", "size"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
78
+ }
79
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.7", ngImport: i0, type: KpStatCardComponent, decorators: [{
80
+ type: Component,
81
+ args: [{ selector: 'kp-stat-card', imports: [KpIconComponent], changeDetection: ChangeDetectionStrategy.OnPush, host: { '[class]': 'hostClasses' }, template: `
82
+ <div class="kp-stat__header">
83
+ <span class="kp-stat__label">{{ label }}</span>
84
+ @if (showIcon && icon) {
85
+ <span class="kp-stat__icon" aria-hidden="true">
86
+ <kp-icon [name]="icon" />
87
+ </span>
88
+ }
89
+ </div>
90
+
91
+ <span class="kp-stat__value">{{ value }}</span>
92
+
93
+ @if (showTrend) {
94
+ <div class="kp-stat__trend" [attr.data-tone]="trendTone">
95
+ <kp-icon class="kp-stat__trend-icon" [name]="trendIconName" />
96
+ <span class="kp-stat__trend-value">{{ trendValue }}</span>
97
+ @if (trendDescription) {
98
+ <span class="kp-stat__trend-desc">{{ trendDescription }}</span>
99
+ }
100
+ </div>
101
+ }
102
+
103
+ @if (showSparkline) {
104
+ <div class="kp-stat__sparkline">
105
+ <ng-content select="[kpStatCardSparkline]">
106
+ <div class="kp-stat__sparkline-placeholder" aria-hidden="true"></div>
107
+ </ng-content>
108
+ </div>
109
+ }
110
+ `, styles: [":host{box-sizing:border-box;display:flex;flex-direction:column;gap:var(--kp-stat-gap, 12px);padding:var(--kp-stat-pad, 20px);background:var(--kp-color-white, var(--kp-color-white));border:1px solid var(--kp-color-gray-200, var(--kp-color-gray-200));border-radius:12px;font-family:var(--kp-font-family-sans, \"Onest\", system-ui, sans-serif)}:host(.kp-stat--sm){--kp-stat-pad: 16px;--kp-stat-gap: 8px;--kp-stat-value-size: 18px;--kp-stat-label-size: 12px}:host(.kp-stat--md){--kp-stat-pad: 20px;--kp-stat-gap: 12px;--kp-stat-value-size: 24px;--kp-stat-label-size: 13px}:host(.kp-stat--lg){--kp-stat-pad: 24px;--kp-stat-gap: 16px;--kp-stat-value-size: 32px;--kp-stat-label-size: 14px}.kp-stat__header{display:flex;align-items:center;justify-content:space-between;gap:12px}.kp-stat__label{font-size:var(--kp-stat-label-size, 13px);color:var(--kp-color-gray-600, var(--kp-color-gray-600));font-weight:500}.kp-stat__icon{display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;border-radius:50%;background:var(--kp-color-blue-50, var(--kp-color-blue-50));color:var(--kp-color-blue-600, var(--kp-color-blue-600))}.kp-stat__icon .ti{font-size:18px;line-height:1}.kp-stat__value{font-size:var(--kp-stat-value-size, 24px);font-weight:600;color:var(--kp-color-gray-900, var(--kp-color-gray-900));font-variant-numeric:tabular-nums;line-height:1.1}.kp-stat__trend{display:flex;align-items:center;gap:6px}.kp-stat__trend-icon{font-size:14px;line-height:1}.kp-stat__trend-value{font-size:13px;font-weight:600;font-variant-numeric:tabular-nums}.kp-stat__trend-desc{font-size:12px;color:var(--kp-color-gray-500, var(--kp-color-gray-500))}.kp-stat__trend[data-tone=good]{color:var(--kp-color-green-600, var(--kp-color-green-600))}.kp-stat__trend[data-tone=bad]{color:var(--kp-color-red-600, var(--kp-color-red-600))}.kp-stat__trend[data-tone=neutral]{color:var(--kp-color-gray-500, var(--kp-color-gray-500))}.kp-stat__sparkline{margin-top:4px}.kp-stat__sparkline-placeholder{height:32px;background:var(--kp-color-gray-100, var(--kp-color-gray-100));border-radius:4px}\n"] }]
111
+ }], propDecorators: { size: [{
112
+ type: Input
113
+ }], label: [{
114
+ type: Input
115
+ }], value: [{
116
+ type: Input
117
+ }], showIcon: [{
118
+ type: Input
119
+ }], icon: [{
120
+ type: Input
121
+ }], showTrend: [{
122
+ type: Input
123
+ }], trendDirection: [{
124
+ type: Input
125
+ }], trendAppearance: [{
126
+ type: Input
127
+ }], trendValue: [{
128
+ type: Input
129
+ }], trendDescription: [{
130
+ type: Input
131
+ }], showSparkline: [{
132
+ type: Input
133
+ }] } });
134
+
135
+ /**
136
+ * Generated bundle index. Do not edit.
137
+ */
138
+
139
+ export { KpStatCardComponent };
140
+ //# sourceMappingURL=kanso-protocol-stat-card.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kanso-protocol-stat-card.mjs","sources":["../../../../../packages/patterns/stat-card/src/stat-card.component.ts","../../../../../packages/patterns/stat-card/src/kanso-protocol-stat-card.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n Input,\n} from '@angular/core';\nimport { KpIconComponent } from '@kanso-protocol/icon';\n\nexport type KpStatCardSize = 'sm' | 'md' | 'lg';\nexport type KpStatTrendDirection = 'up' | 'down' | 'neutral';\n/**\n * `positive` — up = good (green), down = bad (red).\n * `negative` — up = bad (red), down = good (green) — for inverse metrics like error rate.\n */\nexport type KpStatTrendAppearance = 'positive' | 'negative';\n\n/**\n * Kanso Protocol — StatCard\n *\n * Single-metric tile with label, big value, optional icon, optional\n * trend (direction + delta + description), optional sparkline placeholder.\n * Designed to live in a dashboard grid.\n *\n * Slot: `[kpStatCardSparkline]` — drop in your real chart (e.g. recharts);\n * the placeholder shows a styled rectangle when empty.\n *\n * @example\n * <kp-stat-card label=\"Total revenue\" value=\"$12,482\" trendValue=\"+12.5%\" trendDescription=\"from last month\"/>\n */\n@Component({\n selector: 'kp-stat-card',\n imports: [KpIconComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { '[class]': 'hostClasses' },\n template: `\n <div class=\"kp-stat__header\">\n <span class=\"kp-stat__label\">{{ label }}</span>\n @if (showIcon && icon) {\n <span class=\"kp-stat__icon\" aria-hidden=\"true\">\n <kp-icon [name]=\"icon\" />\n </span>\n }\n </div>\n\n <span class=\"kp-stat__value\">{{ value }}</span>\n\n @if (showTrend) {\n <div class=\"kp-stat__trend\" [attr.data-tone]=\"trendTone\">\n <kp-icon class=\"kp-stat__trend-icon\" [name]=\"trendIconName\" />\n <span class=\"kp-stat__trend-value\">{{ trendValue }}</span>\n @if (trendDescription) {\n <span class=\"kp-stat__trend-desc\">{{ trendDescription }}</span>\n }\n </div>\n }\n\n @if (showSparkline) {\n <div class=\"kp-stat__sparkline\">\n <ng-content select=\"[kpStatCardSparkline]\">\n <div class=\"kp-stat__sparkline-placeholder\" aria-hidden=\"true\"></div>\n </ng-content>\n </div>\n }\n `,\n styles: [`\n :host {\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n gap: var(--kp-stat-gap, 12px);\n padding: var(--kp-stat-pad, 20px);\n background: var(--kp-color-white, var(--kp-color-white));\n border: 1px solid var(--kp-color-gray-200, var(--kp-color-gray-200));\n border-radius: 12px;\n font-family: var(--kp-font-family-sans, 'Onest', system-ui, sans-serif);\n }\n\n :host(.kp-stat--sm) { --kp-stat-pad: 16px; --kp-stat-gap: 8px; --kp-stat-value-size: 18px; --kp-stat-label-size: 12px; }\n :host(.kp-stat--md) { --kp-stat-pad: 20px; --kp-stat-gap: 12px; --kp-stat-value-size: 24px; --kp-stat-label-size: 13px; }\n :host(.kp-stat--lg) { --kp-stat-pad: 24px; --kp-stat-gap: 16px; --kp-stat-value-size: 32px; --kp-stat-label-size: 14px; }\n\n .kp-stat__header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 12px;\n }\n .kp-stat__label {\n font-size: var(--kp-stat-label-size, 13px);\n color: var(--kp-color-gray-600, var(--kp-color-gray-600));\n font-weight: 500;\n }\n .kp-stat__icon {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 36px;\n height: 36px;\n border-radius: 50%;\n background: var(--kp-color-blue-50, var(--kp-color-blue-50));\n color: var(--kp-color-blue-600, var(--kp-color-blue-600));\n }\n .kp-stat__icon .ti { font-size: 18px; line-height: 1; }\n\n .kp-stat__value {\n font-size: var(--kp-stat-value-size, 24px);\n font-weight: 600;\n color: var(--kp-color-gray-900, var(--kp-color-gray-900));\n font-variant-numeric: tabular-nums;\n line-height: 1.1;\n }\n\n .kp-stat__trend {\n display: flex;\n align-items: center;\n gap: 6px;\n }\n .kp-stat__trend-icon { font-size: 14px; line-height: 1; }\n .kp-stat__trend-value { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }\n .kp-stat__trend-desc { font-size: 12px; color: var(--kp-color-gray-500, var(--kp-color-gray-500)); }\n .kp-stat__trend[data-tone='good'] { color: var(--kp-color-green-600, var(--kp-color-green-600)); }\n .kp-stat__trend[data-tone='bad'] { color: var(--kp-color-red-600, var(--kp-color-red-600)); }\n .kp-stat__trend[data-tone='neutral'] { color: var(--kp-color-gray-500, var(--kp-color-gray-500)); }\n\n .kp-stat__sparkline { margin-top: 4px; }\n .kp-stat__sparkline-placeholder {\n height: 32px;\n background: var(--kp-color-gray-100, var(--kp-color-gray-100));\n border-radius: 4px;\n }\n `],\n})\nexport class KpStatCardComponent {\n @Input() size: KpStatCardSize = 'md';\n @Input() label = 'Total revenue';\n @Input() value: string | number = '$12,482';\n\n @Input() showIcon = false;\n @Input() icon: string | null = 'trending-up';\n\n @Input() showTrend = true;\n @Input() trendDirection: KpStatTrendDirection = 'up';\n @Input() trendAppearance: KpStatTrendAppearance = 'positive';\n @Input() trendValue: string | null = '+12.5%';\n @Input() trendDescription: string | null = 'from last month';\n\n @Input() showSparkline = false;\n\n get trendIconName(): string {\n if (this.trendDirection === 'up') return 'trending-up';\n if (this.trendDirection === 'down') return 'trending-down';\n return 'minus';\n }\n\n get trendTone(): 'good' | 'bad' | 'neutral' {\n if (this.trendDirection === 'neutral') return 'neutral';\n const goodWhenUp = this.trendAppearance === 'positive';\n const isUp = this.trendDirection === 'up';\n return (isUp === goodWhenUp) ? 'good' : 'bad';\n }\n\n get hostClasses(): string {\n return `kp-stat kp-stat--${this.size}`;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"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"}
package/package.json ADDED
@@ -0,0 +1,41 @@
1
+ {
2
+ "name": "@kanso-protocol/stat-card",
3
+ "version": "0.1.0",
4
+ "license": "MIT",
5
+ "peerDependencies": {
6
+ "@angular/core": "^18.0.0",
7
+ "@angular/common": "^18.0.0",
8
+ "@kanso-protocol/core": "^0.0.1"
9
+ },
10
+ "description": "Kanso Protocol — stat-card (pattern).",
11
+ "author": "GregNBlack",
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "https://github.com/GregNBlack/kanso-protocol.git",
15
+ "directory": "packages/patterns/stat-card"
16
+ },
17
+ "homepage": "https://gregnblack.github.io/kanso-protocol/?path=/docs/patterns-statcard--docs",
18
+ "bugs": "https://github.com/GregNBlack/kanso-protocol/issues",
19
+ "keywords": [
20
+ "design-system",
21
+ "angular",
22
+ "kanso",
23
+ "stat-card"
24
+ ],
25
+ "sideEffects": false,
26
+ "module": "fesm2022/kanso-protocol-stat-card.mjs",
27
+ "typings": "types/kanso-protocol-stat-card.d.ts",
28
+ "exports": {
29
+ "./package.json": {
30
+ "default": "./package.json"
31
+ },
32
+ ".": {
33
+ "types": "./types/kanso-protocol-stat-card.d.ts",
34
+ "default": "./fesm2022/kanso-protocol-stat-card.mjs"
35
+ }
36
+ },
37
+ "type": "module",
38
+ "dependencies": {
39
+ "tslib": "^2.3.0"
40
+ }
41
+ }
@@ -0,0 +1,43 @@
1
+ import * as i0 from '@angular/core';
2
+
3
+ type KpStatCardSize = 'sm' | 'md' | 'lg';
4
+ type KpStatTrendDirection = 'up' | 'down' | 'neutral';
5
+ /**
6
+ * `positive` — up = good (green), down = bad (red).
7
+ * `negative` — up = bad (red), down = good (green) — for inverse metrics like error rate.
8
+ */
9
+ type KpStatTrendAppearance = 'positive' | 'negative';
10
+ /**
11
+ * Kanso Protocol — StatCard
12
+ *
13
+ * Single-metric tile with label, big value, optional icon, optional
14
+ * trend (direction + delta + description), optional sparkline placeholder.
15
+ * Designed to live in a dashboard grid.
16
+ *
17
+ * Slot: `[kpStatCardSparkline]` — drop in your real chart (e.g. recharts);
18
+ * the placeholder shows a styled rectangle when empty.
19
+ *
20
+ * @example
21
+ * <kp-stat-card label="Total revenue" value="$12,482" trendValue="+12.5%" trendDescription="from last month"/>
22
+ */
23
+ declare class KpStatCardComponent {
24
+ size: KpStatCardSize;
25
+ label: string;
26
+ value: string | number;
27
+ showIcon: boolean;
28
+ icon: string | null;
29
+ showTrend: boolean;
30
+ trendDirection: KpStatTrendDirection;
31
+ trendAppearance: KpStatTrendAppearance;
32
+ trendValue: string | null;
33
+ trendDescription: string | null;
34
+ showSparkline: boolean;
35
+ get trendIconName(): string;
36
+ get trendTone(): 'good' | 'bad' | 'neutral';
37
+ get hostClasses(): string;
38
+ static ɵfac: i0.ɵɵFactoryDeclaration<KpStatCardComponent, never>;
39
+ static ɵcmp: i0.ɵɵComponentDeclaration<KpStatCardComponent, "kp-stat-card", never, { "size": { "alias": "size"; "required": false; }; "label": { "alias": "label"; "required": false; }; "value": { "alias": "value"; "required": false; }; "showIcon": { "alias": "showIcon"; "required": false; }; "icon": { "alias": "icon"; "required": false; }; "showTrend": { "alias": "showTrend"; "required": false; }; "trendDirection": { "alias": "trendDirection"; "required": false; }; "trendAppearance": { "alias": "trendAppearance"; "required": false; }; "trendValue": { "alias": "trendValue"; "required": false; }; "trendDescription": { "alias": "trendDescription"; "required": false; }; "showSparkline": { "alias": "showSparkline"; "required": false; }; }, {}, never, ["[kpStatCardSparkline]"], true, never>;
40
+ }
41
+
42
+ export { KpStatCardComponent };
43
+ export type { KpStatCardSize, KpStatTrendAppearance, KpStatTrendDirection };