@lit-material/dialog 0.0.3 → 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.
package/README.md CHANGED
@@ -80,6 +80,32 @@ dialog.
80
80
  | `cancel` | Yes | On Escape, before the dialog closes. |
81
81
  | `close` | No | After the dialog closes (via `close()`, Escape, backdrop click, or a `method="dialog"` form submit). |
82
82
 
83
+ ## About dialog
84
+
85
+ `lit-material-about-dialog` is what a Help → About menu item opens: the product's name and logo,
86
+ version and build details, and legal lines, with a Close button. It also depends on
87
+ `@lit-material/button`.
88
+
89
+ ```html
90
+ <lit-material-about-dialog product-name="Acme Console">
91
+ <img slot="logo" src="logo.svg" alt="" />
92
+ <dl>
93
+ <dt>Version</dt><dd>2.4.1</dd>
94
+ <dt>Build</dt><dd>2026-11-01 · 03c3708</dd>
95
+ </dl>
96
+ <span slot="legal">© 2026 Acme. MIT license.</span>
97
+ </lit-material-about-dialog>
98
+ ```
99
+
100
+ | Property | Attribute | Type | Default |
101
+ | ------------- | -------------- | --------- | --------- |
102
+ | `productName` | `product-name` | `string` (the heading) | `""` |
103
+ | `open` | `open` (reflected) | `boolean` | `false` |
104
+ | `closeLabel` | `close-label` | `string` | `"Close"` |
105
+
106
+ `show()` and `close()` open and close it; `close` fires after it closes (Close, Escape or a click
107
+ outside). Slots: `logo`, default (details), `legal`.
108
+
83
109
  ## License
84
110
 
85
111
  MIT
@@ -2,6 +2,141 @@
2
2
  "schemaVersion": "1.0.0",
3
3
  "readme": "",
