@kanso-protocol/row 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,53 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Input, ChangeDetectionStrategy, Component } from '@angular/core';
3
+
4
+ /**
5
+ * Kanso Protocol — Row
6
+ *
7
+ * Horizontal Auto Layout wrapper with a preset gap scale, cross-axis
8
+ * alignment, and main-axis justification. Optional wrap on overflow.
9
+ *
10
+ * @example
11
+ * <kp-row gap="sm" justify="end">
12
+ * <kp-button appearance="ghost">Cancel</kp-button>
13
+ * <kp-button>Save</kp-button>
14
+ * </kp-row>
15
+ */
16
+ class KpRowComponent {
17
+ gap = 'md';
18
+ align = 'center';
19
+ justify = 'start';
20
+ wrap = false;
21
+ get hostClasses() {
22
+ const c = [
23
+ 'kp-row',
24
+ `kp-row--gap-${this.gap}`,
25
+ `kp-row--align-${this.align}`,
26
+ `kp-row--justify-${this.justify}`,
27
+ ];
28
+ if (this.wrap)
29
+ c.push('kp-row--wrap');
30
+ return c.join(' ');
31
+ }
32
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.7", ngImport: i0, type: KpRowComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
33
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.7", type: KpRowComponent, isStandalone: true, selector: "kp-row", inputs: { gap: "gap", align: "align", justify: "justify", wrap: "wrap" }, host: { properties: { "class": "hostClasses" } }, ngImport: i0, template: `<ng-content/>`, isInline: true, styles: [":host{display:flex;flex-direction:row;gap:var(--kp-row-gap, 16px)}:host(.kp-row--gap-none){--kp-row-gap: 0}:host(.kp-row--gap-2xs){--kp-row-gap: var(--kp-spacing-2xs, 8px)}:host(.kp-row--gap-xs){--kp-row-gap: var(--kp-spacing-xs, 12px)}:host(.kp-row--gap-sm){--kp-row-gap: var(--kp-spacing-sm, 16px)}:host(.kp-row--gap-md){--kp-row-gap: var(--kp-spacing-md, 20px)}:host(.kp-row--gap-lg){--kp-row-gap: var(--kp-spacing-lg, 24px)}:host(.kp-row--gap-xl){--kp-row-gap: var(--kp-spacing-xl, 32px)}:host(.kp-row--gap-2xl){--kp-row-gap: var(--kp-spacing-2xl, 40px)}:host(.kp-row--align-start){align-items:flex-start}:host(.kp-row--align-center){align-items:center}:host(.kp-row--align-end){align-items:flex-end}:host(.kp-row--align-stretch){align-items:stretch}:host(.kp-row--align-baseline){align-items:baseline}:host(.kp-row--justify-start){justify-content:flex-start}:host(.kp-row--justify-center){justify-content:center}:host(.kp-row--justify-end){justify-content:flex-end}:host(.kp-row--justify-space-between){justify-content:space-between}:host(.kp-row--justify-space-around){justify-content:space-around}:host(.kp-row--wrap){flex-wrap:wrap}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
34
+ }
35
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.7", ngImport: i0, type: KpRowComponent, decorators: [{
36
+ type: Component,
37
+ args: [{ selector: 'kp-row', imports: [], changeDetection: ChangeDetectionStrategy.OnPush, host: { '[class]': 'hostClasses' }, template: `<ng-content/>`, styles: [":host{display:flex;flex-direction:row;gap:var(--kp-row-gap, 16px)}:host(.kp-row--gap-none){--kp-row-gap: 0}:host(.kp-row--gap-2xs){--kp-row-gap: var(--kp-spacing-2xs, 8px)}:host(.kp-row--gap-xs){--kp-row-gap: var(--kp-spacing-xs, 12px)}:host(.kp-row--gap-sm){--kp-row-gap: var(--kp-spacing-sm, 16px)}:host(.kp-row--gap-md){--kp-row-gap: var(--kp-spacing-md, 20px)}:host(.kp-row--gap-lg){--kp-row-gap: var(--kp-spacing-lg, 24px)}:host(.kp-row--gap-xl){--kp-row-gap: var(--kp-spacing-xl, 32px)}:host(.kp-row--gap-2xl){--kp-row-gap: var(--kp-spacing-2xl, 40px)}:host(.kp-row--align-start){align-items:flex-start}:host(.kp-row--align-center){align-items:center}:host(.kp-row--align-end){align-items:flex-end}:host(.kp-row--align-stretch){align-items:stretch}:host(.kp-row--align-baseline){align-items:baseline}:host(.kp-row--justify-start){justify-content:flex-start}:host(.kp-row--justify-center){justify-content:center}:host(.kp-row--justify-end){justify-content:flex-end}:host(.kp-row--justify-space-between){justify-content:space-between}:host(.kp-row--justify-space-around){justify-content:space-around}:host(.kp-row--wrap){flex-wrap:wrap}\n"] }]
38
+ }], propDecorators: { gap: [{
39
+ type: Input
40
+ }], align: [{
41
+ type: Input
42
+ }], justify: [{
43
+ type: Input
44
+ }], wrap: [{
45
+ type: Input
46
+ }] } });
47
+
48
+ /**
49
+ * Generated bundle index. Do not edit.
50
+ */
51
+
52
+ export { KpRowComponent };
53
+ //# sourceMappingURL=kanso-protocol-row.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kanso-protocol-row.mjs","sources":["../../../../../packages/patterns/row/src/row.component.ts","../../../../../packages/patterns/row/src/kanso-protocol-row.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n Input,\n} from '@angular/core';\n\nexport type KpRowGap =\n | 'none'\n | '2xs'\n | 'xs'\n | 'sm'\n | 'md'\n | 'lg'\n | 'xl'\n | '2xl';\n\nexport type KpRowAlign = 'start' | 'center' | 'end' | 'stretch' | 'baseline';\nexport type KpRowJustify =\n | 'start'\n | 'center'\n | 'end'\n | 'space-between'\n | 'space-around';\n\n/**\n * Kanso Protocol — Row\n *\n * Horizontal Auto Layout wrapper with a preset gap scale, cross-axis\n * alignment, and main-axis justification. Optional wrap on overflow.\n *\n * @example\n * <kp-row gap=\"sm\" justify=\"end\">\n * <kp-button appearance=\"ghost\">Cancel</kp-button>\n * <kp-button>Save</kp-button>\n * </kp-row>\n */\n@Component({\n selector: 'kp-row',\n imports: [],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { '[class]': 'hostClasses' },\n template: `<ng-content/>`,\n styles: [`\n :host {\n display: flex;\n flex-direction: row;\n gap: var(--kp-row-gap, 16px);\n }\n\n :host(.kp-row--gap-none) { --kp-row-gap: 0; }\n :host(.kp-row--gap-2xs) { --kp-row-gap: var(--kp-spacing-2xs, 8px); }\n :host(.kp-row--gap-xs) { --kp-row-gap: var(--kp-spacing-xs, 12px); }\n :host(.kp-row--gap-sm) { --kp-row-gap: var(--kp-spacing-sm, 16px); }\n :host(.kp-row--gap-md) { --kp-row-gap: var(--kp-spacing-md, 20px); }\n :host(.kp-row--gap-lg) { --kp-row-gap: var(--kp-spacing-lg, 24px); }\n :host(.kp-row--gap-xl) { --kp-row-gap: var(--kp-spacing-xl, 32px); }\n :host(.kp-row--gap-2xl) { --kp-row-gap: var(--kp-spacing-2xl, 40px); }\n\n :host(.kp-row--align-start) { align-items: flex-start; }\n :host(.kp-row--align-center) { align-items: center; }\n :host(.kp-row--align-end) { align-items: flex-end; }\n :host(.kp-row--align-stretch) { align-items: stretch; }\n :host(.kp-row--align-baseline) { align-items: baseline; }\n\n :host(.kp-row--justify-start) { justify-content: flex-start; }\n :host(.kp-row--justify-center) { justify-content: center; }\n :host(.kp-row--justify-end) { justify-content: flex-end; }\n :host(.kp-row--justify-space-between) { justify-content: space-between; }\n :host(.kp-row--justify-space-around) { justify-content: space-around; }\n\n :host(.kp-row--wrap) { flex-wrap: wrap; }\n `],\n})\nexport class KpRowComponent {\n @Input() gap: KpRowGap = 'md';\n @Input() align: KpRowAlign = 'center';\n @Input() justify: KpRowJustify = 'start';\n @Input() wrap = false;\n\n get hostClasses(): string {\n const c = [\n 'kp-row',\n `kp-row--gap-${this.gap}`,\n `kp-row--align-${this.align}`,\n `kp-row--justify-${this.justify}`,\n ];\n if (this.wrap) c.push('kp-row--wrap');\n return c.join(' ');\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAwBA;;;;;;;;;;;AAWG;MAsCU,cAAc,CAAA;IAChB,GAAG,GAAa,IAAI;IACpB,KAAK,GAAe,QAAQ;IAC5B,OAAO,GAAiB,OAAO;IAC/B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+ "@angular/core": "^18.0.0",
7
+ "@angular/common": "^18.0.0",
8
+ "@kanso-protocol/core": "^0.0.1"
9
+ },
10
+ "description": "Kanso Protocol — row (pattern).",
11
+ "author": "GregNBlack",
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "https://github.com/GregNBlack/kanso-protocol.git",
15
+ "directory": "packages/patterns/row"
16
+ },
17
+ "homepage": "https://gregnblack.github.io/kanso-protocol/?path=/docs/patterns-row--docs",
18
+ "bugs": "https://github.com/GregNBlack/kanso-protocol/issues",
19
+ "keywords": [
20
+ "design-system",
21
+ "angular",
22
+ "kanso",
23
+ "row"
24
+ ],
25
+ "sideEffects": false,
26
+ "module": "fesm2022/kanso-protocol-row.mjs",
27
+ "typings": "types/kanso-protocol-row.d.ts",
28
+ "exports": {
29
+ "./package.json": {
30
+ "default": "./package.json"
31
+ },
32
+ ".": {
33
+ "types": "./types/kanso-protocol-row.d.ts",
34
+ "default": "./fesm2022/kanso-protocol-row.mjs"
35
+ }
36
+ },
37
+ "type": "module",
38
+ "dependencies": {
39
+ "tslib": "^2.3.0"
40
+ }
41
+ }
@@ -0,0 +1,29 @@
1
+ import * as i0 from '@angular/core';
2
+
3
+ type KpRowGap = 'none' | '2xs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
4
+ type KpRowAlign = 'start' | 'center' | 'end' | 'stretch' | 'baseline';
5
+ type KpRowJustify = 'start' | 'center' | 'end' | 'space-between' | 'space-around';
6
+ /**
7
+ * Kanso Protocol — Row
8
+ *
9
+ * Horizontal Auto Layout wrapper with a preset gap scale, cross-axis
10
+ * alignment, and main-axis justification. Optional wrap on overflow.
11
+ *
12
+ * @example
13
+ * <kp-row gap="sm" justify="end">
14
+ * <kp-button appearance="ghost">Cancel</kp-button>
15
+ * <kp-button>Save</kp-button>
16
+ * </kp-row>
17
+ */
18
+ declare class KpRowComponent {
19
+ gap: KpRowGap;
20
+ align: KpRowAlign;
21
+ justify: KpRowJustify;
22
+ wrap: boolean;
23
+ get hostClasses(): string;
24
+ static ɵfac: i0.ɵɵFactoryDeclaration<KpRowComponent, never>;
25
+ static ɵcmp: i0.ɵɵComponentDeclaration<KpRowComponent, "kp-row", never, { "gap": { "alias": "gap"; "required": false; }; "align": { "alias": "align"; "required": false; }; "justify": { "alias": "justify"; "required": false; }; "wrap": { "alias": "wrap"; "required": false; }; }, {}, never, ["*"], true, never>;
26
+ }
27
+
28
+ export { KpRowComponent };
29
+ export type { KpRowAlign, KpRowGap, KpRowJustify };