@digital-realty/ix-error-message 0.0.0-stage → 0.0.2-IXUAT-11213.568835
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 +21 -0
- package/README.md +90 -2
- package/dist/IxErrorMessage.d.ts +24 -0
- package/dist/IxErrorMessage.js +153 -0
- package/dist/IxErrorMessage.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/ix-error-message.d.ts +4 -0
- package/dist/ix-error-message.js +145 -0
- package/dist/ix-error-message.js.map +1 -0
- package/dist/ix-error-message.min.js +205 -0
- package/dist/react/IxErrorMessage.d.ts +3 -0
- package/dist/react/IxErrorMessage.js +9 -0
- package/dist/react/IxErrorMessage.js.map +1 -0
- package/package.json +105 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 ix-error-message
|
|
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
CHANGED
|
@@ -1,3 +1,91 @@
|
|
|
1
|
-
#
|
|
1
|
+
# \<ix-error-message>
|
|
2
2
|
|
|
3
|
-
This
|
|
3
|
+
This webcomponent follows the [open-wc](https://github.com/open-wc/open-wc) recommendation.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm i @digital-realty/ix-error-message
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```html
|
|
14
|
+
<script type="module">
|
|
15
|
+
import '@digital-realty/ix-error-message/ix-error-message.js';
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<ix-error-message></ix-error-message>
|
|
19
|
+
```
|
|
20
|
+
### In React
|
|
21
|
+
```html
|
|
22
|
+
<script type="module">
|
|
23
|
+
import { IxErrorMessage } from '@digital-realty/ix-error-message/IxErrorMessage'
|
|
24
|
+
</script>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Variations
|
|
28
|
+
|
|
29
|
+
`<ix-error-message>` always shows an icon, a "We've encountered a technical
|
|
30
|
+
issue." heading and support contact details. Three properties control
|
|
31
|
+
optional behaviour, and can be combined freely:
|
|
32
|
+
|
|
33
|
+
### `dialog`
|
|
34
|
+
|
|
35
|
+
Type: `boolean` — default `false`
|
|
36
|
+
|
|
37
|
+
Renders the message inside an `ix-dialog` modal (with a "Close" button)
|
|
38
|
+
instead of directly inline. Use the `open` property to control whether the
|
|
39
|
+
dialog is currently shown; it has no effect when `dialog` is `false`.
|
|
40
|
+
|
|
41
|
+
```html
|
|
42
|
+
<ix-error-message
|
|
43
|
+
dialog
|
|
44
|
+
.open=${this.open}
|
|
45
|
+
trace=${this.errorMessage}
|
|
46
|
+
></ix-error-message>
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### `retry`
|
|
50
|
+
|
|
51
|
+
Type: `((...args: any[]) => void) | undefined` — default `undefined`
|
|
52
|
+
|
|
53
|
+
When set to a function, replaces the default "email support" copy with a
|
|
54
|
+
"Retry" call-to-action button that invokes the function on click (plus a
|
|
55
|
+
secondary "Still not working?" message with the support contact details).
|
|
56
|
+
Leave it `undefined` to show only the default support-contact message.
|
|
57
|
+
|
|
58
|
+
```js
|
|
59
|
+
document.querySelector('ix-error-message').retry = () => refetchData();
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### `trace`
|
|
63
|
+
|
|
64
|
+
Type: `string | Record<string, unknown> | undefined` — default `undefined`
|
|
65
|
+
|
|
66
|
+
When set, shows a copyable error/trace-code panel with a "Copy" button
|
|
67
|
+
below the support message. The value is also included in the "email
|
|
68
|
+
support" link's body. Leave it `undefined`/empty to hide that panel
|
|
69
|
+
entirely.
|
|
70
|
+
|
|
71
|
+
A plain string is used as-is; a JS object is automatically JSON-stringified
|
|
72
|
+
wherever it's needed as text (clipboard copy, email body):
|
|
73
|
+
|
|
74
|
+
```html
|
|
75
|
+
<ix-error-message trace="ERR-20261117-ABC123"></ix-error-message>
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
```js
|
|
79
|
+
document.querySelector('ix-error-message').trace = {
|
|
80
|
+
code: 'ERR-20261117-ABC123',
|
|
81
|
+
requestId: 'req-789',
|
|
82
|
+
};
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
See the [Storybook stories](../../stories/ix-error-message.stories.js) for
|
|
86
|
+
live, combinable examples of each variation (`Dialog`, `Retry`, `TraceCode`,
|
|
87
|
+
`NoTraceCode`, `DialogWithRetryAndTrace`).
|
|
88
|
+
|
|
89
|
+
## Demo and Documentation
|
|
90
|
+
|
|
91
|
+
Full documentation and demo are available at [DLR Component Gallery](https://inxn-p1-uicomponentgallery.azurewebsites.net/?path=/story/inxn-ix-error-message--default).
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import '@digital-realty/ix-button/ix-button.js';
|
|
3
|
+
import '@digital-realty/ix-dialog/ix-dialog.js';
|
|
4
|
+
import '@digital-realty/ix-icon/ix-icon.js';
|
|
5
|
+
export declare class IxErrorMessage extends LitElement {
|
|
6
|
+
dialog: boolean;
|
|
7
|
+
open: boolean;
|
|
8
|
+
retry: ((...args: any[]) => void) | undefined;
|
|
9
|
+
trace: string | Record<string, unknown> | undefined;
|
|
10
|
+
copied: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* String representation of `trace`, used wherever the value needs to be
|
|
13
|
+
* plain text (clipboard copy, email body): objects are JSON-stringified,
|
|
14
|
+
* strings are passed through unchanged.
|
|
15
|
+
*/
|
|
16
|
+
get traceText(): string | undefined;
|
|
17
|
+
get emailLink(): import("lit").TemplateResult<1>;
|
|
18
|
+
retryMsg(): import("lit").TemplateResult<1>;
|
|
19
|
+
standardMsg(): import("lit").TemplateResult<1>;
|
|
20
|
+
errorTrace(): import("lit").TemplateResult<1>;
|
|
21
|
+
errorMsg(showHeading?: boolean): import("lit").TemplateResult<1>;
|
|
22
|
+
closeDialog(): void;
|
|
23
|
+
render(): import("lit").TemplateResult<1>;
|
|
24
|
+
}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { html, LitElement, nothing } from 'lit';
|
|
3
|
+
import { property, state } from 'lit/decorators.js';
|
|
4
|
+
import '@digital-realty/ix-button/ix-button.js';
|
|
5
|
+
import '@digital-realty/ix-dialog/ix-dialog.js';
|
|
6
|
+
import '@digital-realty/ix-icon/ix-icon.js';
|
|
7
|
+
const HEADING_TEXT = 'We’ve encountered a technical issue.';
|
|
8
|
+
export class IxErrorMessage extends LitElement {
|
|
9
|
+
constructor() {
|
|
10
|
+
super(...arguments);
|
|
11
|
+
this.dialog = false;
|
|
12
|
+
this.open = false;
|
|
13
|
+
this.retry = undefined; // () => {};
|
|
14
|
+
this.trace = undefined;
|
|
15
|
+
this.copied = false;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* String representation of `trace`, used wherever the value needs to be
|
|
19
|
+
* plain text (clipboard copy, email body): objects are JSON-stringified,
|
|
20
|
+
* strings are passed through unchanged.
|
|
21
|
+
*/
|
|
22
|
+
get traceText() {
|
|
23
|
+
if (this.trace === undefined)
|
|
24
|
+
return undefined;
|
|
25
|
+
return typeof this.trace === 'string'
|
|
26
|
+
? this.trace
|
|
27
|
+
: JSON.stringify(this.trace);
|
|
28
|
+
}
|
|
29
|
+
get emailLink() {
|
|
30
|
+
var _a;
|
|
31
|
+
return html `<a
|
|
32
|
+
href="mailto:CustomerCare@digitalrealty.com?subject=Support%20Request&body=${encodeURIComponent((_a = this.traceText) !== null && _a !== void 0 ? _a : 'no trace provided')}"
|
|
33
|
+
>CustomerCare@digitalrealty.com</a
|
|
34
|
+
>`;
|
|
35
|
+
}
|
|
36
|
+
retryMsg() {
|
|
37
|
+
return html `
|
|
38
|
+
<div class="retry">
|
|
39
|
+
<p class="error-msg">
|
|
40
|
+
Our apologies for the inconvenience. Please, retry below.
|
|
41
|
+
</p>
|
|
42
|
+
<ix-button appearance="filled" has-icon @click=${this.retry}>
|
|
43
|
+
<ix-icon slot="icon">refresh</ix-icon>
|
|
44
|
+
Retry
|
|
45
|
+
</ix-button>
|
|
46
|
+
</div>
|
|
47
|
+
<div>
|
|
48
|
+
<h3>Still not working?</h3>
|
|
49
|
+
<p>
|
|
50
|
+
Still not working? Copy this code and contact our Support team by
|
|
51
|
+
sending an email to ${this.emailLink}
|
|
52
|
+
</p>
|
|
53
|
+
</div>
|
|
54
|
+
`;
|
|
55
|
+
}
|
|
56
|
+
standardMsg() {
|
|
57
|
+
return html `
|
|
58
|
+
<p class="error-msg">
|
|
59
|
+
Our apologies for the inconvenience. To help us resolve this quickly,
|
|
60
|
+
please click the button below to copy the details and share them with
|
|
61
|
+
our Support team by sending an email to ${this.emailLink}
|
|
62
|
+
</p>
|
|
63
|
+
`;
|
|
64
|
+
}
|
|
65
|
+
errorTrace() {
|
|
66
|
+
return html `
|
|
67
|
+
<div class="error-trace-container">
|
|
68
|
+
<div class="error-trace">
|
|
69
|
+
<p class="error-trace-code">
|
|
70
|
+
<span class="visually-hidden">Error code: </span>${this.trace
|
|
71
|
+
? '[Unique-Error-Code]'
|
|
72
|
+
: 'unavailable'}
|
|
73
|
+
</p>
|
|
74
|
+
<ix-button
|
|
75
|
+
@click=${async () => {
|
|
76
|
+
var _a;
|
|
77
|
+
try {
|
|
78
|
+
await navigator.clipboard.writeText((_a = this.traceText) !== null && _a !== void 0 ? _a : '');
|
|
79
|
+
this.copied = true;
|
|
80
|
+
setTimeout(() => {
|
|
81
|
+
this.copied = false;
|
|
82
|
+
}, 2000);
|
|
83
|
+
}
|
|
84
|
+
catch (err) {
|
|
85
|
+
console.error('Failed to copy error identifier to clipboard', err);
|
|
86
|
+
}
|
|
87
|
+
}}
|
|
88
|
+
appearance="outlined"
|
|
89
|
+
has-icon
|
|
90
|
+
aria-label="Copy error code to clipboard"
|
|
91
|
+
>
|
|
92
|
+
<ix-icon slot="icon">content_copy</ix-icon>
|
|
93
|
+
${this.copied ? 'Copied!' : 'Copy'}
|
|
94
|
+
</ix-button>
|
|
95
|
+
<span role="status" aria-live="polite" class="visually-hidden">
|
|
96
|
+
${this.copied ? 'Copied to clipboard' : nothing}
|
|
97
|
+
</span>
|
|
98
|
+
</div>
|
|
99
|
+
</div>
|
|
100
|
+
`;
|
|
101
|
+
}
|
|
102
|
+
errorMsg(showHeading = true) {
|
|
103
|
+
return html `
|
|
104
|
+
<div class="container ${this.dialog ? 'dialog' : ''}">
|
|
105
|
+
<ix-icon class="error">error</ix-icon>
|
|
106
|
+
${showHeading
|
|
107
|
+
? html `<h2
|
|
108
|
+
class="dlr-text-heading"
|
|
109
|
+
data-testid="ix-grid-no-rows-heading"
|
|
110
|
+
>
|
|
111
|
+
${HEADING_TEXT}
|
|
112
|
+
</h2>`
|
|
113
|
+
: nothing}
|
|
114
|
+
${this.retry ? this.retryMsg() : this.standardMsg()}
|
|
115
|
+
${this.trace ? this.errorTrace() : nothing}
|
|
116
|
+
</div>
|
|
117
|
+
`;
|
|
118
|
+
}
|
|
119
|
+
closeDialog() {
|
|
120
|
+
this.open = false;
|
|
121
|
+
}
|
|
122
|
+
render() {
|
|
123
|
+
return this.dialog
|
|
124
|
+
? html `<ix-dialog ?open=${this.open}>
|
|
125
|
+
<div slot="headline" class="sr-only">${HEADING_TEXT}</div>
|
|
126
|
+
<div slot="content">
|
|
127
|
+
<div>${this.errorMsg(true)}</div>
|
|
128
|
+
<div class="dialog-footer">
|
|
129
|
+
<ix-button appearance="text" @click=${this.closeDialog}
|
|
130
|
+
>Close</ix-button
|
|
131
|
+
>
|
|
132
|
+
</div>
|
|
133
|
+
</div></ix-dialog
|
|
134
|
+
>`
|
|
135
|
+
: html `<div role="alert">${this.errorMsg()}</div>`;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
__decorate([
|
|
139
|
+
property({ type: Boolean })
|
|
140
|
+
], IxErrorMessage.prototype, "dialog", void 0);
|
|
141
|
+
__decorate([
|
|
142
|
+
property({ type: Boolean })
|
|
143
|
+
], IxErrorMessage.prototype, "open", void 0);
|
|
144
|
+
__decorate([
|
|
145
|
+
property({ attribute: false })
|
|
146
|
+
], IxErrorMessage.prototype, "retry", void 0);
|
|
147
|
+
__decorate([
|
|
148
|
+
property({ type: String })
|
|
149
|
+
], IxErrorMessage.prototype, "trace", void 0);
|
|
150
|
+
__decorate([
|
|
151
|
+
state()
|
|
152
|
+
], IxErrorMessage.prototype, "copied", void 0);
|
|
153
|
+
//# sourceMappingURL=IxErrorMessage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IxErrorMessage.js","sourceRoot":"","sources":["../src/IxErrorMessage.ts"],"names":[],"mappings":"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","sourcesContent":["import { html, LitElement, nothing } from 'lit';\nimport { property, state } from 'lit/decorators.js';\nimport '@digital-realty/ix-button/ix-button.js';\nimport '@digital-realty/ix-dialog/ix-dialog.js';\nimport '@digital-realty/ix-icon/ix-icon.js';\n\nconst HEADING_TEXT = 'We’ve encountered a technical issue.';\n\nexport class IxErrorMessage extends LitElement {\n @property({ type: Boolean }) dialog: boolean = false;\n\n @property({ type: Boolean }) open: boolean = false;\n\n @property({ attribute: false }) retry:\n | ((...args: any[]) => void)\n | undefined = undefined; // () => {};\n\n @property({ type: String }) trace:\n | string\n | Record<string, unknown>\n | undefined = undefined;\n\n @state() copied = false;\n\n /**\n * String representation of `trace`, used wherever the value needs to be\n * plain text (clipboard copy, email body): objects are JSON-stringified,\n * strings are passed through unchanged.\n */\n get traceText(): string | undefined {\n if (this.trace === undefined) return undefined;\n return typeof this.trace === 'string'\n ? this.trace\n : JSON.stringify(this.trace);\n }\n\n get emailLink() {\n return html`<a\n href=\"mailto:CustomerCare@digitalrealty.com?subject=Support%20Request&body=${encodeURIComponent(\n this.traceText ?? 'no trace provided'\n )}\"\n >CustomerCare@digitalrealty.com</a\n >`;\n }\n\n retryMsg() {\n return html`\n <div class=\"retry\">\n <p class=\"error-msg\">\n Our apologies for the inconvenience. Please, retry below.\n </p>\n <ix-button appearance=\"filled\" has-icon @click=${this.retry}>\n <ix-icon slot=\"icon\">refresh</ix-icon>\n Retry\n </ix-button>\n </div>\n <div>\n <h3>Still not working?</h3>\n <p>\n Still not working? Copy this code and contact our Support team by\n sending an email to ${this.emailLink}\n </p>\n </div>\n `;\n }\n\n standardMsg() {\n return html`\n <p class=\"error-msg\">\n Our apologies for the inconvenience. To help us resolve this quickly,\n please click the button below to copy the details and share them with\n our Support team by sending an email to ${this.emailLink}\n </p>\n `;\n }\n\n errorTrace() {\n return html`\n <div class=\"error-trace-container\">\n <div class=\"error-trace\">\n <p class=\"error-trace-code\">\n <span class=\"visually-hidden\">Error code: </span>${this.trace\n ? '[Unique-Error-Code]'\n : 'unavailable'}\n </p>\n <ix-button\n @click=${async () => {\n try {\n await navigator.clipboard.writeText(this.traceText ?? '');\n this.copied = true;\n setTimeout(() => {\n this.copied = false;\n }, 2000);\n } catch (err) {\n console.error(\n 'Failed to copy error identifier to clipboard',\n err\n );\n }\n }}\n appearance=\"outlined\"\n has-icon\n aria-label=\"Copy error code to clipboard\"\n >\n <ix-icon slot=\"icon\">content_copy</ix-icon>\n ${this.copied ? 'Copied!' : 'Copy'}\n </ix-button>\n <span role=\"status\" aria-live=\"polite\" class=\"visually-hidden\">\n ${this.copied ? 'Copied to clipboard' : nothing}\n </span>\n </div>\n </div>\n `;\n }\n\n errorMsg(showHeading = true) {\n return html`\n <div class=\"container ${this.dialog ? 'dialog' : ''}\">\n <ix-icon class=\"error\">error</ix-icon>\n ${showHeading\n ? html`<h2\n class=\"dlr-text-heading\"\n data-testid=\"ix-grid-no-rows-heading\"\n >\n ${HEADING_TEXT}\n </h2>`\n : nothing}\n ${this.retry ? this.retryMsg() : this.standardMsg()}\n ${this.trace ? this.errorTrace() : nothing}\n </div>\n `;\n }\n\n closeDialog() {\n this.open = false;\n }\n\n render() {\n return this.dialog\n ? html`<ix-dialog ?open=${this.open}>\n <div slot=\"headline\" class=\"sr-only\">${HEADING_TEXT}</div>\n <div slot=\"content\">\n <div>${this.errorMsg(true)}</div>\n <div class=\"dialog-footer\">\n <ix-button appearance=\"text\" @click=${this.closeDialog}\n >Close</ix-button\n >\n </div>\n </div></ix-dialog\n >`\n : html`<div role=\"alert\">${this.errorMsg()}</div>`;\n }\n}\n"]}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { IxErrorMessage } from './IxErrorMessage.js';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC","sourcesContent":["export { IxErrorMessage } from './IxErrorMessage.js';\n"]}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
import { IxErrorMessage } from './IxErrorMessage.js';
|
|
3
|
+
export class IxErrorMessageStyled extends IxErrorMessage {
|
|
4
|
+
}
|
|
5
|
+
IxErrorMessageStyled.styles = css `
|
|
6
|
+
ix-dialog {
|
|
7
|
+
--md-dialog-container-shape: 6px;
|
|
8
|
+
}
|
|
9
|
+
.container {
|
|
10
|
+
display: flex;
|
|
11
|
+
justify-content: center;
|
|
12
|
+
align-items: center;
|
|
13
|
+
flex-direction: column;
|
|
14
|
+
text-align: center;
|
|
15
|
+
max-width: 665px;
|
|
16
|
+
margin: 0 auto;
|
|
17
|
+
}
|
|
18
|
+
.container .error-msg {
|
|
19
|
+
margin: 0 0 1.5rem;
|
|
20
|
+
font-size: 16px;
|
|
21
|
+
line-height: 28px;
|
|
22
|
+
letter-spacing: 0.44px;
|
|
23
|
+
}
|
|
24
|
+
.error {
|
|
25
|
+
user-select: none;
|
|
26
|
+
display: inline-block;
|
|
27
|
+
--ix-icon-font-size: 88px;
|
|
28
|
+
color: rgba(255, 152, 0, 1);
|
|
29
|
+
}
|
|
30
|
+
.dialog .error {
|
|
31
|
+
--ix-icon-font-size: 66px;
|
|
32
|
+
margin-top: 0.5rem;
|
|
33
|
+
}
|
|
34
|
+
.retry {
|
|
35
|
+
width: 100%;
|
|
36
|
+
border-bottom: 1px solid rgba(9, 34, 65, 0.12);
|
|
37
|
+
}
|
|
38
|
+
.retry p {
|
|
39
|
+
margin: 0 0 16px 0;
|
|
40
|
+
font-family: Open Sans;
|
|
41
|
+
font-weight: 400;
|
|
42
|
+
font-size: 14px;
|
|
43
|
+
line-height: 24px;
|
|
44
|
+
letter-spacing: 0.25px;
|
|
45
|
+
text-align: center;
|
|
46
|
+
}
|
|
47
|
+
p {
|
|
48
|
+
font-family: Open Sans;
|
|
49
|
+
font-weight: 400;
|
|
50
|
+
font-size: 14px;
|
|
51
|
+
line-height: 24px;
|
|
52
|
+
letter-spacing: 0.25px;
|
|
53
|
+
text-align: center;
|
|
54
|
+
}
|
|
55
|
+
.retry ix-button {
|
|
56
|
+
display: inline-block;
|
|
57
|
+
margin: 0 0 24px 0;
|
|
58
|
+
}
|
|
59
|
+
h2 {
|
|
60
|
+
font-family: var(--ix-font-family, 'Red Hat Display');
|
|
61
|
+
font-weight: 700;
|
|
62
|
+
font-size: 34px;
|
|
63
|
+
line-height: 40px;
|
|
64
|
+
letter-spacing: 0.35px;
|
|
65
|
+
text-align: center;
|
|
66
|
+
margin: 1.5rem 0 16px 0;
|
|
67
|
+
}
|
|
68
|
+
.dialog h2 {
|
|
69
|
+
font-size: 24px;
|
|
70
|
+
line-height: 40px;
|
|
71
|
+
margin-top: 0.8rem;
|
|
72
|
+
letter-spacing: 0;
|
|
73
|
+
}
|
|
74
|
+
h3 {
|
|
75
|
+
font-family: Red Hat Display;
|
|
76
|
+
font-weight: 700;
|
|
77
|
+
font-size: 20px;
|
|
78
|
+
line-height: 24px;
|
|
79
|
+
letter-spacing: 0.15px;
|
|
80
|
+
text-align: center;
|
|
81
|
+
}
|
|
82
|
+
.error-trace-container {
|
|
83
|
+
width: 100%;
|
|
84
|
+
max-width: 489px;
|
|
85
|
+
}
|
|
86
|
+
.error-trace {
|
|
87
|
+
display: flex;
|
|
88
|
+
align-items: center;
|
|
89
|
+
padding-top: 16px;
|
|
90
|
+
padding-right: 24px;
|
|
91
|
+
padding-bottom: 16px;
|
|
92
|
+
padding-left: 24px;
|
|
93
|
+
background-color: var(--clr-surface, #fff);
|
|
94
|
+
gap: 8px;
|
|
95
|
+
border-radius: 12px;
|
|
96
|
+
border: 1px solid rgba(225, 228, 232, 1);
|
|
97
|
+
box-shadow: 0px 0px 0px 1px rgba(225, 228, 232, 1) inset;
|
|
98
|
+
box-shadow: 0px 12px 20px -12px rgba(0, 0, 0, 0.12);
|
|
99
|
+
--md-outlined-button-with-leading-icon-trailing-space: 1rem;
|
|
100
|
+
--md-outlined-button-with-leading-icon-leading-space: 1rem;
|
|
101
|
+
}
|
|
102
|
+
.error-trace-code {
|
|
103
|
+
flex: 1;
|
|
104
|
+
display: flex;
|
|
105
|
+
justify-content: center;
|
|
106
|
+
margin: 0;
|
|
107
|
+
font-size: 16px;
|
|
108
|
+
letter-spacing: 0.15px;
|
|
109
|
+
}
|
|
110
|
+
.error-trace ix-button {
|
|
111
|
+
flex-shrink: 0;
|
|
112
|
+
}
|
|
113
|
+
.dialog-footer {
|
|
114
|
+
display: flex;
|
|
115
|
+
justify-content: flex-end;
|
|
116
|
+
margin: 1.5rem -1rem 0 0;
|
|
117
|
+
}
|
|
118
|
+
.visually-hidden {
|
|
119
|
+
position: absolute;
|
|
120
|
+
width: 1px;
|
|
121
|
+
height: 1px;
|
|
122
|
+
padding: 0;
|
|
123
|
+
margin: -1px;
|
|
124
|
+
overflow: hidden;
|
|
125
|
+
clip: rect(0, 0, 0, 0);
|
|
126
|
+
white-space: nowrap;
|
|
127
|
+
border: 0;
|
|
128
|
+
}
|
|
129
|
+
.sr-only {
|
|
130
|
+
position: absolute;
|
|
131
|
+
width: 1px;
|
|
132
|
+
height: 1px;
|
|
133
|
+
margin: -1px;
|
|
134
|
+
padding: 0;
|
|
135
|
+
overflow: hidden;
|
|
136
|
+
clip: rect(0, 0, 0, 0);
|
|
137
|
+
clip-path: inset(50%);
|
|
138
|
+
white-space: nowrap;
|
|
139
|
+
border: 0;
|
|
140
|
+
}
|
|
141
|
+
`;
|
|
142
|
+
if (!customElements.get('ix-error-message')) {
|
|
143
|
+
customElements.define('ix-error-message', IxErrorMessageStyled);
|
|
144
|
+
}
|
|
145
|
+
//# sourceMappingURL=ix-error-message.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ix-error-message.js","sourceRoot":"","sources":["../src/ix-error-message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,MAAM,OAAO,oBAAqB,SAAQ,cAAc;;AACtC,2BAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwI3B,CAAC;AAGJ,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,kBAAkB,CAAC,EAAE,CAAC;IAC5C,cAAc,CAAC,MAAM,CAAC,kBAAkB,EAAE,oBAAoB,CAAC,CAAC;AAClE,CAAC","sourcesContent":["import { css } from 'lit';\nimport { IxErrorMessage } from './IxErrorMessage.js';\n\nexport class IxErrorMessageStyled extends IxErrorMessage {\n static override styles = css`\n ix-dialog {\n --md-dialog-container-shape: 6px;\n }\n .container {\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n text-align: center;\n max-width: 665px;\n margin: 0 auto;\n }\n .container .error-msg {\n margin: 0 0 1.5rem;\n font-size: 16px;\n line-height: 28px;\n letter-spacing: 0.44px;\n }\n .error {\n user-select: none;\n display: inline-block;\n --ix-icon-font-size: 88px;\n color: rgba(255, 152, 0, 1);\n }\n .dialog .error {\n --ix-icon-font-size: 66px;\n margin-top: 0.5rem;\n }\n .retry {\n width: 100%;\n border-bottom: 1px solid rgba(9, 34, 65, 0.12);\n }\n .retry p {\n margin: 0 0 16px 0;\n font-family: Open Sans;\n font-weight: 400;\n font-size: 14px;\n line-height: 24px;\n letter-spacing: 0.25px;\n text-align: center;\n }\n p {\n font-family: Open Sans;\n font-weight: 400;\n font-size: 14px;\n line-height: 24px;\n letter-spacing: 0.25px;\n text-align: center;\n }\n .retry ix-button {\n display: inline-block;\n margin: 0 0 24px 0;\n }\n h2 {\n font-family: var(--ix-font-family, 'Red Hat Display');\n font-weight: 700;\n font-size: 34px;\n line-height: 40px;\n letter-spacing: 0.35px;\n text-align: center;\n margin: 1.5rem 0 16px 0;\n }\n .dialog h2 {\n font-size: 24px;\n line-height: 40px;\n margin-top: 0.8rem;\n letter-spacing: 0;\n }\n h3 {\n font-family: Red Hat Display;\n font-weight: 700;\n font-size: 20px;\n line-height: 24px;\n letter-spacing: 0.15px;\n text-align: center;\n }\n .error-trace-container {\n width: 100%;\n max-width: 489px;\n }\n .error-trace {\n display: flex;\n align-items: center;\n padding-top: 16px;\n padding-right: 24px;\n padding-bottom: 16px;\n padding-left: 24px;\n background-color: var(--clr-surface, #fff);\n gap: 8px;\n border-radius: 12px;\n border: 1px solid rgba(225, 228, 232, 1);\n box-shadow: 0px 0px 0px 1px rgba(225, 228, 232, 1) inset;\n box-shadow: 0px 12px 20px -12px rgba(0, 0, 0, 0.12);\n --md-outlined-button-with-leading-icon-trailing-space: 1rem;\n --md-outlined-button-with-leading-icon-leading-space: 1rem;\n }\n .error-trace-code {\n flex: 1;\n display: flex;\n justify-content: center;\n margin: 0;\n font-size: 16px;\n letter-spacing: 0.15px;\n }\n .error-trace ix-button {\n flex-shrink: 0;\n }\n .dialog-footer {\n display: flex;\n justify-content: flex-end;\n margin: 1.5rem -1rem 0 0;\n }\n .visually-hidden {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border: 0;\n }\n .sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n margin: -1px;\n padding: 0;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n clip-path: inset(50%);\n white-space: nowrap;\n border: 0;\n }\n `;\n}\n\nif (!customElements.get('ix-error-message')) {\n customElements.define('ix-error-message', IxErrorMessageStyled);\n}\n"]}
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import{LitElement as e,html as i,nothing as t,css as r}from"lit";import{__decorate as o}from"tslib";import{property as a,state as n}from"lit/decorators.js";import"@digital-realty/ix-button/ix-button.js";import"@digital-realty/ix-dialog/ix-dialog.js";import"@digital-realty/ix-icon/ix-icon.js";const s="We’ve encountered a technical issue.";class l extends e{constructor(){super(...arguments),this.dialog=!1,this.open=!1,this.retry=void 0,this.trace=void 0,this.copied=!1}get traceText(){if(void 0!==this.trace)return"string"==typeof this.trace?this.trace:JSON.stringify(this.trace)}get emailLink(){var e;return i`<a
|
|
2
|
+
href="mailto:CustomerCare@digitalrealty.com?subject=Support%20Request&body=${encodeURIComponent(null!==(e=this.traceText)&&void 0!==e?e:"no trace provided")}"
|
|
3
|
+
>CustomerCare@digitalrealty.com</a
|
|
4
|
+
>`}retryMsg(){return i`
|
|
5
|
+
<div class="retry">
|
|
6
|
+
<p class="error-msg">
|
|
7
|
+
Our apologies for the inconvenience. Please, retry below.
|
|
8
|
+
</p>
|
|
9
|
+
<ix-button appearance="filled" has-icon @click=${this.retry}>
|
|
10
|
+
<ix-icon slot="icon">refresh</ix-icon>
|
|
11
|
+
Retry
|
|
12
|
+
</ix-button>
|
|
13
|
+
</div>
|
|
14
|
+
<div>
|
|
15
|
+
<h3>Still not working?</h3>
|
|
16
|
+
<p>
|
|
17
|
+
Still not working? Copy this code and contact our Support team by
|
|
18
|
+
sending an email to ${this.emailLink}
|
|
19
|
+
</p>
|
|
20
|
+
</div>
|
|
21
|
+
`}standardMsg(){return i`
|
|
22
|
+
<p class="error-msg">
|
|
23
|
+
Our apologies for the inconvenience. To help us resolve this quickly,
|
|
24
|
+
please click the button below to copy the details and share them with
|
|
25
|
+
our Support team by sending an email to ${this.emailLink}
|
|
26
|
+
</p>
|
|
27
|
+
`}errorTrace(){return i`
|
|
28
|
+
<div class="error-trace-container">
|
|
29
|
+
<div class="error-trace">
|
|
30
|
+
<p class="error-trace-code">
|
|
31
|
+
<span class="visually-hidden">Error code: </span>${this.trace?"[Unique-Error-Code]":"unavailable"}
|
|
32
|
+
</p>
|
|
33
|
+
<ix-button
|
|
34
|
+
@click=${async()=>{var e;try{await navigator.clipboard.writeText(null!==(e=this.traceText)&&void 0!==e?e:""),this.copied=!0,setTimeout(()=>{this.copied=!1},2e3)}catch(e){console.error("Failed to copy error identifier to clipboard",e)}}}
|
|
35
|
+
appearance="outlined"
|
|
36
|
+
has-icon
|
|
37
|
+
aria-label="Copy error code to clipboard"
|
|
38
|
+
>
|
|
39
|
+
<ix-icon slot="icon">content_copy</ix-icon>
|
|
40
|
+
${this.copied?"Copied!":"Copy"}
|
|
41
|
+
</ix-button>
|
|
42
|
+
<span role="status" aria-live="polite" class="visually-hidden">
|
|
43
|
+
${this.copied?"Copied to clipboard":t}
|
|
44
|
+
</span>
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
`}errorMsg(e=!0){return i`
|
|
48
|
+
<div class="container ${this.dialog?"dialog":""}">
|
|
49
|
+
<ix-icon class="error">error</ix-icon>
|
|
50
|
+
${e?i`<h2
|
|
51
|
+
class="dlr-text-heading"
|
|
52
|
+
data-testid="ix-grid-no-rows-heading"
|
|
53
|
+
>
|
|
54
|
+
${s}
|
|
55
|
+
</h2>`:t}
|
|
56
|
+
${this.retry?this.retryMsg():this.standardMsg()}
|
|
57
|
+
${this.trace?this.errorTrace():t}
|
|
58
|
+
</div>
|
|
59
|
+
`}closeDialog(){this.open=!1}render(){return this.dialog?i`<ix-dialog ?open=${this.open}>
|
|
60
|
+
<div slot="headline" class="sr-only">${s}</div>
|
|
61
|
+
<div slot="content">
|
|
62
|
+
<div>${this.errorMsg(!0)}</div>
|
|
63
|
+
<div class="dialog-footer">
|
|
64
|
+
<ix-button appearance="text" @click=${this.closeDialog}
|
|
65
|
+
>Close</ix-button
|
|
66
|
+
>
|
|
67
|
+
</div>
|
|
68
|
+
</div></ix-dialog
|
|
69
|
+
>`:i`<div role="alert">${this.errorMsg()}</div>`}}o([a({type:Boolean})],l.prototype,"dialog",void 0),o([a({type:Boolean})],l.prototype,"open",void 0),o([a({attribute:!1})],l.prototype,"retry",void 0),o([a({type:String})],l.prototype,"trace",void 0),o([n()],l.prototype,"copied",void 0);class p extends l{}p.styles=r`
|
|
70
|
+
ix-dialog {
|
|
71
|
+
--md-dialog-container-shape: 6px;
|
|
72
|
+
}
|
|
73
|
+
.container {
|
|
74
|
+
display: flex;
|
|
75
|
+
justify-content: center;
|
|
76
|
+
align-items: center;
|
|
77
|
+
flex-direction: column;
|
|
78
|
+
text-align: center;
|
|
79
|
+
max-width: 665px;
|
|
80
|
+
margin: 0 auto;
|
|
81
|
+
}
|
|
82
|
+
.container .error-msg {
|
|
83
|
+
margin: 0 0 1.5rem;
|
|
84
|
+
font-size: 16px;
|
|
85
|
+
line-height: 28px;
|
|
86
|
+
letter-spacing: 0.44px;
|
|
87
|
+
}
|
|
88
|
+
.error {
|
|
89
|
+
user-select: none;
|
|
90
|
+
display: inline-block;
|
|
91
|
+
--ix-icon-font-size: 88px;
|
|
92
|
+
color: rgba(255, 152, 0, 1);
|
|
93
|
+
}
|
|
94
|
+
.dialog .error {
|
|
95
|
+
--ix-icon-font-size: 66px;
|
|
96
|
+
margin-top: 0.5rem;
|
|
97
|
+
}
|
|
98
|
+
.retry {
|
|
99
|
+
width: 100%;
|
|
100
|
+
border-bottom: 1px solid rgba(9, 34, 65, 0.12);
|
|
101
|
+
}
|
|
102
|
+
.retry p {
|
|
103
|
+
margin: 0 0 16px 0;
|
|
104
|
+
font-family: Open Sans;
|
|
105
|
+
font-weight: 400;
|
|
106
|
+
font-size: 14px;
|
|
107
|
+
line-height: 24px;
|
|
108
|
+
letter-spacing: 0.25px;
|
|
109
|
+
text-align: center;
|
|
110
|
+
}
|
|
111
|
+
p {
|
|
112
|
+
font-family: Open Sans;
|
|
113
|
+
font-weight: 400;
|
|
114
|
+
font-size: 14px;
|
|
115
|
+
line-height: 24px;
|
|
116
|
+
letter-spacing: 0.25px;
|
|
117
|
+
text-align: center;
|
|
118
|
+
}
|
|
119
|
+
.retry ix-button {
|
|
120
|
+
display: inline-block;
|
|
121
|
+
margin: 0 0 24px 0;
|
|
122
|
+
}
|
|
123
|
+
h2 {
|
|
124
|
+
font-family: var(--ix-font-family, 'Red Hat Display');
|
|
125
|
+
font-weight: 700;
|
|
126
|
+
font-size: 34px;
|
|
127
|
+
line-height: 40px;
|
|
128
|
+
letter-spacing: 0.35px;
|
|
129
|
+
text-align: center;
|
|
130
|
+
margin: 1.5rem 0 16px 0;
|
|
131
|
+
}
|
|
132
|
+
.dialog h2 {
|
|
133
|
+
font-size: 24px;
|
|
134
|
+
line-height: 40px;
|
|
135
|
+
margin-top: 0.8rem;
|
|
136
|
+
letter-spacing: 0;
|
|
137
|
+
}
|
|
138
|
+
h3 {
|
|
139
|
+
font-family: Red Hat Display;
|
|
140
|
+
font-weight: 700;
|
|
141
|
+
font-size: 20px;
|
|
142
|
+
line-height: 24px;
|
|
143
|
+
letter-spacing: 0.15px;
|
|
144
|
+
text-align: center;
|
|
145
|
+
}
|
|
146
|
+
.error-trace-container {
|
|
147
|
+
width: 100%;
|
|
148
|
+
max-width: 489px;
|
|
149
|
+
}
|
|
150
|
+
.error-trace {
|
|
151
|
+
display: flex;
|
|
152
|
+
align-items: center;
|
|
153
|
+
padding-top: 16px;
|
|
154
|
+
padding-right: 24px;
|
|
155
|
+
padding-bottom: 16px;
|
|
156
|
+
padding-left: 24px;
|
|
157
|
+
background-color: var(--clr-surface, #fff);
|
|
158
|
+
gap: 8px;
|
|
159
|
+
border-radius: 12px;
|
|
160
|
+
border: 1px solid rgba(225, 228, 232, 1);
|
|
161
|
+
box-shadow: 0px 0px 0px 1px rgba(225, 228, 232, 1) inset;
|
|
162
|
+
box-shadow: 0px 12px 20px -12px rgba(0, 0, 0, 0.12);
|
|
163
|
+
--md-outlined-button-with-leading-icon-trailing-space: 1rem;
|
|
164
|
+
--md-outlined-button-with-leading-icon-leading-space: 1rem;
|
|
165
|
+
}
|
|
166
|
+
.error-trace-code {
|
|
167
|
+
flex: 1;
|
|
168
|
+
display: flex;
|
|
169
|
+
justify-content: center;
|
|
170
|
+
margin: 0;
|
|
171
|
+
font-size: 16px;
|
|
172
|
+
letter-spacing: 0.15px;
|
|
173
|
+
}
|
|
174
|
+
.error-trace ix-button {
|
|
175
|
+
flex-shrink: 0;
|
|
176
|
+
}
|
|
177
|
+
.dialog-footer {
|
|
178
|
+
display: flex;
|
|
179
|
+
justify-content: flex-end;
|
|
180
|
+
margin: 1.5rem -1rem 0 0;
|
|
181
|
+
}
|
|
182
|
+
.visually-hidden {
|
|
183
|
+
position: absolute;
|
|
184
|
+
width: 1px;
|
|
185
|
+
height: 1px;
|
|
186
|
+
padding: 0;
|
|
187
|
+
margin: -1px;
|
|
188
|
+
overflow: hidden;
|
|
189
|
+
clip: rect(0, 0, 0, 0);
|
|
190
|
+
white-space: nowrap;
|
|
191
|
+
border: 0;
|
|
192
|
+
}
|
|
193
|
+
.sr-only {
|
|
194
|
+
position: absolute;
|
|
195
|
+
width: 1px;
|
|
196
|
+
height: 1px;
|
|
197
|
+
margin: -1px;
|
|
198
|
+
padding: 0;
|
|
199
|
+
overflow: hidden;
|
|
200
|
+
clip: rect(0, 0, 0, 0);
|
|
201
|
+
clip-path: inset(50%);
|
|
202
|
+
white-space: nowrap;
|
|
203
|
+
border: 0;
|
|
204
|
+
}
|
|
205
|
+
`,customElements.get("ix-error-message")||customElements.define("ix-error-message",p);export{p as IxErrorMessageStyled};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { createComponent } from '@lit/react';
|
|
3
|
+
import { IxErrorMessageStyled } from '../ix-error-message.js';
|
|
4
|
+
export const IxErrorMessage = createComponent({
|
|
5
|
+
tagName: 'ix-error-message',
|
|
6
|
+
elementClass: IxErrorMessageStyled,
|
|
7
|
+
react: React,
|
|
8
|
+
});
|
|
9
|
+
//# sourceMappingURL=IxErrorMessage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IxErrorMessage.js","sourceRoot":"","sources":["../../src/react/IxErrorMessage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAI9D,MAAM,CAAC,MAAM,cAAc,GAAG,eAAe,CAAC;IAC5C,OAAO,EAAE,kBAAkB;IAC3B,YAAY,EAAE,oBAAoB;IAClC,KAAK,EAAE,KAAK;CACb,CAAC,CAAC","sourcesContent":["import React from 'react';\nimport { createComponent } from '@lit/react';\nimport { IxErrorMessageStyled } from '../ix-error-message.js';\n\nexport type IxErrorMessageElement = IxErrorMessageStyled;\n\nexport const IxErrorMessage = createComponent({\n tagName: 'ix-error-message',\n elementClass: IxErrorMessageStyled,\n react: React,\n});\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,107 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@digital-realty/ix-error-message",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"description": "Webcomponent ix-error-message following open-wc recommendations",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"author": "Digital Realty",
|
|
6
|
+
"version": "0.0.2-IXUAT-11213.568835",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"main": "dist/index.js",
|
|
9
|
+
"module": "dist/index.js",
|
|
10
|
+
"types": "dist/index.d.ts",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
|
+
"default": "./dist/index.js"
|
|
15
|
+
},
|
|
16
|
+
"./ix-error-message.js": "./dist/ix-error-message.js",
|
|
17
|
+
"./ix-error-message.min.js": "./dist/ix-error-message.min.js",
|
|
18
|
+
"./IxErrorMessage": "./dist/react/IxErrorMessage.js"
|
|
19
|
+
},
|
|
20
|
+
"publishConfig": {
|
|
21
|
+
"access": "public"
|
|
22
|
+
},
|
|
23
|
+
"scripts": {
|
|
24
|
+
"analyze": "cem analyze --litelement",
|
|
25
|
+
"start": "tsc && concurrently -k -r \"tsc --watch --preserveWatchOutput\" \"wds\"",
|
|
26
|
+
"build": "tsc && pnpm run analyze --exclude dist && rollup -c",
|
|
27
|
+
"prepublish": "tsc && pnpm run analyze --exclude dist",
|
|
28
|
+
"lint": "eslint --ext .ts,.html . && prettier \"**/*.ts\" --check --ignore-path .gitignore",
|
|
29
|
+
"format": "eslint --ext .ts,.html . --fix && prettier \"**/*.ts\" --write --ignore-path .gitignore",
|
|
30
|
+
"test": "tsc && wtr --coverage",
|
|
31
|
+
"test:watch": "tsc && concurrently -k -r \"tsc --watch --preserveWatchOutput\" \"wtr --watch\""
|
|
32
|
+
},
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"@digital-realty/ix-button": "^3.5.10",
|
|
35
|
+
"@digital-realty/ix-dialog": "^1.3.10-IXUAT-11213.568835",
|
|
36
|
+
"@digital-realty/ix-icon": "^1.3.5",
|
|
37
|
+
"@lit/react": "^1.0.2",
|
|
38
|
+
"@material/web": "2.4.0",
|
|
39
|
+
"@open-wc/lit-helpers": "^0.7.0",
|
|
40
|
+
"lit": "^3.2.1",
|
|
41
|
+
"react": "^18.2.0"
|
|
42
|
+
},
|
|
43
|
+
"devDependencies": {
|
|
44
|
+
"@custom-elements-manifest/analyzer": "^0.4.17",
|
|
45
|
+
"@open-wc/testing": "^3.1.6",
|
|
46
|
+
"@rollup/plugin-terser": "^1.0.0",
|
|
47
|
+
"@types/react": "^18.2.22",
|
|
48
|
+
"@typescript-eslint/eslint-plugin": "^8.58.2",
|
|
49
|
+
"@typescript-eslint/parser": "^8.58.2",
|
|
50
|
+
"@web/dev-server": "^0.4.6",
|
|
51
|
+
"@web/test-runner": "^0.20.2",
|
|
52
|
+
"@web/test-runner-commands": "^0.9.0",
|
|
53
|
+
"concurrently": "^9.2.1",
|
|
54
|
+
"eslint": "^9.39.4",
|
|
55
|
+
"eslint-config-prettier": "^8.3.0",
|
|
56
|
+
"lint-staged": "^10.5.4",
|
|
57
|
+
"prettier": "^2.4.1",
|
|
58
|
+
"rollup": "^4.29.1",
|
|
59
|
+
"rollup-plugin-summary": "^2.0.0",
|
|
60
|
+
"tslib": "^2.3.1",
|
|
61
|
+
"typescript": "^5.1.6"
|
|
62
|
+
},
|
|
63
|
+
"customElements": "custom-elements.json",
|
|
64
|
+
"eslintConfig": {
|
|
65
|
+
"parser": "@typescript-eslint/parser",
|
|
66
|
+
"root": true,
|
|
67
|
+
"plugins": [
|
|
68
|
+
"@typescript-eslint"
|
|
69
|
+
],
|
|
70
|
+
"rules": {
|
|
71
|
+
"no-unused-vars": "off",
|
|
72
|
+
"@typescript-eslint/no-unused-vars": [
|
|
73
|
+
"error"
|
|
74
|
+
],
|
|
75
|
+
"class-methods-use-this": "off",
|
|
76
|
+
"import/no-unresolved": "off",
|
|
77
|
+
"import/extensions": [
|
|
78
|
+
"error",
|
|
79
|
+
"always",
|
|
80
|
+
{
|
|
81
|
+
"ignorePackages": true
|
|
82
|
+
}
|
|
83
|
+
]
|
|
84
|
+
},
|
|
85
|
+
"globals": {
|
|
86
|
+
"ShadowRootInit": true
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
"prettier": {
|
|
90
|
+
"singleQuote": true,
|
|
91
|
+
"arrowParens": "avoid"
|
|
92
|
+
},
|
|
93
|
+
"lint-staged": {
|
|
94
|
+
"*.ts": [
|
|
95
|
+
"eslint --fix",
|
|
96
|
+
"prettier --write"
|
|
97
|
+
]
|
|
98
|
+
},
|
|
99
|
+
"files": [
|
|
100
|
+
"/dist",
|
|
101
|
+
"!/dist/test",
|
|
102
|
+
"package.json",
|
|
103
|
+
"README.md",
|
|
104
|
+
"LICENSE"
|
|
105
|
+
],
|
|
106
|
+
"gitHead": "cd532c645f5d27ffe2619268429574278ac864b5"
|
|
107
|
+
}
|