etherpad-webcomponents 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.
Files changed (66) hide show
  1. package/LICENSE +21 -0
  2. package/dist/EpButton.d.ts +16 -0
  3. package/dist/EpButton.d.ts.map +1 -0
  4. package/dist/EpButton.js +148 -0
  5. package/dist/EpButton.js.map +1 -0
  6. package/dist/EpCard.d.ts +15 -0
  7. package/dist/EpCard.d.ts.map +1 -0
  8. package/dist/EpCard.js +126 -0
  9. package/dist/EpCard.js.map +1 -0
  10. package/dist/EpChatMessage.d.ts +15 -0
  11. package/dist/EpChatMessage.d.ts.map +1 -0
  12. package/dist/EpChatMessage.js +86 -0
  13. package/dist/EpChatMessage.js.map +1 -0
  14. package/dist/EpCheckbox.d.ts +15 -0
  15. package/dist/EpCheckbox.d.ts.map +1 -0
  16. package/dist/EpCheckbox.js +122 -0
  17. package/dist/EpCheckbox.js.map +1 -0
  18. package/dist/EpColorPicker.d.ts +16 -0
  19. package/dist/EpColorPicker.d.ts.map +1 -0
  20. package/dist/EpColorPicker.js +188 -0
  21. package/dist/EpColorPicker.js.map +1 -0
  22. package/dist/EpColorWheel.d.ts +61 -0
  23. package/dist/EpColorWheel.d.ts.map +1 -0
  24. package/dist/EpColorWheel.js +428 -0
  25. package/dist/EpColorWheel.js.map +1 -0
  26. package/dist/EpDropdown.d.ts +41 -0
  27. package/dist/EpDropdown.d.ts.map +1 -0
  28. package/dist/EpDropdown.js +272 -0
  29. package/dist/EpDropdown.js.map +1 -0
  30. package/dist/EpDropdownItem.d.ts +16 -0
  31. package/dist/EpDropdownItem.d.ts.map +1 -0
  32. package/dist/EpDropdownItem.js +88 -0
  33. package/dist/EpDropdownItem.js.map +1 -0
  34. package/dist/EpInput.d.ts +20 -0
  35. package/dist/EpInput.d.ts.map +1 -0
  36. package/dist/EpInput.js +149 -0
  37. package/dist/EpInput.js.map +1 -0
  38. package/dist/EpModal.d.ts +45 -0
  39. package/dist/EpModal.d.ts.map +1 -0
  40. package/dist/EpModal.js +210 -0
  41. package/dist/EpModal.js.map +1 -0
  42. package/dist/EpNotification.d.ts +32 -0
  43. package/dist/EpNotification.d.ts.map +1 -0
  44. package/dist/EpNotification.js +215 -0
  45. package/dist/EpNotification.js.map +1 -0
  46. package/dist/EpTheme.d.ts +33 -0
  47. package/dist/EpTheme.d.ts.map +1 -0
  48. package/dist/EpTheme.js +109 -0
  49. package/dist/EpTheme.js.map +1 -0
  50. package/dist/EpToast.d.ts +37 -0
  51. package/dist/EpToast.d.ts.map +1 -0
  52. package/dist/EpToast.js +220 -0
  53. package/dist/EpToast.js.map +1 -0
  54. package/dist/EpToolbarSelect.d.ts +24 -0
  55. package/dist/EpToolbarSelect.d.ts.map +1 -0
  56. package/dist/EpToolbarSelect.js +138 -0
  57. package/dist/EpToolbarSelect.js.map +1 -0
  58. package/dist/EpUserBadge.d.ts +15 -0
  59. package/dist/EpUserBadge.d.ts.map +1 -0
  60. package/dist/EpUserBadge.js +90 -0
  61. package/dist/EpUserBadge.js.map +1 -0
  62. package/dist/index.d.ts +17 -0
  63. package/dist/index.d.ts.map +1 -0
  64. package/dist/index.js +16 -0
  65. package/dist/index.js.map +1 -0
  66. package/package.json +43 -0
