@lamenna/lxp-angular 0.0.2 → 0.0.5

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,10 @@
1
+ /**
2
+ * Button options tests - Angular package
3
+ *
4
+ * These tests validate that the Angular package can consume the
5
+ * shared button configuration. They purposefully avoid importing
6
+ * Angular runtime/testing utilities so they work in a plain Jest
7
+ * environment without extra Angular Jest presets.
8
+ */
9
+ export {};
10
+ //# sourceMappingURL=button-options.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"button-options.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/button-options.test.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Button options tests - Angular package
3
+ *
4
+ * These tests validate that the Angular package can consume the
5
+ * shared button configuration. They purposefully avoid importing
6
+ * Angular runtime/testing utilities so they work in a plain Jest
7
+ * environment without extra Angular Jest presets.
8
+ */
9
+ import { buttonConfig } from "@lamenna/lxp-shared-components";
10
+ describe("Button options (Angular)", () => {
11
+ it("should expose primary and secondary variants", () => {
12
+ expect(buttonConfig.variants.primary).toBeDefined();
13
+ expect(buttonConfig.variants.secondary).toBeDefined();
14
+ });
15
+ it("should expose standard sizes", () => {
16
+ expect(buttonConfig.sizes.sm).toBeDefined();
17
+ expect(buttonConfig.sizes.md).toBeDefined();
18
+ expect(buttonConfig.sizes.lg).toBeDefined();
19
+ });
20
+ it("should have common button styles configured", () => {
21
+ expect(buttonConfig.common.borderRadius).toBeDefined();
22
+ expect(buttonConfig.common.cursor).toBe("pointer");
23
+ });
24
+ });
25
+ //# sourceMappingURL=button-options.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"button-options.test.js","sourceRoot":"","sources":["../../src/__tests__/button-options.test.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAE9D,QAAQ,CAAC,0BAA0B,EAAE,GAAG,EAAE;IACxC,EAAE,CAAC,8CAA8C,EAAE,GAAG,EAAE;QACtD,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE,CAAC;QACpD,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,WAAW,EAAE,CAAC;IACxD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,8BAA8B,EAAE,GAAG,EAAE;QACtC,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;QAC5C,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;QAC5C,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;IAC9C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,6CAA6C,EAAE,GAAG,EAAE;QACrD,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,WAAW,EAAE,CAAC;QACvD,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACrD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,109 @@
1
+ import { EventEmitter } from "@angular/core";
2
+ import { AngularButtonProps, ButtonVariant, ButtonSize } from "@lamenna/lxp-shared-components";
3
+ export declare class ButtonComponent implements AngularButtonProps {
4
+ content?: string;
5
+ variant: ButtonVariant;
6
+ size: ButtonSize;
7
+ disabled: boolean;
8
+ className?: string;
9
+ id?: string;
10
+ ariaLabel?: string;
11
+ testID?: string;
12
+ label?: string;
13
+ onClick: EventEmitter<MouseEvent>;
14
+ get hostStyles(): {
15
+ opacity: string;
16
+ pointerEvents: string;
17
+ padding: `${string} ${string}`;
18
+ fontSize: "12px";
19
+ height: "28px";
20
+ backgroundColor: string;
21
+ color: "white";
22
+ borderColor: "transparent";
23
+ borderRadius: string;
24
+ border: "none";
25
+ fontWeight: 500;
26
+ cursor: "pointer";
27
+ transition: "opacity 0.2s";
28
+ activeOpacity: 0.7;
29
+ } | {
30
+ opacity: string;
31
+ pointerEvents: string;
32
+ padding: `${string} ${string}`;
33
+ fontSize: "14px";
34
+ height: "36px";
35
+ backgroundColor: string;
36
+ color: "white";
37
+ borderColor: "transparent";
38
+ borderRadius: string;
39
+ border: "none";
40
+ fontWeight: 500;
41
+ cursor: "pointer";
42
+ transition: "opacity 0.2s";
43
+ activeOpacity: 0.7;
44
+ } | {
45
+ opacity: string;
46
+ pointerEvents: string;
47
+ padding: `${string} ${string}`;
48
+ fontSize: "16px";
49
+ height: "44px";
50
+ backgroundColor: string;
51
+ color: "white";
52
+ borderColor: "transparent";
53
+ borderRadius: string;
54
+ border: "none";
55
+ fontWeight: 500;
56
+ cursor: "pointer";
57
+ transition: "opacity 0.2s";
58
+ activeOpacity: 0.7;
59
+ } | {
60
+ opacity: string;
61
+ pointerEvents: string;
62
+ padding: `${string} ${string}`;
63
+ fontSize: "12px";
64
+ height: "28px";
65
+ backgroundColor: string;
66
+ color: "white";
67
+ borderColor: "transparent";
68
+ borderRadius: string;
69
+ border: "none";
70
+ fontWeight: 500;
71
+ cursor: "pointer";
72
+ transition: "opacity 0.2s";
73
+ activeOpacity: 0.7;
74
+ } | {
75
+ opacity: string;
76
+ pointerEvents: string;
77
+ padding: `${string} ${string}`;
78
+ fontSize: "14px";
79
+ height: "36px";
80
+ backgroundColor: string;
81
+ color: "white";
82
+ borderColor: "transparent";
83
+ borderRadius: string;
84
+ border: "none";
85
+ fontWeight: 500;
86
+ cursor: "pointer";
87
+ transition: "opacity 0.2s";
88
+ activeOpacity: 0.7;
89
+ } | {
90
+ opacity: string;
91
+ pointerEvents: string;
92
+ padding: `${string} ${string}`;
93
+ fontSize: "16px";
94
+ height: "44px";
95
+ backgroundColor: string;
96
+ color: "white";
97
+ borderColor: "transparent";
98
+ borderRadius: string;
99
+ border: "none";
100
+ fontWeight: 500;
101
+ cursor: "pointer";
102
+ transition: "opacity 0.2s";
103
+ activeOpacity: 0.7;
104
+ };
105
+ get buttonClasses(): {
106
+ [x: string]: boolean;
107
+ };
108
+ }
109
+ //# sourceMappingURL=button.component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"button.component.d.ts","sourceRoot":"","sources":["../../../src/components/button/button.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,YAAY,EAEb,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,kBAAkB,EAClB,aAAa,EACb,UAAU,EAEX,MAAM,gCAAgC,CAAC;AAExC,qBAgBa,eAAgB,YAAW,kBAAkB;IAC/C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,aAAa,CAAa;IACnC,IAAI,EAAE,UAAU,CAAQ;IACxB,QAAQ,EAAE,OAAO,CAAS;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IAEd,OAAO,2BAAkC;IAEnD,IAA0B,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAUnC;IAED,IAAI,aAAa;;MAIhB;CACF"}
@@ -0,0 +1,85 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { Component, Input, Output, EventEmitter, HostBinding, } from "@angular/core";
8
+ import { buttonConfig, } from "@lamenna/lxp-shared-components";
9
+ let ButtonComponent = class ButtonComponent {
10
+ constructor() {
11
+ this.variant = "primary";
12
+ this.size = "md";
13
+ this.disabled = false;
14
+ this.onClick = new EventEmitter();
15
+ }
16
+ get hostStyles() {
17
+ const variantConfig = buttonConfig.variants[this.variant];
18
+ const sizeConfig = buttonConfig.sizes[this.size];
19
+ return {
20
+ ...buttonConfig.common,
21
+ ...variantConfig,
22
+ ...sizeConfig,
23
+ opacity: this.disabled ? "0.6" : "1",
24
+ pointerEvents: this.disabled ? "none" : "auto",
25
+ };
26
+ }
27
+ get buttonClasses() {
28
+ return {
29
+ [this.className || ""]: !!this.className,
30
+ };
31
+ }
32
+ };
33
+ __decorate([
34
+ Input()
35
+ ], ButtonComponent.prototype, "content", void 0);
36
+ __decorate([
37
+ Input()
38
+ ], ButtonComponent.prototype, "variant", void 0);
39
+ __decorate([
40
+ Input()
41
+ ], ButtonComponent.prototype, "size", void 0);
42
+ __decorate([
43
+ Input()
44
+ ], ButtonComponent.prototype, "disabled", void 0);
45
+ __decorate([
46
+ Input()
47
+ ], ButtonComponent.prototype, "className", void 0);
48
+ __decorate([
49
+ Input()
50
+ ], ButtonComponent.prototype, "id", void 0);
51
+ __decorate([
52
+ Input()
53
+ ], ButtonComponent.prototype, "ariaLabel", void 0);
54
+ __decorate([
55
+ Input()
56
+ ], ButtonComponent.prototype, "testID", void 0);
57
+ __decorate([
58
+ Input()
59
+ ], ButtonComponent.prototype, "label", void 0);
60
+ __decorate([
61
+ Output()
62
+ ], ButtonComponent.prototype, "onClick", void 0);
63
+ __decorate([
64
+ HostBinding("style")
65
+ ], ButtonComponent.prototype, "hostStyles", null);
66
+ ButtonComponent = __decorate([
67
+ Component({
68
+ selector: "lxp-button",
69
+ template: `
70
+ <button
71
+ [attr.id]="id"
72
+ [attr.data-testid]="testID"
73
+ [attr.aria-label]="ariaLabel"
74
+ [disabled]="disabled"
75
+ (click)="onClick.emit($event)"
76
+ [ngClass]="buttonClasses"
77
+ >
78
+ {{ content }}
79
+ </button>
80
+ `,
81
+ standalone: true,
82
+ })
83
+ ], ButtonComponent);
84
+ export { ButtonComponent };
85
+ //# sourceMappingURL=button.component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"button.component.js","sourceRoot":"","sources":["../../../src/components/button/button.component.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL,SAAS,EACT,KAAK,EACL,MAAM,EACN,YAAY,EACZ,WAAW,GACZ,MAAM,eAAe,CAAC;AACvB,OAAO,EAIL,YAAY,GACb,MAAM,gCAAgC,CAAC;AAkBjC,IAAM,eAAe,GAArB,MAAM,eAAe;IAArB;QAEI,YAAO,GAAkB,SAAS,CAAC;QACnC,SAAI,GAAe,IAAI,CAAC;QACxB,aAAQ,GAAY,KAAK,CAAC;QAOzB,YAAO,GAAG,IAAI,YAAY,EAAc,CAAC;IAmBrD,CAAC;IAjBuB,IAAI,UAAU;QAClC,MAAM,aAAa,GAAG,YAAY,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC1D,MAAM,UAAU,GAAG,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACjD,OAAO;YACL,GAAG,YAAY,CAAC,MAAM;YACtB,GAAG,aAAa;YAChB,GAAG,UAAU;YACb,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG;YACpC,aAAa,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM;SAC/C,CAAC;IACJ,CAAC;IAED,IAAI,aAAa;QACf,OAAO;YACL,CAAC,IAAI,CAAC,SAAS,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,SAAS;SACzC,CAAC;IACJ,CAAC;CACF,CAAA;AA7BU;IAAR,KAAK,EAAE;gDAAkB;AACjB;IAAR,KAAK,EAAE;gDAAoC;AACnC;IAAR,KAAK,EAAE;6CAAyB;AACxB;IAAR,KAAK,EAAE;iDAA2B;AAC1B;IAAR,KAAK,EAAE;kDAAoB;AACnB;IAAR,KAAK,EAAE;2CAAa;AACZ;IAAR,KAAK,EAAE;kDAAoB;AACnB;IAAR,KAAK,EAAE;+CAAiB;AAChB;IAAR,KAAK,EAAE;8CAAgB;AAEd;IAAT,MAAM,EAAE;gDAA0C;AAE7B;IAArB,WAAW,CAAC,OAAO,CAAC;iDAUpB;AAvBU,eAAe;IAhB3B,SAAS,CAAC;QACT,QAAQ,EAAE,YAAY;QACtB,QAAQ,EAAE;;;;;;;;;;;GAWT;QACD,UAAU,EAAE,IAAI;KACjB,CAAC;GACW,eAAe,CA8B3B"}
@@ -0,0 +1,2 @@
1
+ export { ButtonComponent } from "./button.component";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/button/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC"}
@@ -1 +1,2 @@
1
1
  export { ButtonComponent } from "./button.component";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/button/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from "./components/button";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ export * from "./components/button";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC"}