4
4
  "modules": [
5
+ {
6
+ "kind": "javascript-module",
7
+ "path": "src/about-dialog.ts",
8
+ "declarations": [
9
+ {
10
+ "kind": "class",
11
+ "description": "An \"About\" dialog: the product's name and logo, its version and build\ndetails, and the legal lines — what a Help → About menu item opens.\n\nPut the details in the default slot (a `<dl>` of Version, Build, Server\nand so on, or a `lit-material-description-list`), the logo in `logo` and\ncopyright and trademark text in `legal`. A Close button closes it, as do\nEscape and a click outside.",
12
+ "name": "LitMaterialAboutDialog",
13
+ "slots": [
14
+ {
15
+ "description": "The product's logo, shown above its name.",
16
+ "name": "logo"
17
+ },
18
+ {
19
+ "description": "Version and build details.",
20
+ "name": ""
21
+ },
22
+ {
23
+ "description": "Copyright, trademark and license lines, in small print.",
24
+ "name": "legal"
25
+ }
26
+ ],
27
+ "members": [
28
+ {
29
+ "kind": "field",
30
+ "name": "productName",
31
+ "type": {
32
+ "text": "string"
33
+ },
34
+ "default": "\"\"",
35
+ "description": "The product's name: the dialog's heading.",
36
+ "attribute": "product-name"
37
+ },
38
+ {
39
+ "kind": "field",
40
+ "name": "open",
41
+ "type": {
42
+ "text": "boolean"
43
+ },
44
+ "default": "false",
45
+ "attribute": "open",
46
+ "reflects": true
47
+ },
48
+ {
49
+ "kind": "field",
50
+ "name": "closeLabel",
51
+ "type": {
52
+ "text": "string"
53
+ },
54
+ "default": "\"Close\"",
55
+ "description": "The close button's text.",
56
+ "attribute": "close-label"
57
+ },
58
+ {
59
+ "kind": "method",
60
+ "name": "show",
61
+ "return": {
62
+ "type": {
63
+ "text": "void"
64
+ }
65
+ },
66
+ "description": "Opens the dialog."
67
+ },
68
+ {
69
+ "kind": "method",
70
+ "name": "close",
71
+ "return": {
72
+ "type": {
73
+ "text": "void"
74
+ }
75
+ },
76
+ "description": "Closes the dialog."
77
+ }
78
+ ],
79
+ "events": [
80
+ {
81
+ "description": "After the dialog has closed.",
82
+ "name": "close"
83
+ }
84
+ ],
85
+ "attributes": [
86
+ {
87
+ "name": "product-name",
88
+ "type": {
89
+ "text": "string"
90
+ },
91
+ "default": "\"\"",
92
+ "description": "The product's name: the dialog's heading.",
93
+ "fieldName": "productName"
94
+ },
95
+ {
96
+ "name": "open",
97
+ "type": {
98
+ "text": "boolean"
99
+ },
100
+ "default": "false",
101
+ "fieldName": "open"
102
+ },
103
+ {
104
+ "name": "close-label",
105
+ "type": {
106
+ "text": "string"
107
+ },
108
+ "default": "\"Close\"",
109
+ "description": "The close button's text.",
110
+ "fieldName": "closeLabel"
111
+ }
112
+ ],
113
+ "superclass": {
114
+ "name": "LitElement",
115
+ "package": "lit"
116
+ },
117
+ "tagName": "lit-material-about-dialog",
118
+ "customElement": true
119
+ }
120
+ ],
121
+ "exports": [
122
+ {
123
+ "kind": "js",
124
+ "name": "LitMaterialAboutDialog",
125
+ "declaration": {
126
+ "name": "LitMaterialAboutDialog",
127
+ "module": "src/about-dialog.ts"
128
+ }
129
+ },
130
+ {
131
+ "kind": "custom-element-definition",
132
+ "name": "lit-material-about-dialog",
133
+ "declaration": {
134
+ "name": "LitMaterialAboutDialog",
135
+ "module": "src/about-dialog.ts"
136
+ }
137
+ }
138
+ ]
139
+ },
5
140
  {
6
141
  "kind": "javascript-module",
7
142
  "path": "src/dialog-styles.ts",
@@ -257,6 +392,14 @@
257
392
  "name": "LitMaterialDialog",
258
393
  "module": "./dialog.js"
259
394
  }
395
+ },
396
+ {
397
+ "kind": "js",
398
+ "name": "LitMaterialAboutDialog",
399
+ "declaration": {
400
+ "name": "LitMaterialAboutDialog",
401
+ "module": "./about-dialog.js"
402
+ }
260
403
  }
261
404
  ]
262
405
  }
