@kanso-protocol/empty-state 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,78 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Input, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Kanso Protocol — EmptyState
|
|
6
|
+
*
|
|
7
|
+
* Centered placeholder for empty lists, missing data, or zero-result
|
|
8
|
+
* screens. Composes a circular illustration container, title,
|
|
9
|
+
* description, and an actions row. Project the illustration via
|
|
10
|
+
* `[kpEmptyStateIcon]` and footer buttons via `[kpEmptyStateActions]`.
|
|
11
|
+
*/
|
|
12
|
+
class KpEmptyStateComponent {
|
|
13
|
+
size = 'md';
|
|
14
|
+
title = '';
|
|
15
|
+
description = '';
|
|
16
|
+
showIllustration = true;
|
|
17
|
+
showDescription = true;
|
|
18
|
+
get hostClasses() {
|
|
19
|
+
return `kp-es kp-es--${this.size}`;
|
|
20
|
+
}
|
|
21
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.7", ngImport: i0, type: KpEmptyStateComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
22
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.7", type: KpEmptyStateComponent, isStandalone: true, selector: "kp-empty-state", inputs: { size: "size", title: "title", description: "description", showIllustration: "showIllustration", showDescription: "showDescription" }, host: { properties: { "class": "hostClasses" } }, ngImport: i0, template: `
|
|
23
|
+
@if (showIllustration) {
|
|
24
|
+
<div class="kp-es__illustration">
|
|
25
|
+
<ng-content select="[kpEmptyStateIcon]"/>
|
|
26
|
+
</div>
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
<div class="kp-es__text">
|
|
30
|
+
<h3 class="kp-es__title">{{ title }}</h3>
|
|
31
|
+
@if (showDescription) {
|
|
32
|
+
<p class="kp-es__desc">{{ description }}</p>
|
|
33
|
+
}
|
|
34
|
+
</div>
|
|
35
|
+
|
|
36
|
+
<div class="kp-es__actions">
|
|
37
|
+
<ng-content select="[kpEmptyStateActions]"/>
|
|
38
|
+
</div>
|
|
39
|
+
`, isInline: true, styles: [":host{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--kp-es-gap-it);box-sizing:border-box;padding:var(--kp-es-pad-v) 24px;width:100%;min-width:320px;font-family:var(--kp-font-family-sans, \"Onest\", system-ui, sans-serif)}.kp-es__illustration{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;width:var(--kp-es-ill-size);height:var(--kp-es-ill-size);border-radius:50%;background:var(--kp-color-empty-state-illustration-bg, var(--kp-color-gray-100));color:var(--kp-color-empty-state-illustration-icon, var(--kp-color-gray-500))}.kp-es__illustration ::ng-deep svg{width:var(--kp-es-ill-icon);height:var(--kp-es-ill-icon)}.kp-es__text{display:flex;flex-direction:column;align-items:center;gap:var(--kp-es-gap-td);max-width:400px;text-align:center}.kp-es__title{margin:0;font-size:var(--kp-es-title-size);line-height:var(--kp-es-title-lh);font-weight:500;color:var(--kp-color-empty-state-fg-title, var(--kp-color-gray-900))}.kp-es__desc{margin:0;font-size:var(--kp-es-desc-size);line-height:var(--kp-es-desc-lh);color:var(--kp-color-empty-state-fg-description, var(--kp-color-gray-600))}.kp-es__actions{display:inline-flex;align-items:center;gap:8px;margin-top:calc(var(--kp-es-gap-ta) - var(--kp-es-gap-it))}.kp-es__actions:empty{display:none}:host(.kp-es--sm){--kp-es-ill-size: 48px;--kp-es-ill-icon: 24px;--kp-es-gap-it: 16px;--kp-es-gap-td: 4px;--kp-es-gap-ta: 16px;--kp-es-pad-v: 32px;--kp-es-title-size: 16px;--kp-es-title-lh: 24px;--kp-es-desc-size: 14px;--kp-es-desc-lh: 20px}:host(.kp-es--md){--kp-es-ill-size: 64px;--kp-es-ill-icon: 32px;--kp-es-gap-it: 20px;--kp-es-gap-td: 6px;--kp-es-gap-ta: 20px;--kp-es-pad-v: 48px;--kp-es-title-size: 18px;--kp-es-title-lh: 28px;--kp-es-desc-size: 16px;--kp-es-desc-lh: 24px}:host(.kp-es--lg){--kp-es-ill-size: 80px;--kp-es-ill-icon: 40px;--kp-es-gap-it: 24px;--kp-es-gap-td: 8px;--kp-es-gap-ta: 24px;--kp-es-pad-v: 64px;--kp-es-title-size: 20px;--kp-es-title-lh: 28px;--kp-es-desc-size: 16px;--kp-es-desc-lh: 24px}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
40
|
+
}
|
|
41
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.7", ngImport: i0, type: KpEmptyStateComponent, decorators: [{
|
|
42
|
+
type: Component,
|
|
43
|
+
args: [{ selector: 'kp-empty-state', imports: [], changeDetection: ChangeDetectionStrategy.OnPush, host: { '[class]': 'hostClasses' }, template: `
|
|
44
|
+
@if (showIllustration) {
|
|
45
|
+
<div class="kp-es__illustration">
|
|
46
|
+
<ng-content select="[kpEmptyStateIcon]"/>
|
|
47
|
+
</div>
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
<div class="kp-es__text">
|
|
51
|
+
<h3 class="kp-es__title">{{ title }}</h3>
|
|
52
|
+
@if (showDescription) {
|
|
53
|
+
<p class="kp-es__desc">{{ description }}</p>
|
|
54
|
+
}
|
|
55
|
+
</div>
|
|
56
|
+
|
|
57
|
+
<div class="kp-es__actions">
|
|
58
|
+
<ng-content select="[kpEmptyStateActions]"/>
|
|
59
|
+
</div>
|
|
60
|
+
`, styles: [":host{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--kp-es-gap-it);box-sizing:border-box;padding:var(--kp-es-pad-v) 24px;width:100%;min-width:320px;font-family:var(--kp-font-family-sans, \"Onest\", system-ui, sans-serif)}.kp-es__illustration{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;width:var(--kp-es-ill-size);height:var(--kp-es-ill-size);border-radius:50%;background:var(--kp-color-empty-state-illustration-bg, var(--kp-color-gray-100));color:var(--kp-color-empty-state-illustration-icon, var(--kp-color-gray-500))}.kp-es__illustration ::ng-deep svg{width:var(--kp-es-ill-icon);height:var(--kp-es-ill-icon)}.kp-es__text{display:flex;flex-direction:column;align-items:center;gap:var(--kp-es-gap-td);max-width:400px;text-align:center}.kp-es__title{margin:0;font-size:var(--kp-es-title-size);line-height:var(--kp-es-title-lh);font-weight:500;color:var(--kp-color-empty-state-fg-title, var(--kp-color-gray-900))}.kp-es__desc{margin:0;font-size:var(--kp-es-desc-size);line-height:var(--kp-es-desc-lh);color:var(--kp-color-empty-state-fg-description, var(--kp-color-gray-600))}.kp-es__actions{display:inline-flex;align-items:center;gap:8px;margin-top:calc(var(--kp-es-gap-ta) - var(--kp-es-gap-it))}.kp-es__actions:empty{display:none}:host(.kp-es--sm){--kp-es-ill-size: 48px;--kp-es-ill-icon: 24px;--kp-es-gap-it: 16px;--kp-es-gap-td: 4px;--kp-es-gap-ta: 16px;--kp-es-pad-v: 32px;--kp-es-title-size: 16px;--kp-es-title-lh: 24px;--kp-es-desc-size: 14px;--kp-es-desc-lh: 20px}:host(.kp-es--md){--kp-es-ill-size: 64px;--kp-es-ill-icon: 32px;--kp-es-gap-it: 20px;--kp-es-gap-td: 6px;--kp-es-gap-ta: 20px;--kp-es-pad-v: 48px;--kp-es-title-size: 18px;--kp-es-title-lh: 28px;--kp-es-desc-size: 16px;--kp-es-desc-lh: 24px}:host(.kp-es--lg){--kp-es-ill-size: 80px;--kp-es-ill-icon: 40px;--kp-es-gap-it: 24px;--kp-es-gap-td: 8px;--kp-es-gap-ta: 24px;--kp-es-pad-v: 64px;--kp-es-title-size: 20px;--kp-es-title-lh: 28px;--kp-es-desc-size: 16px;--kp-es-desc-lh: 24px}\n"] }]
|
|
61
|
+
}], propDecorators: { size: [{
|
|
62
|
+
type: Input
|
|
63
|
+
}], title: [{
|
|
64
|
+
type: Input
|
|
65
|
+
}], description: [{
|
|
66
|
+
type: Input
|
|
67
|
+
}], showIllustration: [{
|
|
68
|
+
type: Input
|
|
69
|
+
}], showDescription: [{
|
|
70
|
+
type: Input
|
|
71
|
+
}] } });
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Generated bundle index. Do not edit.
|
|
75
|
+
*/
|
|
76
|
+
|
|
77
|
+
export { KpEmptyStateComponent };
|
|
78
|
+
//# sourceMappingURL=kanso-protocol-empty-state.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kanso-protocol-empty-state.mjs","sources":["../../../../../packages/components/empty-state/src/empty-state.component.ts","../../../../../packages/components/empty-state/src/kanso-protocol-empty-state.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, Input } from '@angular/core';\n\nexport type KpEmptyStateSize = 'sm' | 'md' | 'lg';\n\n/**\n * Kanso Protocol — EmptyState\n *\n * Centered placeholder for empty lists, missing data, or zero-result\n * screens. Composes a circular illustration container, title,\n * description, and an actions row. Project the illustration via\n * `[kpEmptyStateIcon]` and footer buttons via `[kpEmptyStateActions]`.\n */\n@Component({\n selector: 'kp-empty-state',\n imports: [],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { '[class]': 'hostClasses' },\n template: `\n @if (showIllustration) {\n <div class=\"kp-es__illustration\">\n <ng-content select=\"[kpEmptyStateIcon]\"/>\n </div>\n }\n\n <div class=\"kp-es__text\">\n <h3 class=\"kp-es__title\">{{ title }}</h3>\n @if (showDescription) {\n <p class=\"kp-es__desc\">{{ description }}</p>\n }\n </div>\n\n <div class=\"kp-es__actions\">\n <ng-content select=\"[kpEmptyStateActions]\"/>\n </div>\n `,\n styles: [`\n :host {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: var(--kp-es-gap-it);\n box-sizing: border-box;\n padding: var(--kp-es-pad-v) 24px;\n width: 100%;\n min-width: 320px;\n font-family: var(--kp-font-family-sans, 'Onest', system-ui, sans-serif);\n }\n\n .kp-es__illustration {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex: 0 0 auto;\n width: var(--kp-es-ill-size);\n height: var(--kp-es-ill-size);\n border-radius: 50%;\n background: var(--kp-color-empty-state-illustration-bg, var(--kp-color-gray-100));\n color: var(--kp-color-empty-state-illustration-icon, var(--kp-color-gray-500));\n }\n .kp-es__illustration ::ng-deep svg {\n width: var(--kp-es-ill-icon);\n height: var(--kp-es-ill-icon);\n }\n\n .kp-es__text {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: var(--kp-es-gap-td);\n max-width: 400px;\n text-align: center;\n }\n .kp-es__title {\n margin: 0;\n font-size: var(--kp-es-title-size);\n line-height: var(--kp-es-title-lh);\n font-weight: 500;\n color: var(--kp-color-empty-state-fg-title, var(--kp-color-gray-900));\n }\n .kp-es__desc {\n margin: 0;\n font-size: var(--kp-es-desc-size);\n line-height: var(--kp-es-desc-lh);\n color: var(--kp-color-empty-state-fg-description, var(--kp-color-gray-600));\n }\n\n .kp-es__actions {\n display: inline-flex;\n align-items: center;\n gap: 8px;\n margin-top: calc(var(--kp-es-gap-ta) - var(--kp-es-gap-it));\n }\n .kp-es__actions:empty { display: none; }\n\n /* Sizes */\n :host(.kp-es--sm) {\n --kp-es-ill-size: 48px;\n --kp-es-ill-icon: 24px;\n --kp-es-gap-it: 16px;\n --kp-es-gap-td: 4px;\n --kp-es-gap-ta: 16px;\n --kp-es-pad-v: 32px;\n --kp-es-title-size: 16px;\n --kp-es-title-lh: 24px;\n --kp-es-desc-size: 14px;\n --kp-es-desc-lh: 20px;\n }\n :host(.kp-es--md) {\n --kp-es-ill-size: 64px;\n --kp-es-ill-icon: 32px;\n --kp-es-gap-it: 20px;\n --kp-es-gap-td: 6px;\n --kp-es-gap-ta: 20px;\n --kp-es-pad-v: 48px;\n --kp-es-title-size: 18px;\n --kp-es-title-lh: 28px;\n --kp-es-desc-size: 16px;\n --kp-es-desc-lh: 24px;\n }\n :host(.kp-es--lg) {\n --kp-es-ill-size: 80px;\n --kp-es-ill-icon: 40px;\n --kp-es-gap-it: 24px;\n --kp-es-gap-td: 8px;\n --kp-es-gap-ta: 24px;\n --kp-es-pad-v: 64px;\n --kp-es-title-size: 20px;\n --kp-es-title-lh: 28px;\n --kp-es-desc-size: 16px;\n --kp-es-desc-lh: 24px;\n }\n `],\n})\nexport class KpEmptyStateComponent {\n @Input() size: KpEmptyStateSize = 'md';\n @Input() title = '';\n @Input() description = '';\n @Input() showIllustration = true;\n @Input() showDescription = true;\n\n get hostClasses(): string {\n return `kp-es kp-es--${this.size}`;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAIA;;;;;;;AAOG;MA2HU,qBAAqB,CAAA;IACvB,IAAI,GAAqB,IAAI;IAC7B,KAAK,GAAG,EAAE;IACV,WAAW,GAAG,EAAE;IAChB,gBAAgB,GAAG,IAAI;IACvB,eAAe,GAAG,IAAI;AAE/B,IAAA,IAAI,WAAW,GAAA;AACb,QAAA,OAAO,CAAA,aAAA,EAAgB,IAAI,CAAC,IAAI,EAAE;IACpC;uGATW,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAArB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,qBAAqB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,gBAAA,EAAA,MAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,KAAA,EAAA,OAAA,EAAA,WAAA,EAAA,aAAA,EAAA,gBAAA,EAAA,kBAAA,EAAA,eAAA,EAAA,iBAAA,EAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,OAAA,EAAA,aAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EArHtB;;;;;;;;;;;;;;;;;AAiBT,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,MAAA,EAAA,CAAA,6+DAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FAoGU,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBA1HjC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,gBAAgB,EAAA,OAAA,EACjB,EAAE,EAAA,eAAA,EACM,uBAAuB,CAAC,MAAM,EAAA,IAAA,EACzC,EAAE,SAAS,EAAE,aAAa,EAAE,EAAA,QAAA,EACxB;;;;;;;;;;;;;;;;;AAiBT,EAAA,CAAA,EAAA,MAAA,EAAA,CAAA,6+DAAA,CAAA,EAAA;;sBAqGA;;sBACA;;sBACA;;sBACA;;sBACA;;;AC3IH;;AAEG;;;;"}
|
package/package.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@kanso-protocol/empty-state",
|
|
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 — empty-state (component).",
|
|
11
|
+
"author": "GregNBlack",
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "https://github.com/GregNBlack/kanso-protocol.git",
|
|
15
|
+
"directory": "packages/components/empty-state"
|
|
16
|
+
},
|
|
17
|
+
"homepage": "https://gregnblack.github.io/kanso-protocol/?path=/docs/components-emptystate--docs",
|
|
18
|
+
"bugs": "https://github.com/GregNBlack/kanso-protocol/issues",
|
|
19
|
+
"keywords": [
|
|
20
|
+
"design-system",
|
|
21
|
+
"angular",
|
|
22
|
+
"kanso",
|
|
23
|
+
"empty-state"
|
|
24
|
+
],
|
|
25
|
+
"sideEffects": false,
|
|
26
|
+
"module": "fesm2022/kanso-protocol-empty-state.mjs",
|
|
27
|
+
"typings": "types/kanso-protocol-empty-state.d.ts",
|
|
28
|
+
"exports": {
|
|
29
|
+
"./package.json": {
|
|
30
|
+
"default": "./package.json"
|
|
31
|
+
},
|
|
32
|
+
".": {
|
|
33
|
+
"types": "./types/kanso-protocol-empty-state.d.ts",
|
|
34
|
+
"default": "./fesm2022/kanso-protocol-empty-state.mjs"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"type": "module",
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"tslib": "^2.3.0"
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
|
|
3
|
+
type KpEmptyStateSize = 'sm' | 'md' | 'lg';
|
|
4
|
+
/**
|
|
5
|
+
* Kanso Protocol — EmptyState
|
|
6
|
+
*
|
|
7
|
+
* Centered placeholder for empty lists, missing data, or zero-result
|
|
8
|
+
* screens. Composes a circular illustration container, title,
|
|
9
|
+
* description, and an actions row. Project the illustration via
|
|
10
|
+
* `[kpEmptyStateIcon]` and footer buttons via `[kpEmptyStateActions]`.
|
|
11
|
+
*/
|
|
12
|
+
declare class KpEmptyStateComponent {
|
|
13
|
+
size: KpEmptyStateSize;
|
|
14
|
+
title: string;
|
|
15
|
+
description: string;
|
|
16
|
+
showIllustration: boolean;
|
|
17
|
+
showDescription: boolean;
|
|
18
|
+
get hostClasses(): string;
|
|
19
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<KpEmptyStateComponent, never>;
|
|
20
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<KpEmptyStateComponent, "kp-empty-state", never, { "size": { "alias": "size"; "required": false; }; "title": { "alias": "title"; "required": false; }; "description": { "alias": "description"; "required": false; }; "showIllustration": { "alias": "showIllustration"; "required": false; }; "showDescription": { "alias": "showDescription"; "required": false; }; }, {}, never, ["[kpEmptyStateIcon]", "[kpEmptyStateActions]"], true, never>;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export { KpEmptyStateComponent };
|
|
24
|
+
export type { KpEmptyStateSize };
|