package/package.json CHANGED
@@ -1,24 +1,32 @@
1
1
  {
2
2
  "name": "@lamenna/lxp-angular",
3
- "version": "0.0.2",
3
+ "version": "0.0.5",
4
4
  "description": "Angular components for LXP",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "files": [
8
+ "dist"
9
+ ],
5
10
  "publishConfig": {
6
11
  "access": "public"
7
12
  },
8
13
  "peerDependencies": {
9
- "@angular/common": "^17.0.0",
10
- "@angular/core": "^17.0.0"
14
+ "@angular/common": "^21.0.0",
15
+ "@angular/core": "^21.0.0"
11
16
  },
12
17
  "dependencies": {
13
18
  "@lamenna/lxp-tokens": "0.0.2",
14
19
  "@lamenna/lxp-shared-components": "0.0.2"
15
20
  },
21
+ "devDependencies": {
22
+ "typescript": "^5.3.3"
23
+ },
16
24
  "scripts": {
17
- "build": "echo 'Angular build will be configured later'",
18
- "dev": "echo 'Angular dev mode'",
19
- "test": "jest",
20
- "test:watch": "jest --watch",
21
- "test:coverage": "jest --coverage",
25
+ "build": "tsc",
26
+ "dev": "tsc --watch",
27
+ "test": "jest --passWithNoTests",
28
+ "test:watch": "jest --watch --passWithNoTests",
29
+ "test:coverage": "jest --coverage --passWithNoTests",
22
30
  "clean": "rm -rf dist"
23
31
  }
24
32
  }