@@ -0,0 +1,39 @@
1
+ import { LitElement } from "lit";
2
+ import "@lit-material/button";
3
+ import "./dialog.js";
4
+ /**
5
+ * An "About" dialog: the product's name and logo, its version and build
6
+ * details, and the legal lines — what a Help → About menu item opens.
7
+ *
8
+ * Put the details in the default slot (a `<dl>` of Version, Build, Server
9
+ * and so on, or a `lit-material-description-list`), the logo in `logo` and
10
+ * copyright and trademark text in `legal`. A Close button closes it, as do
11
+ * Escape and a click outside.
12
+ *
13
+ * @element lit-material-about-dialog
14
+ *
15
+ * @slot logo - The product's logo, shown above its name.
16
+ * @slot - Version and build details.
17
+ * @slot legal - Copyright, trademark and license lines, in small print.
18
+ *
19
+ * @fires close - After the dialog has closed.
20
+ */
21
+ export declare class LitMaterialAboutDialog extends LitElement {
22
+ static styles: import("lit").CSSResult;
23
+ /** The product's name: the dialog's heading. */
24
+ productName: string;
25
+ open: boolean;
26
+ /** The close button's text. */
27
+ closeLabel: string;
28
+ /** Opens the dialog. */
29
+ show(): void;
30
+ /** Closes the dialog. */
31
+ close(): void;
32
+ render(): import("lit").TemplateResult<1>;
33
+ }
34
+ declare global {
35
+ interface HTMLElementTagNameMap {
36
+ "lit-material-about-dialog": LitMaterialAboutDialog;
37
+ }
38
+ }
39
+ //# sourceMappingURL=about-dialog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"about-dialog.d.ts","sourceRoot":"","sources":["../src/about-dialog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,UAAU,EAAE,MAAM,KAAK,CAAC;AAE5C,OAAO,sBAAsB,CAAC;AAC9B,OAAO,aAAa,CAAC;AAErB;;;;;;;;;;;;;;;;GAgBG;AACH,qBACa,sBAAuB,SAAQ,UAAU;IACpD,OAAgB,MAAM,0BAuBpB;IAEF,gDAAgD;IACP,WAAW,SAAM;IAEd,IAAI,UAAS;IAEzD,+BAA+B;IACS,UAAU,SAAW;IAE7D,wBAAwB;IACxB,IAAI,IAAI,IAAI;IAIZ,yBAAyB;IACzB,KAAK,IAAI,IAAI;IAIJ,MAAM;CAUhB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,2BAA2B,EAAE,sBAAsB,CAAC;KACrD;CACF"}
@@ -0,0 +1,93 @@
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 { css, html, LitElement } from "lit";
8
+ import { customElement, property } from "lit/decorators.js";
9
+ import "@lit-material/button";
10
+ import "./dialog.js";
11
+ /**
12
+ * An "About" dialog: the product's name and logo, its version and build
13
+ * details, and the legal lines — what a Help → About menu item opens.
14
+ *
15
+ * Put the details in the default slot (a `<dl>` of Version, Build, Server
16
+ * and so on, or a `lit-material-description-list`), the logo in `logo` and
17
+ * copyright and trademark text in `legal`. A Close button closes it, as do
18
+ * Escape and a click outside.
19
+ *
20
+ * @element lit-material-about-dialog
21
+ *
22
+ * @slot logo - The product's logo, shown above its name.
23
+ * @slot - Version and build details.
24
+ * @slot legal - Copyright, trademark and license lines, in small print.
25
+ *
26
+ * @fires close - After the dialog has closed.
27
+ */
28
+ let LitMaterialAboutDialog = class LitMaterialAboutDialog extends LitElement {
29
+ constructor() {
30
+ super(...arguments);
31
+ /** The product's name: the dialog's heading. */
32
+ this.productName = "";
33
+ this.open = false;
34
+ /** The close button's text. */
35
+ this.closeLabel = "Close";
36
+ }
37
+ static { this.styles = css `
38
+ :host {
39
+ display: contents;
40
+ }
41
+ .logo::slotted(*) {
42
+ display: block;
43
+ max-width: 100%;
44
+ max-height: 64px;
45
+ margin-block-end: 8px;
46
+ }
47
+ .name {
48
+ text-align: start;
49
+ }
50
+ .details {
51
+ color: var(--md-sys-color-on-surface, light-dark(#1d1b20, #e6e0e9));
52
+ }
53
+ .legal {
54
+ display: block;
55
+ margin-block-start: 16px;
56
+ color: var(--md-sys-color-on-surface-variant, light-dark(#49454f, #cac4d0));
57
+ font-size: var(--md-sys-typescale-body-small-size, 0.75rem);
58
+ line-height: var(--md-sys-typescale-body-small-line-height, 1rem);
59
+ }
60
+ `; }
61
+ /** Opens the dialog. */
62
+ show() {
63
+ this.open = true;
64
+ }
65
+ /** Closes the dialog. */
66
+ close() {
67
+ this.open = false;
68
+ }
69
+ render() {
70
+ // The inner dialog's `close` is composed, so it already reaches listeners
71
+ // on this element; only the state needs following.
72
+ return html `<lit-material-dialog .open=${this.open} @close=${() => (this.open = false)}>
73
+ <span slot="headline" class="name"><slot name="logo" class="logo"></slot>${this.productName}</span>
74
+ <div class="details"><slot></slot></div>
75
+ <slot name="legal" class="legal"></slot>
76
+ <lit-material-button slot="actions" variant="text" @click=${() => this.close()}>${this.closeLabel}</lit-material-button>
77
+ </lit-material-dialog>`;
78
+ }
79
+ };
80
+ __decorate([
81
+ property({ attribute: "product-name" })
82
+ ], LitMaterialAboutDialog.prototype, "productName", void 0);
83
+ __decorate([
84
+ property({ type: Boolean, reflect: true })
85
+ ], LitMaterialAboutDialog.prototype, "open", void 0);
86
+ __decorate([
87
+ property({ attribute: "close-label" })
88
+ ], LitMaterialAboutDialog.prototype, "closeLabel", void 0);
89
+ LitMaterialAboutDialog = __decorate([
90
+ customElement("lit-material-about-dialog")
91
+ ], LitMaterialAboutDialog);
92
+ export { LitMaterialAboutDialog };
93
+ //# sourceMappingURL=about-dialog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"about-dialog.js","sourceRoot":"","sources":["../src/about-dialog.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,sBAAsB,CAAC;AAC9B,OAAO,aAAa,CAAC;AAErB;;;;;;;;;;;;;;;;GAgBG;AAEI,IAAM,sBAAsB,GAA5B,MAAM,sBAAuB,SAAQ,UAAU;IAA/C;;QA0BL,gDAAgD;QACP,gBAAW,GAAG,EAAE,CAAC;QAEd,SAAI,GAAG,KAAK,CAAC;QAEzD,+BAA+B;QACS,eAAU,GAAG,OAAO,CAAC;IAsB/D,CAAC;aArDiB,WAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;GAuB3B,AAvBqB,CAuBpB;IAUF,wBAAwB;IACxB,IAAI;QACF,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,yBAAyB;IACzB,KAAK;QACH,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC;IACpB,CAAC;IAEQ,MAAM;QACb,0EAA0E;QAC1E,mDAAmD;QACnD,OAAO,IAAI,CAAA,8BAA8B,IAAI,CAAC,IAAI,WAAW,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC;iFACT,IAAI,CAAC,WAAW;;;kEAG/B,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,IAAI,CAAC,UAAU;2BAC5E,CAAC;IAC1B,CAAC;;AA1BwC;IAAxC,QAAQ,CAAC,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC;2DAAkB;AAEd;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;oDAAc;AAGjB;IAAvC,QAAQ,CAAC,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC;0DAAsB;AAhClD,sBAAsB;IADlC,aAAa,CAAC,2BAA2B,CAAC;GAC9B,sBAAsB,CAsDlC"}
package/dist/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export { LitMaterialDialog } from "./dialog.js";
2
+ export { LitMaterialAboutDialog } from "./about-dialog.js";
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC"}
package/dist/index.js CHANGED
@@ -1,2 +1,3 @@
1
1
  export { LitMaterialDialog } from "./dialog.js";
2
+ export { LitMaterialAboutDialog } from "./about-dialog.js";
2
3
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lit-material/dialog",
3
- "version": "0.0.3",
3
+ "version": "0.1.0",
4
4
  "description": "Material Design 3 dialog web component, built on the native <dialog> element.",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -42,7 +42,8 @@
42
42
  },
43
43
  "dependencies": {
44
44
  "lit": "^3.2.0",
45
- "@lit-material/tokens": "0.0.1"
45
+ "@lit-material/button": "0.2.0",
46
+ "@lit-material/tokens": "0.0.2"
46
47
  },
47
48
  "devDependencies": {
48
49
  "@lit-labs/ssr": "^3.3.1",