@kanso-protocol/stack 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,40 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Input, ChangeDetectionStrategy, Component } from '@angular/core';
3
+
4
+ /**
5
+ * Kanso Protocol — Stack
6
+ *
7
+ * Vertical Auto Layout wrapper with a preset gap scale and cross-axis
8
+ * alignment. Semantic counterpart to `<div style="display:flex;flex-direction:column">`.
9
+ *
10
+ * @example
11
+ * <kp-stack gap="md">
12
+ * <kp-input/>
13
+ * <kp-input/>
14
+ * <kp-button>Save</kp-button>
15
+ * </kp-stack>
16
+ */
17
+ class KpStackComponent {
18
+ gap = 'md';
19
+ align = 'stretch';
20
+ get hostClasses() {
21
+ return `kp-stack kp-stack--gap-${this.gap} kp-stack--align-${this.align}`;
22
+ }
23
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.7", ngImport: i0, type: KpStackComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
24
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.7", type: KpStackComponent, isStandalone: true, selector: "kp-stack", inputs: { gap: "gap", align: "align" }, host: { properties: { "class": "hostClasses" } }, ngImport: i0, template: `<ng-content/>`, isInline: true, styles: [":host{display:flex;flex-direction:column;gap:var(--kp-stack-gap, 16px)}:host(.kp-stack--gap-none){--kp-stack-gap: 0}:host(.kp-stack--gap-2xs){--kp-stack-gap: var(--kp-spacing-2xs, 8px)}:host(.kp-stack--gap-xs){--kp-stack-gap: var(--kp-spacing-xs, 12px)}:host(.kp-stack--gap-sm){--kp-stack-gap: var(--kp-spacing-sm, 16px)}:host(.kp-stack--gap-md){--kp-stack-gap: var(--kp-spacing-md, 20px)}:host(.kp-stack--gap-lg){--kp-stack-gap: var(--kp-spacing-lg, 24px)}:host(.kp-stack--gap-xl){--kp-stack-gap: var(--kp-spacing-xl, 32px)}:host(.kp-stack--gap-2xl){--kp-stack-gap: var(--kp-spacing-2xl, 40px)}:host(.kp-stack--align-start){align-items:flex-start}:host(.kp-stack--align-center){align-items:center}:host(.kp-stack--align-end){align-items:flex-end}:host(.kp-stack--align-stretch){align-items:stretch}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
25
+ }
26
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.7", ngImport: i0, type: KpStackComponent, decorators: [{
27
+ type: Component,
28
+ args: [{ selector: 'kp-stack', imports: [], changeDetection: ChangeDetectionStrategy.OnPush, host: { '[class]': 'hostClasses' }, template: `<ng-content/>`, styles: [":host{display:flex;flex-direction:column;gap:var(--kp-stack-gap, 16px)}:host(.kp-stack--gap-none){--kp-stack-gap: 0}:host(.kp-stack--gap-2xs){--kp-stack-gap: var(--kp-spacing-2xs, 8px)}:host(.kp-stack--gap-xs){--kp-stack-gap: var(--kp-spacing-xs, 12px)}:host(.kp-stack--gap-sm){--kp-stack-gap: var(--kp-spacing-sm, 16px)}:host(.kp-stack--gap-md){--kp-stack-gap: var(--kp-spacing-md, 20px)}:host(.kp-stack--gap-lg){--kp-stack-gap: var(--kp-spacing-lg, 24px)}:host(.kp-stack--gap-xl){--kp-stack-gap: var(--kp-spacing-xl, 32px)}:host(.kp-stack--gap-2xl){--kp-stack-gap: var(--kp-spacing-2xl, 40px)}:host(.kp-stack--align-start){align-items:flex-start}:host(.kp-stack--align-center){align-items:center}:host(.kp-stack--align-end){align-items:flex-end}:host(.kp-stack--align-stretch){align-items:stretch}\n"] }]
29
+ }], propDecorators: { gap: [{
30
+ type: Input
31
+ }], align: [{
32
+ type: Input
33
+ }] } });
34
+
35
+ /**
36
+ * Generated bundle index. Do not edit.
37
+ */
38
+
39
+ export { KpStackComponent };
40
+ //# sourceMappingURL=kanso-protocol-stack.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kanso-protocol-stack.mjs","sources":["../../../../../packages/patterns/stack/src/stack.component.ts","../../../../../packages/patterns/stack/src/kanso-protocol-stack.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n Input,\n} from '@angular/core';\n\nexport type KpStackGap =\n | 'none'\n | '2xs'\n | 'xs'\n | 'sm'\n | 'md'\n | 'lg'\n | 'xl'\n | '2xl';\n\nexport type KpStackAlign = 'start' | 'center' | 'end' | 'stretch';\n\n/**\n * Kanso Protocol — Stack\n *\n * Vertical Auto Layout wrapper with a preset gap scale and cross-axis\n * alignment. Semantic counterpart to `<div style=\"display:flex;flex-direction:column\">`.\n *\n * @example\n * <kp-stack gap=\"md\">\n * <kp-input/>\n * <kp-input/>\n * <kp-button>Save</kp-button>\n * </kp-stack>\n */\n@Component({\n selector: 'kp-stack',\n imports: [],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { '[class]': 'hostClasses' },\n template: `<ng-content/>`,\n styles: [`\n :host {\n display: flex;\n flex-direction: column;\n gap: var(--kp-stack-gap, 16px);\n }\n\n :host(.kp-stack--gap-none) { --kp-stack-gap: 0; }\n :host(.kp-stack--gap-2xs) { --kp-stack-gap: var(--kp-spacing-2xs, 8px); }\n :host(.kp-stack--gap-xs) { --kp-stack-gap: var(--kp-spacing-xs, 12px); }\n :host(.kp-stack--gap-sm) { --kp-stack-gap: var(--kp-spacing-sm, 16px); }\n :host(.kp-stack--gap-md) { --kp-stack-gap: var(--kp-spacing-md, 20px); }\n :host(.kp-stack--gap-lg) { --kp-stack-gap: var(--kp-spacing-lg, 24px); }\n :host(.kp-stack--gap-xl) { --kp-stack-gap: var(--kp-spacing-xl, 32px); }\n :host(.kp-stack--gap-2xl) { --kp-stack-gap: var(--kp-spacing-2xl, 40px); }\n\n :host(.kp-stack--align-start) { align-items: flex-start; }\n :host(.kp-stack--align-center) { align-items: center; }\n :host(.kp-stack--align-end) { align-items: flex-end; }\n :host(.kp-stack--align-stretch) { align-items: stretch; }\n `],\n})\nexport class KpStackComponent {\n @Input() gap: KpStackGap = 'md';\n @Input() align: KpStackAlign = 'stretch';\n\n get hostClasses(): string {\n return `kp-stack kp-stack--gap-${this.gap} kp-stack--align-${this.align}`;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAkBA;;;;;;;;;;;;AAYG;MA6BU,gBAAgB,CAAA;IAClB,GAAG,GAAe,IAAI;IACtB,KAAK,GAAiB,SAAS;AAExC,IAAA,IAAI,WAAW,GAAA;QACb,OAAO,CAAA,uBAAA,EAA0B,IAAI,CAAC,GAAG,oBAAoB,IAAI,CAAC,KAAK,CAAA,CAAE;IAC3E;uGANW,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAhB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,gBAAgB,8JAvBjB,CAAA,aAAA,CAAe,EAAA,QAAA,EAAA,IAAA,EAAA,MAAA,EAAA,CAAA,myBAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FAuBd,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBA5B5B,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,UAAU,EAAA,OAAA,EACX,EAAE,EAAA,eAAA,EACM,uBAAuB,CAAC,MAAM,EAAA,IAAA,EACzC,EAAE,SAAS,EAAE,aAAa,EAAE,YACxB,CAAA,aAAA,CAAe,EAAA,MAAA,EAAA,CAAA,myBAAA,CAAA,EAAA;;sBAwBxB;;sBACA;;;AC7DH;;AAEG;;;;"}
package/package.json ADDED
@@ -0,0 +1,41 @@
1
+ {
2
+ "name": "@kanso-protocol/stack",
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 — stack (pattern).",
11
+ "author": "GregNBlack",
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "https://github.com/GregNBlack/kanso-protocol.git",
15
+ "directory": "packages/patterns/stack"
16
+ },
17
+ "homepage": "https://gregnblack.github.io/kanso-protocol/?path=/docs/patterns-stack--docs",
18
+ "bugs": "https://github.com/GregNBlack/kanso-protocol/issues",
19
+ "keywords": [
20
+ "design-system",
21
+ "angular",
22
+ "kanso",
23
+ "stack"
24
+ ],
25
+ "sideEffects": false,
26
+ "module": "fesm2022/kanso-protocol-stack.mjs",
27
+ "typings": "types/kanso-protocol-stack.d.ts",
28
+ "exports": {
29
+ "./package.json": {
30
+ "default": "./package.json"
31
+ },
32
+ ".": {
33
+ "types": "./types/kanso-protocol-stack.d.ts",
34
+ "default": "./fesm2022/kanso-protocol-stack.mjs"
35
+ }
36
+ },
37
+ "type": "module",
38
+ "dependencies": {
39
+ "tslib": "^2.3.0"
40
+ }
41
+ }
@@ -0,0 +1,27 @@
1
+ import * as i0 from '@angular/core';
2
+
3
+ type KpStackGap = 'none' | '2xs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
4
+ type KpStackAlign = 'start' | 'center' | 'end' | 'stretch';
5
+ /**
6
+ * Kanso Protocol — Stack
7
+ *
8
+ * Vertical Auto Layout wrapper with a preset gap scale and cross-axis
9
+ * alignment. Semantic counterpart to `<div style="display:flex;flex-direction:column">`.
10
+ *
11
+ * @example
12
+ * <kp-stack gap="md">
13
+ * <kp-input/>
14
+ * <kp-input/>
15
+ * <kp-button>Save</kp-button>
16
+ * </kp-stack>
17
+ */
18
+ declare class KpStackComponent {
19
+ gap: KpStackGap;
20
+ align: KpStackAlign;
21
+ get hostClasses(): string;
22
+ static ɵfac: i0.ɵɵFactoryDeclaration<KpStackComponent, never>;
23
+ static ɵcmp: i0.ɵɵComponentDeclaration<KpStackComponent, "kp-stack", never, { "gap": { "alias": "gap"; "required": false; }; "align": { "alias": "align"; "required": false; }; }, {}, never, ["*"], true, never>;
24
+ }
25
+
26
+ export { KpStackComponent };
27
+ export type { KpStackAlign, KpStackGap };