@molecule/app-contact-display-angular 0.0.0-stage → 0.0.1-stage
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.
- package/LICENSE +202 -0
- package/README.md +432 -2
- package/dist/contact-display.component.d.ts +181 -0
- package/dist/contact-display.component.d.ts.map +1 -0
- package/dist/contact-display.component.js +446 -0
- package/dist/contact-display.component.js.map +1 -0
- package/dist/index.d.ts +52 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +52 -0
- package/dist/index.js.map +1 -0
- package/dist/types.d.ts +44 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +10 -0
- package/dist/types.js.map +1 -0
- package/package.json +69 -4
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Angular formatted contact display — the counterpart of
|
|
3
|
+
* `@molecule/app-contact-display-react`: the same props and the same DOM for
|
|
4
|
+
* the same input.
|
|
5
|
+
*
|
|
6
|
+
* Exports `<ContactDisplay>` — avatar + name + role + email/phone/address with
|
|
7
|
+
* card/row/compact layouts.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* import { Component } from '@angular/core'
|
|
12
|
+
* import { ContactDisplay } from '@molecule/app-contact-display-angular'
|
|
13
|
+
*
|
|
14
|
+
* @Component({
|
|
15
|
+
* selector: 'app-profile',
|
|
16
|
+
* standalone: true,
|
|
17
|
+
* imports: [ContactDisplay],
|
|
18
|
+
* template: `
|
|
19
|
+
* <div
|
|
20
|
+
* mol-contact-display
|
|
21
|
+
* layout="row"
|
|
22
|
+
* [contact]="{
|
|
23
|
+
* name: 'Jane Smith',
|
|
24
|
+
* email: 'jane@example.com',
|
|
25
|
+
* phone: '+1 555 0100',
|
|
26
|
+
* role: 'Product Designer',
|
|
27
|
+
* company: 'Acme Corp'
|
|
28
|
+
* }"
|
|
29
|
+
* (click)="openProfile('jane')"></div>
|
|
30
|
+
* `,
|
|
31
|
+
* })
|
|
32
|
+
* export class Profile {
|
|
33
|
+
* openProfile(id: string): void {}
|
|
34
|
+
* }
|
|
35
|
+
* ```
|
|
36
|
+
*
|
|
37
|
+
* @remarks
|
|
38
|
+
* `contact` fields are display-only data — `email`/`phone` render as
|
|
39
|
+
* `mailto:`/`tel:` links; there is no formatting/validation. The email/phone/
|
|
40
|
+
* address markers are text glyphs (✉ ☎ ⌂), not themed SVG icons. `role`,
|
|
41
|
+
* `address`, and `company` are node-valued in React: in Angular pass a
|
|
42
|
+
* `TemplateRef` (rendered through the package's `[molContactNode]` outlet) or
|
|
43
|
+
* plain text. The right-side actions are projected as `[slot=actions]`
|
|
44
|
+
* content. When `onClick` is provided the whole row becomes clickable; supply
|
|
45
|
+
* your own keyboard affordance (e.g. wrap in a button/link) for
|
|
46
|
+
* accessibility-critical surfaces.
|
|
47
|
+
*
|
|
48
|
+
* @module
|
|
49
|
+
*/
|
|
50
|
+
export * from './contact-display.component.js';
|
|
51
|
+
export * from './types.js';
|
|
52
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AAEH,cAAc,gCAAgC,CAAA;AAC9C,cAAc,YAAY,CAAA"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Angular formatted contact display — the counterpart of
|
|
3
|
+
* `@molecule/app-contact-display-react`: the same props and the same DOM for
|
|
4
|
+
* the same input.
|
|
5
|
+
*
|
|
6
|
+
* Exports `<ContactDisplay>` — avatar + name + role + email/phone/address with
|
|
7
|
+
* card/row/compact layouts.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* import { Component } from '@angular/core'
|
|
12
|
+
* import { ContactDisplay } from '@molecule/app-contact-display-angular'
|
|
13
|
+
*
|
|
14
|
+
* @Component({
|
|
15
|
+
* selector: 'app-profile',
|
|
16
|
+
* standalone: true,
|
|
17
|
+
* imports: [ContactDisplay],
|
|
18
|
+
* template: `
|
|
19
|
+
* <div
|
|
20
|
+
* mol-contact-display
|
|
21
|
+
* layout="row"
|
|
22
|
+
* [contact]="{
|
|
23
|
+
* name: 'Jane Smith',
|
|
24
|
+
* email: 'jane@example.com',
|
|
25
|
+
* phone: '+1 555 0100',
|
|
26
|
+
* role: 'Product Designer',
|
|
27
|
+
* company: 'Acme Corp'
|
|
28
|
+
* }"
|
|
29
|
+
* (click)="openProfile('jane')"></div>
|
|
30
|
+
* `,
|
|
31
|
+
* })
|
|
32
|
+
* export class Profile {
|
|
33
|
+
* openProfile(id: string): void {}
|
|
34
|
+
* }
|
|
35
|
+
* ```
|
|
36
|
+
*
|
|
37
|
+
* @remarks
|
|
38
|
+
* `contact` fields are display-only data — `email`/`phone` render as
|
|
39
|
+
* `mailto:`/`tel:` links; there is no formatting/validation. The email/phone/
|
|
40
|
+
* address markers are text glyphs (✉ ☎ ⌂), not themed SVG icons. `role`,
|
|
41
|
+
* `address`, and `company` are node-valued in React: in Angular pass a
|
|
42
|
+
* `TemplateRef` (rendered through the package's `[molContactNode]` outlet) or
|
|
43
|
+
* plain text. The right-side actions are projected as `[slot=actions]`
|
|
44
|
+
* content. When `onClick` is provided the whole row becomes clickable; supply
|
|
45
|
+
* your own keyboard affordance (e.g. wrap in a button/link) for
|
|
46
|
+
* accessibility-critical surfaces.
|
|
47
|
+
*
|
|
48
|
+
* @module
|
|
49
|
+
*/
|
|
50
|
+
export * from './contact-display.component.js';
|
|
51
|
+
export * from './types.js';
|
|
52
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AAEH,cAAc,gCAAgC,CAAA;AAC9C,cAAc,YAAY,CAAA"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types for the Angular formatted contact display.
|
|
3
|
+
*
|
|
4
|
+
* The same names `@molecule/app-contact-display-react` exports; node-valued
|
|
5
|
+
* fields arrive as `TemplateRef`s (an input cannot carry a node) or as text.
|
|
6
|
+
*
|
|
7
|
+
* @module
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Fields describing a contact rendered by {@link ContactDisplay}.
|
|
11
|
+
*
|
|
12
|
+
* `role`, `address` and `company` are node-valued in React: pass a
|
|
13
|
+
* `TemplateRef` (the kit's form) or plain text.
|
|
14
|
+
*/
|
|
15
|
+
export interface ContactFields {
|
|
16
|
+
/** Display name. */
|
|
17
|
+
name: string;
|
|
18
|
+
/** Email address, rendered as a `mailto:` link in the card and row layouts. */
|
|
19
|
+
email?: string;
|
|
20
|
+
/** Phone number, rendered as a `tel:` link in the card and row layouts. */
|
|
21
|
+
phone?: string;
|
|
22
|
+
/** Role / title, shown beside the name: a `TemplateRef` or text. */
|
|
23
|
+
role?: unknown;
|
|
24
|
+
/** Avatar image URL; without one the name's initials are shown. */
|
|
25
|
+
avatarSrc?: string;
|
|
26
|
+
/** Postal address, shown under the phone line: a `TemplateRef` or text. */
|
|
27
|
+
address?: unknown;
|
|
28
|
+
/** Company name, shown under the name line: a `TemplateRef` or text. */
|
|
29
|
+
company?: unknown;
|
|
30
|
+
}
|
|
31
|
+
/** Props accepted by the {@link ContactDisplay} component. */
|
|
32
|
+
export interface ContactDisplayProps {
|
|
33
|
+
/** The contact to display. */
|
|
34
|
+
contact: ContactFields;
|
|
35
|
+
/** Layout preset. Defaults to `'card'`. */
|
|
36
|
+
layout?: 'card' | 'row' | 'compact';
|
|
37
|
+
/** Optional right-side actions, projected as `[slot=actions]` content. */
|
|
38
|
+
actions?: unknown;
|
|
39
|
+
/** Click handler on the row, called with the native click event. */
|
|
40
|
+
onClick?: (event: MouseEvent) => void;
|
|
41
|
+
/** Extra classes. */
|
|
42
|
+
className?: string;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC5B,oBAAoB;IACpB,IAAI,EAAE,MAAM,CAAA;IACZ,+EAA+E;IAC/E,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,2EAA2E;IAC3E,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,oEAAoE;IACpE,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,mEAAmE;IACnE,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,2EAA2E;IAC3E,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,wEAAwE;IACxE,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,8DAA8D;AAC9D,MAAM,WAAW,mBAAmB;IAClC,8BAA8B;IAC9B,OAAO,EAAE,aAAa,CAAA;IACtB,2CAA2C;IAC3C,MAAM,CAAC,EAAE,MAAM,GAAG,KAAK,GAAG,SAAS,CAAA;IACnC,0EAA0E;IAC1E,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,oEAAoE;IACpE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAA;IACrC,qBAAqB;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types for the Angular formatted contact display.
|
|
3
|
+
*
|
|
4
|
+
* The same names `@molecule/app-contact-display-react` exports; node-valued
|
|
5
|
+
* fields arrive as `TemplateRef`s (an input cannot carry a node) or as text.
|
|
6
|
+
*
|
|
7
|
+
* @module
|
|
8
|
+
*/
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,71 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@molecule/app-contact-display-angular",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.0.1-stage",
|
|
4
|
+
"description": "Formatted contact display: name + avatar + email/phone with icons + optional address",
|
|
5
|
+
"homepage": "https://www.molecule.dev/packages/app-contact-display-angular",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "dist/index.js",
|
|
8
|
+
"types": "dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist",
|
|
17
|
+
"README.md"
|
|
18
|
+
],
|
|
19
|
+
"scripts": {
|
|
20
|
+
"build": "ngc",
|
|
21
|
+
"dev": "ngc --watch",
|
|
22
|
+
"test": "vitest run",
|
|
23
|
+
"test:watch": "vitest"
|
|
24
|
+
},
|
|
25
|
+
"keywords": [
|
|
26
|
+
"molecule",
|
|
27
|
+
"contact-display",
|
|
28
|
+
"angular"
|
|
29
|
+
],
|
|
30
|
+
"author": "Molecule Dev, Inc. (https://molecule.dev)",
|
|
31
|
+
"license": "Apache-2.0",
|
|
32
|
+
"repository": {
|
|
33
|
+
"type": "git",
|
|
34
|
+
"url": "https://github.com/molecule-dev/molecule.git",
|
|
35
|
+
"directory": "packages/app/features/contact-display-angular"
|
|
36
|
+
},
|
|
37
|
+
"engines": {
|
|
38
|
+
"node": ">=20"
|
|
39
|
+
},
|
|
40
|
+
"bugs": "https://github.com/molecule-dev/molecule/issues",
|
|
41
|
+
"publishConfig": {
|
|
42
|
+
"access": "public"
|
|
43
|
+
},
|
|
44
|
+
"peerDependencies": {
|
|
45
|
+
"@angular/common": "^22.0.0",
|
|
46
|
+
"@angular/core": "^22.0.0",
|
|
47
|
+
"@angular/platform-browser": "^22.0.0",
|
|
48
|
+
"@molecule/app-angular": "^3.5.0",
|
|
49
|
+
"@molecule/app-ui": "^1.0.1",
|
|
50
|
+
"@molecule/app-ui-angular": "^1.1.0"
|
|
51
|
+
},
|
|
52
|
+
"devDependencies": {
|
|
53
|
+
"@angular/common": "22.2.3",
|
|
54
|
+
"@angular/compiler": "22.2.3",
|
|
55
|
+
"@angular/compiler-cli": "22.2.3",
|
|
56
|
+
"@angular/core": "22.2.3",
|
|
57
|
+
"@angular/platform-browser": "22.2.3",
|
|
58
|
+
"@molecule/app-angular": "3.6.0",
|
|
59
|
+
"@molecule/app-framework-conformance": "0.0.0",
|
|
60
|
+
"@molecule/app-i18n": "1.2.1",
|
|
61
|
+
"@molecule/app-icons": "1.0.4",
|
|
62
|
+
"@molecule/app-ui": "1.3.11",
|
|
63
|
+
"@molecule/app-ui-angular": "1.1.2",
|
|
64
|
+
"@types/node": "26.6.5",
|
|
65
|
+
"jsdom": "30.1.3",
|
|
66
|
+
"rxjs": "7.8.2",
|
|
67
|
+
"typescript": "6.0.3",
|
|
68
|
+
"vitest": "4.1.12",
|
|
69
|
+
"zone.js": "0.16.3"
|
|
70
|
+
}
|
|
71
|
+
}
|