@@ -0,0 +1,45 @@
1
+ import { LitElement, PropertyValues } from 'lit';
2
+ interface ConfirmOptions {
3
+ title: string;
4
+ message: string;
5
+ confirmText?: string;
6
+ cancelText?: string;
7
+ }
8
+ interface PromptOptions {
9
+ title: string;
10
+ message: string;
11
+ placeholder?: string;
12
+ }
13
+ export declare class EpModal extends LitElement {
14
+ static properties: {
15
+ open: {
16
+ type: BooleanConstructor;
17
+ reflect: boolean;
18
+ };
19
+ modalTitle: {
20
+ attribute: string;
21
+ };
22
+ };
23
+ static styles: import("lit").CSSResult;
24
+ open: boolean;
25
+ modalTitle: string;
26
+ private _previousFocus;
27
+ private _boundKeyDown;
28
+ constructor();
29
+ protected updated(changed: PropertyValues): void;
30
+ close(action?: string): void;
31
+ protected render(): import("lit").TemplateResult<1>;
32
+ private _onOpen;
33
+ private _onClose;
34
+ private _handleKeyDown;
35
+ private _trapFocus;
36
+ static confirm(options: ConfirmOptions): Promise<boolean>;
37
+ static prompt(options: PromptOptions): Promise<string | null>;
38
+ }
39
+ declare global {
40
+ interface HTMLElementTagNameMap {
41
+ 'ep-modal': EpModal;
42
+ }
43
+ }
44
+ export {};
45
+ //# sourceMappingURL=EpModal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EpModal.d.ts","sourceRoot":"","sources":["../src/EpModal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,cAAc,EAAE,MAAM,KAAK,CAAC;AAE5D,UAAU,cAAc;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,UAAU,aAAa;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,qBAAa,OAAQ,SAAQ,UAAU;IACrC,OAAgB,UAAU;;;;;;;;MAGxB;IAEF,OAAgB,MAAM,0BAgEpB;IAEF,IAAI,EAAE,OAAO,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IAEnB,OAAO,CAAC,cAAc,CAA4B;IAClD,OAAO,CAAC,aAAa,CAA6B;;cAS/B,OAAO,CAAC,OAAO,EAAE,cAAc;IAOlD,KAAK,CAAC,MAAM,CAAC,EAAE,MAAM;cAOF,MAAM;IAgBzB,OAAO,CAAC,OAAO;IAQf,OAAO,CAAC,QAAQ;IAMhB,OAAO,CAAC,cAAc;IAUtB,OAAO,CAAC,UAAU;IAkBlB,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC;IAwBzD,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;CA8B9D;AAMD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,UAAU,EAAE,OAAO,CAAC;KACrB;CACF"}
@@ -0,0 +1,210 @@
1
+ import { LitElement, html, css } from 'lit';
2
+ export class EpModal extends LitElement {
3
+ constructor() {
4
+ super();
5
+ this._previousFocus = null;
6
+ this.open = false;
7
+ this.modalTitle = '';
8
+ this._boundKeyDown = this._handleKeyDown.bind(this);
9
+ }
10
+ updated(changed) {
11
+ if (changed.has('open')) {
12
+ if (this.open)
13
+ this._onOpen();
14
+ else
15
+ this._onClose();
16
+ }
17
+ }
18
+ close(action) {
19
+ this.dispatchEvent(new CustomEvent('ep-modal-close', {
20
+ bubbles: true, composed: true, detail: { action },
21
+ }));
22
+ this.open = false;
23
+ }
24
+ render() {
25
+ return html `
26
+ <div class="overlay" part="overlay" @click="${() => this.close()}"></div>
27
+ <div class="dialog" role="dialog" aria-modal="true"
28
+ aria-labelledby="ep-modal-title" tabindex="-1">
29
+ <div class="header">
30
+ <h2 class="title" id="ep-modal-title">${this.modalTitle}</h2>
31
+ <button class="close-btn" aria-label="Close"
32
+ @click="${() => this.close()}">&times;</button>
33
+ </div>
34
+ <div class="body"><slot></slot></div>
35
+ <div class="actions"><slot name="actions"></slot></div>
36
+ </div>
37
+ `;
38
+ }
39
+ _onOpen() {
40
+ this._previousFocus = document.activeElement instanceof HTMLElement
41
+ ? document.activeElement : null;
42
+ document.addEventListener('keydown', this._boundKeyDown);
43
+ const dialog = this.renderRoot?.querySelector('.dialog');
44
+ requestAnimationFrame(() => dialog?.focus());
45
+ }
46
+ _onClose() {
47
+ document.removeEventListener('keydown', this._boundKeyDown);
48
+ this._previousFocus?.focus();
49
+ this._previousFocus = null;
50
+ }
51
+ _handleKeyDown(e) {
52
+ if (e.key === 'Escape') {
53
+ e.preventDefault();
54
+ e.stopPropagation();
55
+ this.close();
56
+ return;
57
+ }
58
+ if (e.key === 'Tab')
59
+ this._trapFocus(e);
60
+ }
61
+ _trapFocus(e) {
62
+ const selector = 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])';
63
+ const shadowEls = Array.from(this.renderRoot.querySelectorAll(selector));
64
+ const lightEls = Array.from(this.querySelectorAll(selector));
65
+ const focusable = [...shadowEls, ...lightEls].filter(el => !el.hasAttribute('disabled') && el.offsetParent !== null);
66
+ if (!focusable.length)
67
+ return;
68
+ const first = focusable[0];
69
+ const last = focusable[focusable.length - 1];
70
+ const active = this.renderRoot.activeElement ?? document.activeElement;
71
+ if (e.shiftKey) {
72
+ if (active === first || !focusable.includes(active)) {
73
+ e.preventDefault();
74
+ last.focus();
75
+ }
76
+ }
77
+ else {
78
+ if (active === last || !focusable.includes(active)) {
79
+ e.preventDefault();
80
+ first.focus();
81
+ }
82
+ }
83
+ }
84
+ static confirm(options) {
85
+ return new Promise(resolve => {
86
+ const modal = document.createElement('ep-modal');
87
+ modal.modalTitle = options.title;
88
+ const body = document.createElement('p');
89
+ body.textContent = options.message;
90
+ body.style.margin = '0';
91
+ modal.appendChild(body);
92
+ const actions = document.createElement('div');
93
+ actions.setAttribute('slot', 'actions');
94
+ const cancelBtn = document.createElement('button');
95
+ cancelBtn.textContent = options.cancelText ?? 'Cancel';
96
+ cancelBtn.addEventListener('click', () => { resolve(false); modal.remove(); });
97
+ const confirmBtn = document.createElement('button');
98
+ confirmBtn.textContent = options.confirmText ?? 'Confirm';
99
+ confirmBtn.addEventListener('click', () => { resolve(true); modal.remove(); });
100
+ actions.append(cancelBtn, confirmBtn);
101
+ modal.appendChild(actions);
102
+ document.body.appendChild(modal);
103
+ modal.addEventListener('ep-modal-close', () => { resolve(false); modal.remove(); });
104
+ modal.open = true;
105
+ });
106
+ }
107
+ static prompt(options) {
108
+ return new Promise(resolve => {
109
+ const modal = document.createElement('ep-modal');
110
+ modal.modalTitle = options.title;
111
+ const container = document.createElement('div');
112
+ const msg = document.createElement('p');
113
+ msg.textContent = options.message;
114
+ msg.style.margin = '0';
115
+ const input = document.createElement('input');
116
+ input.type = 'text';
117
+ input.placeholder = options.placeholder ?? '';
118
+ input.style.cssText = 'width:100%;box-sizing:border-box;padding:8px 10px;border:1px solid var(--middle-color,#d2d2d2);border-radius:3px;font-size:14px;margin-top:12px;outline:none;background:var(--bg-soft-color,#f2f3f4);color:var(--text-color,#485365);';
119
+ container.append(msg, input);
120
+ modal.appendChild(container);
121
+ const actions = document.createElement('div');
122
+ actions.setAttribute('slot', 'actions');
123
+ const cancelBtn = document.createElement('button');
124
+ cancelBtn.textContent = 'Cancel';
125
+ cancelBtn.addEventListener('click', () => { resolve(null); modal.remove(); });
126
+ const confirmBtn = document.createElement('button');
127
+ confirmBtn.textContent = 'OK';
128
+ confirmBtn.addEventListener('click', () => { resolve(input.value); modal.remove(); });
129
+ actions.append(cancelBtn, confirmBtn);
130
+ modal.appendChild(actions);
131
+ document.body.appendChild(modal);
132
+ modal.addEventListener('ep-modal-close', () => { resolve(null); modal.remove(); });
133
+ modal.open = true;
134
+ requestAnimationFrame(() => input.focus());
135
+ });
136
+ }
137
+ }
138
+ EpModal.properties = {
139
+ open: { type: Boolean, reflect: true },
140
+ modalTitle: { attribute: 'modal-title' },
141
+ };
142
+ EpModal.styles = css `
143
+ :host {
144
+ --ep-font: var(--main-font-family, Quicksand, Cantarell, "Open Sans", "Helvetica Neue", sans-serif);
145
+ position: fixed;
146
+ inset: 0;
147
+ z-index: 10001;
148
+ display: none;
149
+ align-items: center;
150
+ justify-content: center;
151
+ font-family: var(--ep-font);
152
+ font-size: 14px;
153
+ color: var(--text-color, #485365);
154
+ }
155
+ :host([open]) { display: flex; }
156
+ .overlay {
157
+ position: fixed; inset: 0;
158
+ background: rgba(72, 83, 101, 0.3);
159
+ animation: ep-modal-fade-in 0.15s ease;
160
+ }
161
+ .dialog {
162
+ position: relative; z-index: 1;
163
+ background: var(--bg-color, white);
164
+ border-radius: 5px;
165
+ box-shadow: 0 0 0 1px rgba(99, 114, 130, 0.16), 0 8px 16px rgba(27, 39, 51, 0.08);
166
+ max-width: 480px; width: calc(100vw - 32px);
167
+ max-height: calc(100vh - 64px); overflow: auto;
168
+ animation: ep-modal-scale-in 0.2s ease; outline: none;
169
+ }
170
+ .header {
171
+ display: flex; align-items: center; justify-content: space-between;
172
+ padding: 20px 25px 0;
173
+ }
174
+ .title { margin: 0; font-size: 1.2rem; font-weight: 700; line-height: 1.4; color: var(--text-color, #485365); }
175
+ .close-btn {
176
+ background: none; border: none; cursor: pointer; padding: 4px;
177
+ margin: -4px -4px 0 8px; color: var(--text-soft-color, #576273);
178
+ opacity: 0.5; transition: opacity 0.15s ease; font-size: 18px; line-height: 1;
179
+ display: flex; align-items: center; justify-content: center; border-radius: 4px;
180
+ }
181
+ .close-btn:hover, .close-btn:focus-visible { opacity: 1; }
182
+ .close-btn:focus-visible { outline: 2px solid var(--primary-color, #64d29b); outline-offset: 2px; }
183
+ .body { padding: 20px 25px; line-height: 1.6; }
184
+ .actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 0 25px 20px; }
185
+ .actions ::slotted(button), .actions button {
186
+ padding: 5px 20px; border-radius: 4px; font-size: 14px; font-weight: 700;
187
+ text-transform: uppercase; cursor: pointer;
188
+ transition: background 0.15s ease, border-color 0.15s ease;
189
+ font-family: inherit; line-height: 1.5;
190
+ }
191
+ .btn-cancel { background: transparent; border: 1px solid var(--middle-color, #d2d2d2); color: var(--text-color, #485365); }
192
+ .btn-cancel:hover { background: var(--bg-soft-color, #f2f3f4); }
193
+ .btn-confirm { background: var(--text-color, #485365); border: 1px solid var(--text-color, #485365); color: white; }
194
+ .btn-confirm:hover { background: var(--dark-color, #576273); }
195
+ .prompt-input {
196
+ width: 100%; box-sizing: border-box; padding: 8px 10px;
197
+ border: 1px solid var(--middle-color, #d2d2d2); border-radius: 3px;
198
+ font-size: 14px; font-family: inherit;
199
+ background: var(--bg-soft-color, #f2f3f4); color: var(--text-color, #485365);
200
+ margin-top: 12px; outline: none; transition: border-color 0.15s ease;
201
+ }
202
+ .prompt-input:focus { border-color: var(--dark-color, #576273); }
203
+ .prompt-input::placeholder { color: var(--text-soft-color, #576273); }
204
+ @keyframes ep-modal-fade-in { from { opacity: 0; } to { opacity: 1; } }
205
+ @keyframes ep-modal-scale-in { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: scale(1); } }
206
+ `;
207
+ if (!customElements.get('ep-modal')) {
208
+ customElements.define('ep-modal', EpModal);
209
+ }
210
+ //# sourceMappingURL=EpModal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EpModal.js","sourceRoot":"","sources":["../src/EpModal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAkB,MAAM,KAAK,CAAC;AAe5D,MAAM,OAAO,OAAQ,SAAQ,UAAU;IA8ErC;QACE,KAAK,EAAE,CAAC;QAJF,mBAAc,GAAuB,IAAI,CAAC;QAKhD,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC;QAClB,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;QACrB,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACtD,CAAC;IAEkB,OAAO,CAAC,OAAuB;QAChD,IAAI,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;YACxB,IAAI,IAAI,CAAC,IAAI;gBAAE,IAAI,CAAC,OAAO,EAAE,CAAC;;gBACzB,IAAI,CAAC,QAAQ,EAAE,CAAC;QACvB,CAAC;IACH,CAAC;IAED,KAAK,CAAC,MAAe;QACnB,IAAI,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,gBAAgB,EAAE;YACnD,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE;SAClD,CAAC,CAAC,CAAC;QACJ,IAAI,CAAC,IAAI,GAAG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,CAAC;IACpC,cAAc,CAAC,MAAM,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;AAC7C,CAAC"}
@@ -0,0 +1,32 @@
1
+ import { LitElement } from 'lit';
2
+ type NotificationPosition = 'top' | 'bottom';
3
+ type NotificationType = 'success' | 'error' | 'info';
4
+ interface NotificationOptions {
5
+ text: string;
6
+ type?: NotificationType;
7
+ duration?: number;
8
+ position?: NotificationPosition;
9
+ }
10
+ export declare class EpNotification extends LitElement {
11
+ static styles: import("lit").CSSResult;
12
+ type: NotificationType;
13
+ position: NotificationPosition;
14
+ duration: number;
15
+ private _dismissTimer;
16
+ connectedCallback(): void;
17
+ disconnectedCallback(): void;
18
+ dismiss(): void;
19
+ render(): import("lit").TemplateResult<1>;
20
+ private _startAutoClose;
21
+ private _clearTimer;
22
+ static show(options: NotificationOptions): EpNotification;
23
+ static success(text: string, duration?: number): EpNotification;
24
+ static error(text: string, duration?: number): EpNotification;
25
+ }
26
+ declare global {
27
+ interface HTMLElementTagNameMap {
28
+ 'ep-notification': EpNotification;
29
+ }
30
+ }
31
+ export {};
32
+ //# sourceMappingURL=EpNotification.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EpNotification.d.ts","sourceRoot":"","sources":["../src/EpNotification.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAI5C,KAAK,oBAAoB,GAAG,KAAK,GAAG,QAAQ,CAAC;AAC7C,KAAK,gBAAgB,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC;AAErD,UAAU,mBAAmB;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,oBAAoB,CAAC;CACjC;AA+BD,qBACa,cAAe,SAAQ,UAAU;IAC5C,MAAM,CAAC,MAAM,0BA2FX;IAE2B,IAAI,EAAE,gBAAgB,CAAU;IAChC,QAAQ,EAAE,oBAAoB,CAAS;IACxC,QAAQ,SAAQ;IAE5C,OAAO,CAAC,aAAa,CAA8C;IAEnE,iBAAiB;IAOjB,oBAAoB;IAKpB,OAAO;IAgBP,MAAM;IAYN,OAAO,CAAC,eAAe;IAMvB,OAAO,CAAC,WAAW;IAOnB,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,mBAAmB,GAAG,cAAc;IAUzD,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM;IAI9C,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM;CAG7C;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,iBAAiB,EAAE,cAAc,CAAC;KACnC;CACF"}
@@ -0,0 +1,215 @@
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
+ var EpNotification_1;
8
+ import { LitElement, html, css } from 'lit';
9
+ import { customElement, property } from 'lit/decorators.js';
10
+ import { unsafeHTML } from 'lit/directives/unsafe-html.js';
11
+ const iconSvg = {
12
+ success: `<svg class="icon" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z" clip-rule="evenodd"/></svg>`,
13
+ error: `<svg class="icon" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm1-11a1 1 0 10-2 0v4a1 1 0 102 0V7zm-1 8a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"/></svg>`,
14
+ info: `<svg class="icon" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z" clip-rule="evenodd"/></svg>`,
15
+ };
16
+ const ensureContainer = (position) => {
17
+ const id = `ep-notification-container-${position}`;
18
+ let container = document.getElementById(id);
19
+ if (container)
20
+ return container;
21
+ container = document.createElement('div');
22
+ container.id = id;
23
+ Object.assign(container.style, {
24
+ position: 'fixed',
25
+ [position === 'top' ? 'top' : 'bottom']: '16px',
26
+ right: '16px',
27
+ zIndex: '10000',
28
+ display: 'flex',
29
+ flexDirection: position === 'top' ? 'column' : 'column-reverse',
30
+ gap: '8px',
31
+ pointerEvents: 'none',
32
+ maxWidth: '100vw',
33
+ width: '420px',
34
+ });
35
+ document.body.appendChild(container);
36
+ return container;
37
+ };
38
+ let EpNotification = EpNotification_1 = class EpNotification extends LitElement {
39
+ constructor() {
40
+ super(...arguments);
41
+ this.type = 'info';
42
+ this.position = 'top';
43
+ this.duration = 3000;
44
+ this._dismissTimer = null;
45
+ }
46
+ connectedCallback() {
47
+ super.connectedCallback();
48
+ this.style.setProperty('--ep-slide-dir', this.position === 'bottom' ? '1' : '-1');
49
+ requestAnimationFrame(() => this.setAttribute('visible', ''));
50
+ this._startAutoClose();
51
+ }
52
+ disconnectedCallback() {
53
+ super.disconnectedCallback();
54
+ this._clearTimer();
55
+ }
56
+ dismiss() {
57
+ this._clearTimer();
58
+ this.removeAttribute('visible');
59
+ this.setAttribute('removing', '');
60
+ const onDone = () => {
61
+ this.removeEventListener('transitionend', onDone);
62
+ this.remove();
63
+ for (const pos of ['top', 'bottom']) {
64
+ const c = document.getElementById(`ep-notification-container-${pos}`);
65
+ if (c && c.children.length === 0)
66
+ c.remove();
67
+ }
68
+ };
69
+ this.addEventListener('transitionend', onDone);
70
+ setTimeout(onDone, 350);
71
+ }
72
+ render() {
73
+ const icon = iconSvg[this.type] ?? iconSvg.info;
74
+ return html `
75
+ <div class="notification" role="alert" aria-live="assertive">
76
+ ${unsafeHTML(icon)}
77
+ <div class="body"><slot></slot></div>
78
+ <button class="close" aria-label="Close notification"
79
+ @click="${() => this.dismiss()}">&times;</button>
80
+ </div>
81
+ `;
82
+ }
83
+ _startAutoClose() {
84
+ if (this.duration > 0) {
85
+ this._dismissTimer = setTimeout(() => this.dismiss(), this.duration);
86
+ }
87
+ }
88
+ _clearTimer() {
89
+ if (this._dismissTimer != null) {
90
+ clearTimeout(this._dismissTimer);
91
+ this._dismissTimer = null;
92
+ }
93
+ }
94
+ static show(options) {
95
+ const el = document.createElement('ep-notification');
96
+ el.type = options.type ?? 'info';
97
+ el.duration = options.duration ?? 3000;
98
+ el.position = options.position ?? 'top';
99
+ el.textContent = options.text;
100
+ ensureContainer(el.position).appendChild(el);
101
+ return el;
102
+ }
103
+ static success(text, duration) {
104
+ return EpNotification_1.show({ text, type: 'success', duration });
105
+ }
106
+ static error(text, duration) {
107
+ return EpNotification_1.show({ text, type: 'error', duration: duration ?? 5000 });
108
+ }
109
+ };
110
+ EpNotification.styles = css `
111
+ :host {
112
+ --ep-font: var(--main-font-family, Quicksand, Cantarell, "Open Sans", "Helvetica Neue", sans-serif);
113
+ --ep-radius: 5px;
114
+ --ep-shadow: 0 0 0 1px rgba(99, 114, 130, 0.16), 0 8px 16px rgba(27, 39, 51, 0.08);
115
+
116
+ display: block;
117
+ pointer-events: auto;
118
+ font-family: var(--ep-font);
119
+ font-size: 14px;
120
+ line-height: 1.5;
121
+ max-width: 420px;
122
+ width: 100%;
123
+ box-sizing: border-box;
124
+ opacity: 0;
125
+ transform: translateY(calc(var(--ep-slide-dir, -1) * 12px));
126
+ transition: opacity 0.25s ease, transform 0.25s ease;
127
+ }
128
+
129
+ :host([visible]) {
130
+ opacity: 1;
131
+ transform: translateY(0);
132
+ }
133
+
134
+ :host([removing]) {
135
+ opacity: 0;
136
+ transform: translateY(calc(var(--ep-slide-dir, -1) * 12px));
137
+ transition: opacity 0.2s ease, transform 0.2s ease;
138
+ }
139
+
140
+ .notification {
141
+ display: flex;
142
+ align-items: flex-start;
143
+ gap: 10px;
144
+ padding: 12px 16px;
145
+ border-radius: var(--ep-radius);
146
+ box-shadow: var(--ep-shadow);
147
+ background: var(--bg-color, white);
148
+ color: var(--text-color, #485365);
149
+ border-left: 3px solid var(--middle-color, #d2d2d2);
150
+ }
151
+
152
+ :host([type="success"]) .notification {
153
+ border-left-color: var(--primary-color, #64d29b);
154
+ }
155
+
156
+ :host([type="error"]) .notification {
157
+ border-left-color: #d9534f;
158
+ }
159
+
160
+ :host([type="info"]) .notification {
161
+ border-left-color: var(--dark-color, #576273);
162
+ }
163
+
164
+ .icon {
165
+ flex-shrink: 0;
166
+ width: 18px;
167
+ height: 18px;
168
+ margin-top: 1px;
169
+ }
170
+
171
+ :host([type="success"]) .icon { color: var(--primary-color, #64d29b); }
172
+ :host([type="error"]) .icon { color: #d9534f; }
173
+ :host([type="info"]) .icon { color: var(--dark-color, #576273); }
174
+
175
+ .body { flex: 1; min-width: 0; word-wrap: break-word; }
176
+
177
+ .close {
178
+ flex-shrink: 0;
179
+ background: none;
180
+ border: none;
181
+ color: var(--text-soft-color, #576273);
182
+ cursor: pointer;
183
+ padding: 0;
184
+ opacity: 0.6;
185
+ transition: opacity 0.15s ease;
186
+ line-height: 1;
187
+ font-size: 18px;
188
+ width: 20px;
189
+ height: 20px;
190
+ display: flex;
191
+ align-items: center;
192
+ justify-content: center;
193
+ }
194
+
195
+ .close:hover, .close:focus-visible { opacity: 1; }
196
+ .close:focus-visible {
197
+ outline: 2px solid var(--primary-color, #64d29b);
198
+ outline-offset: 2px;
199
+ border-radius: 2px;
200
+ }
201
+ `;
202
+ __decorate([
203
+ property({ reflect: true })
204
+ ], EpNotification.prototype, "type", void 0);
205
+ __decorate([
206
+ property({ reflect: true })
207
+ ], EpNotification.prototype, "position", void 0);
208
+ __decorate([
209
+ property({ type: Number })
210
+ ], EpNotification.prototype, "duration", void 0);
211
+ EpNotification = EpNotification_1 = __decorate([
212
+ customElement('ep-notification')
213
+ ], EpNotification);
214
+ export { EpNotification };
215
+ //# sourceMappingURL=EpNotification.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EpNotification.js","sourceRoot":"","sources":["../src/EpNotification.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAY3D,MAAM,OAAO,GAA2B;IACtC,OAAO,EAAE,wOAAwO;IACjP,KAAK,EAAE,wNAAwN;IAC/N,IAAI,EAAE,sPAAsP;CAC7P,CAAC;AAEF,MAAM,eAAe,GAAG,CAAC,QAA8B,EAAe,EAAE;IACtE,MAAM,EAAE,GAAG,6BAA6B,QAAQ,EAAE,CAAC;IACnD,IAAI,SAAS,GAAG,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC;IAC5C,IAAI,SAAS;QAAE,OAAO,SAAS,CAAC;IAEhC,SAAS,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAC1C,SAAS,CAAC,EAAE,GAAG,EAAE,CAAC;IAClB,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,EAAE;QAC7B,QAAQ,EAAE,OAAO;QACjB,CAAC,QAAQ,KAAK,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,MAAM;QAC/C,KAAK,EA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{
3
+ '--bg-color': string;
4
+ '--bg-soft-color': string;
5
+ '--text-color': string;
6
+ '--text-soft-color': string;
7
+ '--middle-color': string;
8
+ '--dark-color': string;
9
+ '--super-dark-color': string;
10
+ '--light-color': string;
11
+ '--super-light-color': string;
12
+ '--primary-color': string;
13
+ '--main-font-family': string;
14
+ }
15
+ export declare const themes: Record<string, ThemeTokens>;
16
+ export declare class EpTheme extends LitElement {
17
+ static styles: import("lit").CSSResult;
18
+ name: string;
19
+ updated(changed: Map<string, unknown>): void;
20
+ connectedCallback(): void;
21
+ private _applyTokens;
22
+ render(): import("lit").TemplateResult<1>;
23
+ /** Register a custom theme at runtime. */
24
+ static registerTheme(name: string, tokens: ThemeTokens): void;
25
+ /** Get all registered theme names. */
26
+ static get themeNames(): string[];
27
+ }
28
+ declare global {
29
+ interface HTMLElementTagNameMap {
30
+ 'ep-theme': EpTheme;
31
+ }
32
+ }
33
+ //# sourceMappingURL=EpTheme.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EpTheme.d.ts","sourceRoot":"","sources":["../src/EpTheme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAG5C,MAAM,WAAW,WAAW;IAC1B,YAAY,EAAE,MAAM,CAAC;IACrB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,cAAc,EAAE,MAAM,CAAC;IACvB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,gBAAgB,EAAE,MAAM,CAAC;IACzB,cAAc,EAAE,MAAM,CAAC;IACvB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,eAAe,EAAE,MAAM,CAAC;IACxB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,oBAAoB,EAAE,MAAM,CAAC;CAC9B;AAED,eAAO,MAAM,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAwD9C,CAAC;AAEF,qBACa,OAAQ,SAAQ,UAAU;IACrC,MAAM,CAAC,MAAM,0BAIX;IAE2B,IAAI,EAAE,MAAM,CAAc;IAEvD,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;IAMrC,iBAAiB;IAKjB,OAAO,CAAC,YAAY;IASpB,MAAM;IAIN,0CAA0C;IAC1C,MAAM,CAAC,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW;IAItD,sCAAsC;IACtC,MAAM,KAAK,UAAU,IAAI,MAAM,EAAE,CAEhC;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,UAAU,EAAE,OAAO,CAAC;KACrB;CACF"}