@@ -1,5 +0,0 @@
1
-
2
- > @lamenna/lxp-angular@0.0.2 build /home/runner/work/lxp/lxp/packages/angular
3
- > echo 'Angular build will be configured later'
4
-
5
- Angular build will be configured later
package/jest.config.js DELETED
@@ -1,22 +0,0 @@
1
- /**
2
- * Jest Configuration for @lamenna/lxp-angular
3
- */
4
-
5
- module.exports = {
6
- displayName: '@lamenna/lxp-angular',
7
- testEnvironment: 'jsdom',
8
- preset: 'ts-jest',
9
- rootDir: '.',
10
- testMatch: ['<rootDir>/src/**/__tests__/**/*.test.ts', '<rootDir>/src/**/*.test.ts'],
11
- moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
12
- setupFilesAfterEnv: ['<rootDir>/jest.setup.ts'],
13
- collectCoverageFrom: [
14
- 'src/**/*.{ts,tsx}',
15
- '!src/**/*.d.ts',
16
- '!src/index.ts',
17
- ],
18
- coveragePathIgnorePatterns: [
19
- '/node_modules/',
20
- '/dist/',
21
- ],
22
- };
package/jest.setup.ts DELETED
@@ -1,5 +0,0 @@
1
- /**
2
- * Jest Setup for Angular Testing
3
- */
4
-
5
- // Angular testing setup can go here
@@ -1,61 +0,0 @@
1
- import {
2
- Component,
3
- Input,
4
- Output,
5
- EventEmitter,
6
- HostBinding,
7
- } from "@angular/core";
8
- import {
9
- AngularButtonProps,
10
- ButtonVariant,
11
- ButtonSize,
12
- buttonConfig,
13
- } from "@lamenna/lxp-shared-components";
14
-
15
- @Component({
16
- selector: "lxp-button",
17
- template: `
18
- <button
19
- [attr.id]="id"
20
- [attr.data-testid]="testID"
21
- [attr.aria-label]="ariaLabel"
22
- [disabled]="disabled"
23
- (click)="onClick.emit($event)"
24
- [ngClass]="buttonClasses"
25
- >
26
- {{ content }}
27
- </button>
28
- `,
29
- standalone: true,
30
- })
31
- export class ButtonComponent implements AngularButtonProps {
32
- @Input() content?: string;
33
- @Input() variant: ButtonVariant = "primary";
34
- @Input() size: ButtonSize = "md";
35
- @Input() disabled: boolean = false;
36
- @Input() className?: string;
37
- @Input() id?: string;
38
- @Input() ariaLabel?: string;
39
- @Input() testID?: string;
40
- @Input() label?: string;
41
-
42
- @Output() onClick = new EventEmitter<MouseEvent>();
43
-
44
- @HostBinding("style") get hostStyles() {
45
- const variantConfig = buttonConfig.variants[this.variant];
46
- const sizeConfig = buttonConfig.sizes[this.size];
47
- return {
48
- ...buttonConfig.common,
49
- ...variantConfig,
50
- ...sizeConfig,
51
- opacity: this.disabled ? "0.6" : "1",
52
- pointerEvents: this.disabled ? "none" : "auto",
53
- };
54
- }
55
-
56
- get buttonClasses() {
57
- return {
58
- [this.className || ""]: !!this.className,
59
- };
60
- }
61
- }
package/src/index.ts DELETED
@@ -1 +0,0 @@
1
- export * from "./button/button.component";