@lit-material/dialog 0.0.1

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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 bohdaq
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,85 @@
1
+ # @lit-material/dialog
2
+
3
+ A Material Design 3 (basic) dialog web component built with [Lit](https://lit.dev/) on top of the
4
+ native `<dialog>` element. Part of [lit-material](https://github.com/bohdaq/lit-material).
5
+
6
+ ![lit-material dialog, open: icon, headline, supporting text, and cancel/delete actions](./screenshot.png)
7
+
8
+ ## Install
9
+
10
+ ```sh
11
+ npm install @lit-material/dialog @lit-material/tokens
12
+ ```
13
+
14
+ ## Usage
15
+
16
+ ```html
17
+ <link rel="stylesheet" href="node_modules/@lit-material/tokens/css/index.css" />
18
+ <script type="module">
19
+ import "@lit-material/dialog";
20
+ </script>
21
+
22
+ <lit-material-dialog id="confirm-delete">
23
+ <span slot="headline">Delete file?</span>
24
+ This can't be undone.
25
+ <div slot="actions">
26
+ <!-- A method="dialog" submit closes the dialog natively and sets returnValue — no JS needed. -->
27
+ <form method="dialog">
28
+ <button value="cancel">Cancel</button>
29
+ <button value="delete">Delete</button>
30
+ </form>
31
+ </div>
32
+ </lit-material-dialog>
33
+
34
+ <script type="module">
35
+ const dialog = document.getElementById("confirm-delete");
36
+ dialog.addEventListener("close", () => console.log(dialog.returnValue));
37
+ </script>
38
+ ```
39
+
40
+ Or drive it imperatively:
41
+
42
+ ```js
43
+ dialog.show(); // same as dialog.open = true
44
+ dialog.close("cancel"); // same as dialog.open = false, plus sets returnValue
45
+ ```
46
+
47
+ ## API
48
+
49
+ | Property | Attribute | Type | Default |
50
+ | ----------------------- | ------------------------- | --------- | ------- |
51
+ | `open` | `open` | `boolean` | `false` |
52
+ | `disableBackdropClose` | `disable-backdrop-close` | `boolean` | `false` |
53
+
54
+ | Method | Description |
55
+ | ------------------------------ | ---------------------------------------------------------- |
56
+ | `show()` | Opens the dialog (`open = true`). |
57
+ | `close(returnValue?)` | Closes the dialog (`open = false`), optionally setting `returnValue`. |
58
+
59
+ `returnValue` (getter) reflects the underlying `<dialog>`'s `returnValue`, set via `close()` or a
60
+ `method="dialog"` form submission.
61
+
62
+ Slots: `icon` (optional, centered above the headline), `headline` (title), default (body content),
63
+ `actions` (buttons, right-aligned).
64
+
65
+ Built on the native `<dialog>` element, so focus trapping, initial focus, top-layer stacking, and
66
+ Escape-to-close all come from the browser. Clicking the backdrop closes the dialog unless
67
+ `disable-backdrop-close` is set. `cancel` (fired on Escape, before `close`) is cancelable — call
68
+ `event.preventDefault()` on it to keep the dialog open.
69
+
70
+ By default, opening the dialog focuses the dialog itself rather than the first action button —
71
+ without this, the browser's own auto-focus behavior would land on (and show a focus ring around)
72
+ whichever slotted action happens to come first, on every open, regardless of which one you'd
73
+ actually want focused. To focus a specific action instead, call `.focus()` on it after opening the
74
+ dialog.
75
+
76
+ ## Events
77
+
78
+ | Event | Cancelable | Fires |
79
+ | -------- | ---------- | ---------------------------------------------------------------- |
80
+ | `cancel` | Yes | On Escape, before the dialog closes. |
81
+ | `close` | No | After the dialog closes (via `close()`, Escape, backdrop click, or a `method="dialog"` form submit). |
82
+
83
+ ## License
84
+
85
+ MIT
@@ -0,0 +1,2 @@
1
+ export declare const styles: import("lit").CSSResult;
2
+ //# sourceMappingURL=dialog-styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dialog-styles.d.ts","sourceRoot":"","sources":["../src/dialog-styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,yBAgGlB,CAAC"}
@@ -0,0 +1,99 @@
1
+ import { css } from "lit";
2
+ export const styles = css `
3
+ :host {
4
+ display: contents;
5
+ }
6
+
7
+ /* The dialog element itself is transparent and fills the viewport (rather
8
+ than shrink-wrapping the visible card) so a click landing outside
9
+ .container still has its event target equal to the dialog element —
10
+ that's what lets the backdrop-click handler use a simple equality check
11
+ instead of manual hit-testing against the card's bounding box. */
12
+ .dialog {
13
+ margin: 0;
14
+ padding: 0;
15
+ border: none;
16
+ width: 100%;
17
+ height: 100%;
18
+ max-width: 100%;
19
+ max-height: 100%;
20
+ background: transparent;
21
+ color: inherit;
22
+ }
23
+
24
+ .dialog[open] {
25
+ display: flex;
26
+ align-items: center;
27
+ justify-content: center;
28
+ }
29
+
30
+ .dialog::backdrop {
31
+ background-color: rgba(0, 0, 0, 0.32);
32
+ }
33
+
34
+ .container {
35
+ display: flex;
36
+ flex-direction: column;
37
+ align-items: stretch;
38
+ gap: 16px;
39
+ box-sizing: border-box;
40
+ /* Not part of the tab order (see the component for why it's the default
41
+ focus target) — no visible focus indicator of its own. */
42
+ outline: none;
43
+ width: min(560px, calc(100vw - 48px));
44
+ max-height: calc(100vh - 48px);
45
+ padding: 24px;
46
+ border-radius: var(--md-sys-shape-corner-extra-large, 28px);
47
+ background-color: var(--md-sys-color-surface-container-high, #ece6f0);
48
+ color: var(--md-sys-color-on-surface, #1c1b1f);
49
+ font-family: var(--md-sys-typescale-body-medium-font, Roboto, system-ui, sans-serif);
50
+ box-shadow: var(
51
+ --md-sys-elevation-level3,
52
+ 0 1px 3px 0 rgba(0, 0, 0, 0.3),
53
+ 0 4px 8px 3px rgba(0, 0, 0, 0.15)
54
+ );
55
+ }
56
+
57
+ .icon ::slotted(*) {
58
+ width: 24px;
59
+ height: 24px;
60
+ display: block;
61
+ color: var(--md-sys-color-secondary, #625b71);
62
+ }
63
+
64
+ .icon:has(::slotted(*)) {
65
+ align-self: center;
66
+ }
67
+
68
+ .headline {
69
+ display: block;
70
+ color: var(--md-sys-color-on-surface, #1c1b1f);
71
+ font-family: var(--md-sys-typescale-headline-small-font, Roboto, system-ui, sans-serif);
72
+ font-size: var(--md-sys-typescale-headline-small-size, 1.5rem);
73
+ line-height: var(--md-sys-typescale-headline-small-line-height, 2rem);
74
+ }
75
+
76
+ .icon:has(::slotted(*)) ~ .headline {
77
+ text-align: center;
78
+ }
79
+
80
+ .content {
81
+ flex: 1;
82
+ min-height: 0;
83
+ overflow-y: auto;
84
+ color: var(--md-sys-color-on-surface-variant, #49454f);
85
+ font-size: var(--md-sys-typescale-body-medium-size, 0.875rem);
86
+ line-height: var(--md-sys-typescale-body-medium-line-height, 1.25rem);
87
+ }
88
+
89
+ .actions {
90
+ display: flex;
91
+ justify-content: flex-end;
92
+ gap: 8px;
93
+ }
94
+
95
+ .actions:empty {
96
+ display: none;
97
+ }
98
+ `;
99
+ //# sourceMappingURL=dialog-styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dialog-styles.js","sourceRoot":"","sources":["../src/dialog-styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgGxB,CAAC"}
@@ -0,0 +1,64 @@
1
+ import { LitElement } from "lit";
2
+ /**
3
+ * Material Design 3 (basic) dialog, built on the native `<dialog>` element —
4
+ * so focus trapping, initial focus, top-layer stacking, and Escape-to-close
5
+ * all come from the browser rather than reimplemented JS.
6
+ *
7
+ * Native `close`/`cancel` events on `<dialog>` don't bubble or cross the
8
+ * shadow boundary (per spec they're `bubbles: false`, and not composed), so
9
+ * this re-dispatches its own bubbling, composed `close`/`cancel` events.
10
+ *
11
+ * `showModal()` auto-focuses the first focusable descendant when nothing has
12
+ * `autofocus` — which, with no autofocus of your own, would otherwise land on
13
+ * the first slotted action button and show its focus ring on every open,
14
+ * looking like a stray highlight the user never asked for. `container` is
15
+ * given `tabindex="-1" autofocus` (with its own focus ring suppressed) so
16
+ * that's the default focus target instead. Because `container` is an
17
+ * ancestor of the slotted content, its `autofocus` always wins over one on a
18
+ * slotted element (tree order), so it can't be opted out of that way — to
19
+ * focus a specific action instead, call `.focus()` on it yourself after
20
+ * opening the dialog.
21
+ *
22
+ * @element lit-material-dialog
23
+ *
24
+ * @slot icon - An optional small icon shown centered above the headline.
25
+ * @slot headline - The dialog's title.
26
+ * @slot - The dialog's body content (supporting text, form fields, etc.).
27
+ * @slot actions - Action buttons, right-aligned. A `<form method="dialog">`
28
+ * submit button inside this slot closes the dialog natively and sets
29
+ * `returnValue`, without any extra JS.
30
+ *
31
+ * @csspart dialog - The native `<dialog>` element. Transparent and sized to
32
+ * the viewport so clicks outside `container` can be detected as backdrop
33
+ * clicks; style the visible card via `container` instead.
34
+ * @csspart container - The visible card (background, padding, shape, elevation).
35
+ *
36
+ * @fires cancel - Re-dispatched from the native `cancel` event (fired on Escape,
37
+ * before `close`). Cancelable: calling `preventDefault()` stops the dialog from closing.
38
+ * @fires close - Re-dispatched from the native `close` event, after the dialog has closed.
39
+ */
40
+ export declare class LitMaterialDialog extends LitElement {
41
+ static styles: import("lit").CSSResult;
42
+ open: boolean;
43
+ /** If set, clicking the backdrop (outside the visible card) does not close the dialog. */
44
+ disableBackdropClose: boolean;
45
+ private readonly dialogElement?;
46
+ private reopenOnClose;
47
+ protected updated(changed: Map<string, unknown>): void;
48
+ /** Opens the dialog. Equivalent to setting `.open = true`. */
49
+ show(): void;
50
+ /** Closes the dialog. Equivalent to setting `.open = false`. */
51
+ close(returnValue?: string): void;
52
+ /** The value the dialog was closed with (via `close()` or a `method="dialog"` form submit). */
53
+ get returnValue(): string;
54
+ render(): import("lit").TemplateResult<1>;
55
+ private handleClose;
56
+ private handleCancel;
57
+ private handleBackdropClick;
58
+ }
59
+ declare global {
60
+ interface HTMLElementTagNameMap {
61
+ "lit-material-dialog": LitMaterialDialog;
62
+ }
63
+ }
64
+ //# sourceMappingURL=dialog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../src/dialog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,UAAU,EAAE,MAAM,KAAK,CAAC;AAIvC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,qBACa,iBAAkB,SAAQ,UAAU;IAC/C,OAAgB,MAAM,0BAAU;IAEY,IAAI,UAAS;IACzD,0FAA0F;IACxB,oBAAoB,UAAS;IAE9E,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAoB;IACpE,OAAO,CAAC,aAAa,CAAS;cAEX,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAS/D,8DAA8D;IAC9D,IAAI,IAAI,IAAI;IAIZ,gEAAgE;IAChE,KAAK,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI;IAOjC,+FAA+F;IAC/F,IAAI,WAAW,IAAI,MAAM,CAExB;IAEQ,MAAM;IAoBf,OAAO,CAAC,WAAW;IAcnB,OAAO,CAAC,YAAY;IAQpB,OAAO,CAAC,mBAAmB;CAK5B;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,qBAAqB,EAAE,iBAAiB,CAAC;KAC1C;CACF"}
package/dist/dialog.js ADDED
@@ -0,0 +1,140 @@
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 { html, LitElement } from "lit";
8
+ import { customElement, property, query } from "lit/decorators.js";
9
+ import { styles } from "./dialog-styles.js";
10
+ /**
11
+ * Material Design 3 (basic) dialog, built on the native `<dialog>` element —
12
+ * so focus trapping, initial focus, top-layer stacking, and Escape-to-close
13
+ * all come from the browser rather than reimplemented JS.
14
+ *
15
+ * Native `close`/`cancel` events on `<dialog>` don't bubble or cross the
16
+ * shadow boundary (per spec they're `bubbles: false`, and not composed), so
17
+ * this re-dispatches its own bubbling, composed `close`/`cancel` events.
18
+ *
19
+ * `showModal()` auto-focuses the first focusable descendant when nothing has
20
+ * `autofocus` — which, with no autofocus of your own, would otherwise land on
21
+ * the first slotted action button and show its focus ring on every open,
22
+ * looking like a stray highlight the user never asked for. `container` is
23
+ * given `tabindex="-1" autofocus` (with its own focus ring suppressed) so
24
+ * that's the default focus target instead. Because `container` is an
25
+ * ancestor of the slotted content, its `autofocus` always wins over one on a
26
+ * slotted element (tree order), so it can't be opted out of that way — to
27
+ * focus a specific action instead, call `.focus()` on it yourself after
28
+ * opening the dialog.
29
+ *
30
+ * @element lit-material-dialog
31
+ *
32
+ * @slot icon - An optional small icon shown centered above the headline.
33
+ * @slot headline - The dialog's title.
34
+ * @slot - The dialog's body content (supporting text, form fields, etc.).
35
+ * @slot actions - Action buttons, right-aligned. A `<form method="dialog">`
36
+ * submit button inside this slot closes the dialog natively and sets
37
+ * `returnValue`, without any extra JS.
38
+ *
39
+ * @csspart dialog - The native `<dialog>` element. Transparent and sized to
40
+ * the viewport so clicks outside `container` can be detected as backdrop
41
+ * clicks; style the visible card via `container` instead.
42
+ * @csspart container - The visible card (background, padding, shape, elevation).
43
+ *
44
+ * @fires cancel - Re-dispatched from the native `cancel` event (fired on Escape,
45
+ * before `close`). Cancelable: calling `preventDefault()` stops the dialog from closing.
46
+ * @fires close - Re-dispatched from the native `close` event, after the dialog has closed.
47
+ */
48
+ let LitMaterialDialog = class LitMaterialDialog extends LitElement {
49
+ constructor() {
50
+ super(...arguments);
51
+ this.open = false;
52
+ /** If set, clicking the backdrop (outside the visible card) does not close the dialog. */
53
+ this.disableBackdropClose = false;
54
+ this.reopenOnClose = false;
55
+ }
56
+ static { this.styles = styles; }
57
+ updated(changed) {
58
+ if (!changed.has("open") || !this.dialogElement)
59
+ return;
60
+ if (this.open && !this.dialogElement.open) {
61
+ this.dialogElement.showModal();
62
+ }
63
+ else if (!this.open && this.dialogElement.open) {
64
+ this.dialogElement.close();
65
+ }
66
+ }
67
+ /** Opens the dialog. Equivalent to setting `.open = true`. */
68
+ show() {
69
+ this.open = true;
70
+ }
71
+ /** Closes the dialog. Equivalent to setting `.open = false`. */
72
+ close(returnValue) {
73
+ this.open = false;
74
+ if (returnValue !== undefined && this.dialogElement) {
75
+ this.dialogElement.returnValue = returnValue;
76
+ }
77
+ }
78
+ /** The value the dialog was closed with (via `close()` or a `method="dialog"` form submit). */
79
+ get returnValue() {
80
+ return this.dialogElement?.returnValue ?? "";
81
+ }
82
+ render() {
83
+ return html `
84
+ <dialog
85
+ class="dialog"
86
+ part="dialog"
87
+ aria-labelledby="headline"
88
+ @close=${this.handleClose}
89
+ @cancel=${this.handleCancel}
90
+ @click=${this.handleBackdropClick}
91
+ >
92
+ <div class="container" part="container" tabindex="-1" autofocus>
93
+ <slot name="icon" class="icon"></slot>
94
+ <slot name="headline" class="headline" id="headline"></slot>
95
+ <div class="content"><slot></slot></div>
96
+ <div class="actions"><slot name="actions"></slot></div>
97
+ </div>
98
+ </dialog>
99
+ `;
100
+ }
101
+ handleClose() {
102
+ if (this.reopenOnClose) {
103
+ // Some browsers don't actually honor `preventDefault()` on the native
104
+ // `cancel` event (despite documenting it as cancelable), so the dialog
105
+ // closes anyway — immediately reopening it makes `cancel` prevention
106
+ // work regardless of that inconsistency.
107
+ this.reopenOnClose = false;
108
+ this.dialogElement?.showModal();
109
+ return;
110
+ }
111
+ this.open = false;
112
+ this.dispatchEvent(new Event("close", { bubbles: true, composed: true }));
113
+ }
114
+ handleCancel(event) {
115
+ const proceed = this.dispatchEvent(new Event("cancel", { bubbles: true, cancelable: true, composed: true }));
116
+ if (!proceed) {
117
+ event.preventDefault();
118
+ this.reopenOnClose = true;
119
+ }
120
+ }
121
+ handleBackdropClick(event) {
122
+ if (!this.disableBackdropClose && event.target === this.dialogElement) {
123
+ this.dialogElement?.close();
124
+ }
125
+ }
126
+ };
127
+ __decorate([
128
+ property({ type: Boolean, reflect: true })
129
+ ], LitMaterialDialog.prototype, "open", void 0);
130
+ __decorate([
131
+ property({ type: Boolean, attribute: "disable-backdrop-close" })
132
+ ], LitMaterialDialog.prototype, "disableBackdropClose", void 0);
133
+ __decorate([
134
+ query("dialog")
135
+ ], LitMaterialDialog.prototype, "dialogElement", void 0);
136
+ LitMaterialDialog = __decorate([
137
+ customElement("lit-material-dialog")
138
+ ], LitMaterialDialog);
139
+ export { LitMaterialDialog };
140
+ //# sourceMappingURL=dialog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dialog.js","sourceRoot":"","sources":["../src/dialog.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACvC,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,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,wBAAwB,EAAE,CAAC;+DAA8B;AAE7D;IAAjC,KAAK,CAAC,QAAQ,CAAC;wDAAoD;AAPzD,iBAAiB;IAD7B,aAAa,CAAC,qBAAqB,CAAC;GACxB,iBAAiB,CAoF7B"}
@@ -0,0 +1,2 @@
1
+ export { LitMaterialDialog } from "./dialog.js";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ export { LitMaterialDialog } from "./dialog.js";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC"}
package/package.json ADDED
@@ -0,0 +1,53 @@
1
+ {
2
+ "name": "@lit-material/dialog",
3
+ "version": "0.0.1",
4
+ "description": "Material Design 3 dialog web component, built on the native <dialog> element.",
5
+ "license": "MIT",
6
+ "author": {
7
+ "name": "bohdaq",
8
+ "email": "bohdaq@gmail.com",
9
+ "url": "https://github.com/bohdaq"
10
+ },
11
+ "homepage": "https://github.com/bohdaq/lit-material#readme",
12
+ "bugs": "https://github.com/bohdaq/lit-material/issues",
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "git+ssh://git@github.com/bohdaq/lit-material.git",
16
+ "directory": "packages/dialog"
17
+ },
18
+ "keywords": ["lit", "web-components", "lit-material", "material-design", "material-design-3", "dialog", "modal"],
19
+ "type": "module",
20
+ "main": "./dist/index.js",
21
+ "types": "./dist/index.d.ts",
22
+ "exports": {
23
+ ".": {
24
+ "types": "./dist/index.d.ts",
25
+ "default": "./dist/index.js"
26
+ }
27
+ },
28
+ "files": [
29
+ "dist"
30
+ ],
31
+ "publishConfig": {
32
+ "access": "public"
33
+ },
34
+ "scripts": {
35
+ "build": "tsc -p tsconfig.json",
36
+ "typecheck": "tsc -p tsconfig.json --noEmit",
37
+ "test": "web-test-runner && node --import tsx --test src/dialog.ssr.test.ts"
38
+ },
39
+ "dependencies": {
40
+ "@lit-material/tokens": "workspace:*",
41
+ "lit": "^3.2.0"
42
+ },
43
+ "devDependencies": {
44
+ "@lit-labs/ssr": "^3.3.1",
45
+ "@open-wc/testing": "^4.0.0",
46
+ "@web/dev-server-esbuild": "^1.0.0",
47
+ "@web/test-runner": "^0.19.0",
48
+ "@web/test-runner-commands": "^0.9.0",
49
+ "@web/test-runner-playwright": "^0.11.0",
50
+ "tsx": "^4.19.0",
51
+ "typescript": "^5.7.0"
52
+ }
53
+ }