le-kit 0.1.4 → 0.1.5

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 (198) hide show
  1. package/dist/le-kit/assets/custom-elements.json +4305 -0
  2. package/dist/le-kit/index-Da-89pOc.js +4522 -0
  3. package/dist/le-kit/{index-D21JjI31.js.map → index-Da-89pOc.js.map} +1 -1
  4. package/dist/le-kit/index.esm.js +116 -2
  5. package/dist/le-kit/index.esm.js.map +1 -1
  6. package/dist/{esm → le-kit}/le-box.entry.js +3 -3
  7. package/dist/le-kit/le-button.entry.esm.js.map +1 -0
  8. package/dist/le-kit/le-button.entry.js +90 -0
  9. package/dist/{esm → le-kit}/le-card.entry.js +3 -3
  10. package/dist/le-kit/le-checkbox.entry.esm.js.map +1 -0
  11. package/dist/le-kit/le-checkbox.entry.js +59 -0
  12. package/dist/le-kit/le-component.entry.esm.js.map +1 -0
  13. package/dist/{collection/components/le-component/le-component.js → le-kit/le-component.entry.js} +19 -134
  14. package/dist/le-kit/le-kit.css +1010 -1
  15. package/dist/le-kit/le-kit.esm.js +48 -2
  16. package/dist/le-kit/le-kit.esm.js.map +1 -1
  17. package/dist/{esm → le-kit}/le-number-input.entry.js +5 -5
  18. package/dist/le-kit/le-popover.entry.esm.js.map +1 -0
  19. package/dist/{components/le-popover2.js → le-kit/le-popover.entry.js} +9 -45
  20. package/dist/{esm → le-kit}/le-popup.entry.js +6 -6
  21. package/dist/{esm → le-kit}/le-round-progress.entry.js +2 -2
  22. package/dist/le-kit/le-slot.entry.esm.js.map +1 -0
  23. package/dist/{collection/components/le-slot/le-slot.js → le-kit/le-slot.entry.js} +30 -279
  24. package/dist/{esm → le-kit}/le-stack.entry.js +3 -3
  25. package/dist/le-kit/le-string-input.entry.esm.js.map +1 -0
  26. package/dist/le-kit/le-string-input.entry.js +93 -0
  27. package/dist/{esm → le-kit}/le-text.entry.js +3 -3
  28. package/dist/{esm → le-kit}/le-turntable.entry.js +2 -2
  29. package/dist/{esm/utils-CJLZrrdC.js → le-kit/utils-FDOApZ53.js} +3 -3
  30. package/dist/le-kit/{utils-apol-Xc_.js.map → utils-FDOApZ53.js.map} +1 -1
  31. package/package.json +1 -1
  32. package/dist/cjs/index-CO4npcak.js +0 -1796
  33. package/dist/cjs/index-CO4npcak.js.map +0 -1
  34. package/dist/cjs/index.cjs.js +0 -117
  35. package/dist/cjs/index.cjs.js.map +0 -1
  36. package/dist/cjs/le-box.cjs.entry.js +0 -184
  37. package/dist/cjs/le-box.entry.cjs.js.map +0 -1
  38. package/dist/cjs/le-button.le-checkbox.le-component.le-popover.le-slot.le-string-input.entry.cjs.js.map +0 -1
  39. package/dist/cjs/le-button_6.cjs.entry.js +0 -1199
  40. package/dist/cjs/le-card.cjs.entry.js +0 -29
  41. package/dist/cjs/le-card.entry.cjs.js.map +0 -1
  42. package/dist/cjs/le-kit.cjs.js +0 -25
  43. package/dist/cjs/le-kit.cjs.js.map +0 -1
  44. package/dist/cjs/le-number-input.cjs.entry.js +0 -202
  45. package/dist/cjs/le-number-input.entry.cjs.js.map +0 -1
  46. package/dist/cjs/le-popup.cjs.entry.js +0 -212
  47. package/dist/cjs/le-popup.entry.cjs.js.map +0 -1
  48. package/dist/cjs/le-round-progress.cjs.entry.js +0 -106
  49. package/dist/cjs/le-round-progress.entry.cjs.js.map +0 -1
  50. package/dist/cjs/le-stack.cjs.entry.js +0 -135
  51. package/dist/cjs/le-stack.entry.cjs.js.map +0 -1
  52. package/dist/cjs/le-text.cjs.entry.js +0 -335
  53. package/dist/cjs/le-text.entry.cjs.js.map +0 -1
  54. package/dist/cjs/le-turntable.cjs.entry.js +0 -139
  55. package/dist/cjs/le-turntable.entry.cjs.js.map +0 -1
  56. package/dist/cjs/loader.cjs.js +0 -13
  57. package/dist/cjs/loader.cjs.js.map +0 -1
  58. package/dist/cjs/utils-BeT0iyCQ.js +0 -152
  59. package/dist/cjs/utils-BeT0iyCQ.js.map +0 -1
  60. package/dist/collection/collection-manifest.json +0 -26
  61. package/dist/collection/components/le-box/le-box.default.css +0 -37
  62. package/dist/collection/components/le-box/le-box.js +0 -614
  63. package/dist/collection/components/le-box/le-box.js.map +0 -1
  64. package/dist/collection/components/le-button/le-button.default.css +0 -263
  65. package/dist/collection/components/le-button/le-button.js +0 -368
  66. package/dist/collection/components/le-button/le-button.js.map +0 -1
  67. package/dist/collection/components/le-card/le-card.default.css +0 -74
  68. package/dist/collection/components/le-card/le-card.js +0 -102
  69. package/dist/collection/components/le-card/le-card.js.map +0 -1
  70. package/dist/collection/components/le-checkbox/le-checkbox.css +0 -93
  71. package/dist/collection/components/le-checkbox/le-checkbox.js +0 -192
  72. package/dist/collection/components/le-checkbox/le-checkbox.js.map +0 -1
  73. package/dist/collection/components/le-component/le-component.css +0 -189
  74. package/dist/collection/components/le-component/le-component.js.map +0 -1
  75. package/dist/collection/components/le-number-input/le-number-input.css +0 -135
  76. package/dist/collection/components/le-number-input/le-number-input.js +0 -515
  77. package/dist/collection/components/le-number-input/le-number-input.js.map +0 -1
  78. package/dist/collection/components/le-popover/le-popover.css +0 -143
  79. package/dist/collection/components/le-popover/le-popover.js +0 -693
  80. package/dist/collection/components/le-popover/le-popover.js.map +0 -1
  81. package/dist/collection/components/le-popup/le-popup.api.js +0 -101
  82. package/dist/collection/components/le-popup/le-popup.api.js.map +0 -1
  83. package/dist/collection/components/le-popup/le-popup.css +0 -222
  84. package/dist/collection/components/le-popup/le-popup.js +0 -596
  85. package/dist/collection/components/le-popup/le-popup.js.map +0 -1
  86. package/dist/collection/components/le-round-progress/le-round-progress.css +0 -34
  87. package/dist/collection/components/le-round-progress/le-round-progress.js +0 -184
  88. package/dist/collection/components/le-round-progress/le-round-progress.js.map +0 -1
  89. package/dist/collection/components/le-slot/le-slot.default.css +0 -222
  90. package/dist/collection/components/le-slot/le-slot.js.map +0 -1
  91. package/dist/collection/components/le-stack/le-stack.default.css +0 -37
  92. package/dist/collection/components/le-stack/le-stack.js +0 -389
  93. package/dist/collection/components/le-stack/le-stack.js.map +0 -1
  94. package/dist/collection/components/le-string-input/le-string-input.css +0 -83
  95. package/dist/collection/components/le-string-input/le-string-input.js +0 -359
  96. package/dist/collection/components/le-string-input/le-string-input.js.map +0 -1
  97. package/dist/collection/components/le-text/le-text.default.css +0 -169
  98. package/dist/collection/components/le-text/le-text.js +0 -475
  99. package/dist/collection/components/le-text/le-text.js.map +0 -1
  100. package/dist/collection/components/le-turntable/le-turntable.css +0 -10
  101. package/dist/collection/components/le-turntable/le-turntable.js +0 -210
  102. package/dist/collection/components/le-turntable/le-turntable.js.map +0 -1
  103. package/dist/collection/global/app.js +0 -130
  104. package/dist/collection/global/app.js.map +0 -1
  105. package/dist/collection/index.js +0 -15
  106. package/dist/collection/index.js.map +0 -1
  107. package/dist/collection/types/blocks.js +0 -115
  108. package/dist/collection/types/blocks.js.map +0 -1
  109. package/dist/collection/types/options.js +0 -2
  110. package/dist/collection/types/options.js.map +0 -1
  111. package/dist/collection/utils/utils.js +0 -141
  112. package/dist/collection/utils/utils.js.map +0 -1
  113. package/dist/components/index.js +0 -127
  114. package/dist/components/index.js.map +0 -1
  115. package/dist/components/le-box.js +0 -256
  116. package/dist/components/le-box.js.map +0 -1
  117. package/dist/components/le-button.js +0 -9
  118. package/dist/components/le-button.js.map +0 -1
  119. package/dist/components/le-button2.js +0 -1408
  120. package/dist/components/le-button2.js.map +0 -1
  121. package/dist/components/le-card.js +0 -83
  122. package/dist/components/le-card.js.map +0 -1
  123. package/dist/components/le-checkbox.js +0 -9
  124. package/dist/components/le-checkbox.js.map +0 -1
  125. package/dist/components/le-component.js +0 -9
  126. package/dist/components/le-component.js.map +0 -1
  127. package/dist/components/le-number-input.js +0 -271
  128. package/dist/components/le-number-input.js.map +0 -1
  129. package/dist/components/le-popover.js +0 -9
  130. package/dist/components/le-popover.js.map +0 -1
  131. package/dist/components/le-popover2.js.map +0 -1
  132. package/dist/components/le-popup.js +0 -279
  133. package/dist/components/le-popup.js.map +0 -1
  134. package/dist/components/le-round-progress.js +0 -135
  135. package/dist/components/le-round-progress.js.map +0 -1
  136. package/dist/components/le-slot.js +0 -9
  137. package/dist/components/le-slot.js.map +0 -1
  138. package/dist/components/le-stack.js +0 -198
  139. package/dist/components/le-stack.js.map +0 -1
  140. package/dist/components/le-string-input.js +0 -9
  141. package/dist/components/le-string-input.js.map +0 -1
  142. package/dist/components/le-text.js +0 -398
  143. package/dist/components/le-text.js.map +0 -1
  144. package/dist/components/le-turntable.js +0 -164
  145. package/dist/components/le-turntable.js.map +0 -1
  146. package/dist/docs.d.ts +0 -443
  147. package/dist/docs.json +0 -5185
  148. package/dist/esm/index-D71TXvJa.js +0 -1781
  149. package/dist/esm/index-D71TXvJa.js.map +0 -1
  150. package/dist/esm/index.js +0 -106
  151. package/dist/esm/index.js.map +0 -1
  152. package/dist/esm/le-box.entry.js.map +0 -1
  153. package/dist/esm/le-button.le-checkbox.le-component.le-popover.le-slot.le-string-input.entry.js.map +0 -1
  154. package/dist/esm/le-button_6.entry.js +0 -1192
  155. package/dist/esm/le-card.entry.js.map +0 -1
  156. package/dist/esm/le-kit.js +0 -21
  157. package/dist/esm/le-kit.js.map +0 -1
  158. package/dist/esm/le-number-input.entry.js.map +0 -1
  159. package/dist/esm/le-popup.entry.js.map +0 -1
  160. package/dist/esm/le-round-progress.entry.js.map +0 -1
  161. package/dist/esm/le-stack.entry.js.map +0 -1
  162. package/dist/esm/le-text.entry.js.map +0 -1
  163. package/dist/esm/le-turntable.entry.js.map +0 -1
  164. package/dist/esm/loader.js +0 -11
  165. package/dist/esm/loader.js.map +0 -1
  166. package/dist/esm/utils-CJLZrrdC.js.map +0 -1
  167. package/dist/index.cjs.js +0 -1
  168. package/dist/index.js +0 -1
  169. package/dist/le-kit/le-button.le-checkbox.le-component.le-popover.le-slot.le-string-input.entry.esm.js.map +0 -1
  170. package/dist/le-kit/p-024a764e.entry.js +0 -2
  171. package/dist/le-kit/p-024a764e.entry.js.map +0 -1
  172. package/dist/le-kit/p-073cf0b9.entry.js +0 -2
  173. package/dist/le-kit/p-073cf0b9.entry.js.map +0 -1
  174. package/dist/le-kit/p-0955b105.entry.js +0 -2
  175. package/dist/le-kit/p-0955b105.entry.js.map +0 -1
  176. package/dist/le-kit/p-18d79ee2.entry.js +0 -2
  177. package/dist/le-kit/p-18d79ee2.entry.js.map +0 -1
  178. package/dist/le-kit/p-4b1d3b6d.entry.js +0 -2
  179. package/dist/le-kit/p-4b1d3b6d.entry.js.map +0 -1
  180. package/dist/le-kit/p-79d179bd.entry.js +0 -2
  181. package/dist/le-kit/p-79d179bd.entry.js.map +0 -1
  182. package/dist/le-kit/p-D71TXvJa.js +0 -3
  183. package/dist/le-kit/p-D71TXvJa.js.map +0 -1
  184. package/dist/le-kit/p-c8a9288e.entry.js +0 -2
  185. package/dist/le-kit/p-c8a9288e.entry.js.map +0 -1
  186. package/dist/le-kit/p-cfc35bd3.entry.js +0 -2
  187. package/dist/le-kit/p-cfc35bd3.entry.js.map +0 -1
  188. package/dist/le-kit/p-d04da1f5.entry.js +0 -2
  189. package/dist/le-kit/p-d04da1f5.entry.js.map +0 -1
  190. package/dist/le-kit/p-qIai5-eB.js +0 -2
  191. package/dist/le-kit/p-qIai5-eB.js.map +0 -1
  192. package/dist/themes/base.css +0 -89
  193. package/dist/themes/dark.css +0 -100
  194. package/dist/themes/default.css +0 -108
  195. package/dist/themes/gradient.css +0 -100
  196. package/dist/themes/index.css +0 -413
  197. package/dist/themes/minimal.css +0 -100
  198. package/dist/themes/warm.css +0 -100
@@ -1,596 +0,0 @@
1
- import { h } from "@stencil/core";
2
- /**
3
- * A flexible popup/dialog component for alerts, confirms, prompts, and custom content.
4
- *
5
- * Uses the native HTML <dialog> element for proper modal behavior, accessibility,
6
- * and focus management. Can be used declaratively in HTML or programmatically
7
- * via leAlert(), leConfirm(), lePrompt().
8
- *
9
- * @slot - Default slot for custom body content
10
- * @slot header - Custom header content (replaces title)
11
- * @slot footer - Custom footer content (replaces default buttons)
12
- *
13
- * @cmsInternal true
14
- * @cmsCategory System
15
- */
16
- export class LePopup {
17
- el;
18
- /**
19
- * Whether the popup is currently visible
20
- */
21
- open = false;
22
- /**
23
- * Type of popup: alert (OK only), confirm (OK/Cancel), prompt (input + OK/Cancel), custom
24
- */
25
- type = 'alert';
26
- /**
27
- * Optional title for the popup header
28
- */
29
- popupTitle;
30
- /**
31
- * Message text to display (for alert/confirm/prompt types)
32
- */
33
- message;
34
- /**
35
- * Whether the popup is modal (blocks interaction with page behind)
36
- */
37
- modal = true;
38
- /**
39
- * Position of the popup on screen
40
- */
41
- position = 'center';
42
- /**
43
- * Text for the confirm/OK button
44
- */
45
- confirmText = 'OK';
46
- /**
47
- * Text for the cancel button
48
- */
49
- cancelText = 'Cancel';
50
- /**
51
- * Placeholder text for prompt input
52
- */
53
- placeholder = '';
54
- /**
55
- * Default value for prompt input
56
- */
57
- defaultValue = '';
58
- /**
59
- * Whether clicking the backdrop closes the popup (modal only)
60
- */
61
- closeOnBackdrop = true;
62
- /**
63
- * Internal state for prompt input value
64
- */
65
- inputValue = '';
66
- /**
67
- * Emitted when the popup is confirmed (OK clicked)
68
- */
69
- leConfirm;
70
- /**
71
- * Emitted when the popup is cancelled (Cancel clicked or dismissed)
72
- */
73
- leCancel;
74
- /**
75
- * Emitted when the popup opens
76
- */
77
- leOpen;
78
- /**
79
- * Emitted when the popup closes
80
- */
81
- leClose;
82
- dialogEl;
83
- inputEl;
84
- resolvePromise;
85
- componentWillLoad() {
86
- this.inputValue = this.defaultValue;
87
- }
88
- componentDidLoad() {
89
- // Native dialog handles Escape key automatically when modal
90
- // We just need to listen for the cancel event
91
- this.dialogEl?.addEventListener('cancel', this.handleDialogCancel);
92
- }
93
- disconnectedCallback() {
94
- this.dialogEl?.removeEventListener('cancel', this.handleDialogCancel);
95
- }
96
- handleDialogCancel = (e) => {
97
- e.preventDefault(); // Prevent default close to handle it ourselves
98
- this.handleCancel();
99
- };
100
- /**
101
- * Opens the popup and returns a promise that resolves when closed
102
- */
103
- async show() {
104
- return new Promise((resolve) => {
105
- this.resolvePromise = resolve;
106
- this.inputValue = this.defaultValue;
107
- this.open = true;
108
- // Use requestAnimationFrame to ensure the dialog element is rendered
109
- requestAnimationFrame(() => {
110
- if (this.dialogEl) {
111
- if (this.modal) {
112
- this.dialogEl.showModal();
113
- }
114
- else {
115
- this.dialogEl.show();
116
- }
117
- this.leOpen.emit();
118
- // Focus input for prompt type
119
- if (this.type === 'prompt' && this.inputEl) {
120
- this.inputEl.focus();
121
- this.inputEl.select();
122
- }
123
- }
124
- });
125
- });
126
- }
127
- /**
128
- * Closes the popup with a result
129
- */
130
- async hide(confirmed = false) {
131
- const result = {
132
- confirmed,
133
- value: this.type === 'prompt' ? this.inputValue : undefined,
134
- };
135
- this.dialogEl?.close();
136
- this.open = false;
137
- this.leClose.emit(result);
138
- if (this.resolvePromise) {
139
- this.resolvePromise(result);
140
- this.resolvePromise = undefined;
141
- }
142
- }
143
- handleConfirm = () => {
144
- const result = {
145
- confirmed: true,
146
- value: this.type === 'prompt' ? this.inputValue : undefined,
147
- };
148
- this.leConfirm.emit(result);
149
- this.hide(true);
150
- };
151
- handleCancel = () => {
152
- const result = {
153
- confirmed: false,
154
- value: undefined,
155
- };
156
- this.leCancel.emit(result);
157
- this.hide(false);
158
- };
159
- handleBackdropClick = (e) => {
160
- // Check if click was on the dialog backdrop (outside the dialog box)
161
- if (this.closeOnBackdrop && e.target === this.dialogEl) {
162
- const rect = this.dialogEl.getBoundingClientRect();
163
- const clickedInDialog = (e.clientX >= rect.left &&
164
- e.clientX <= rect.right &&
165
- e.clientY >= rect.top &&
166
- e.clientY <= rect.bottom);
167
- if (!clickedInDialog) {
168
- this.handleCancel();
169
- }
170
- }
171
- };
172
- handleInputChange = (e) => {
173
- this.inputValue = e.target.value;
174
- };
175
- handleKeyDown = (e) => {
176
- if (e.key === 'Enter' && this.type !== 'custom') {
177
- e.preventDefault();
178
- this.handleConfirm();
179
- }
180
- };
181
- hasSlot(name) {
182
- return !!this.el.querySelector(`[slot="${name}"]`);
183
- }
184
- renderHeader() {
185
- if (this.hasSlot('header')) {
186
- return (h("div", { class: "le-popup-header", part: "header" }, h("slot", { name: "header" })));
187
- }
188
- if (this.popupTitle) {
189
- return (h("div", { class: "le-popup-header", part: "header" }, this.popupTitle));
190
- }
191
- return null;
192
- }
193
- renderBody() {
194
- return (h("div", { class: "le-popup-body", part: "body" }, this.message && h("p", { class: "le-popup-message" }, this.message), this.type === 'prompt' && (h("input", { type: "text", class: "le-popup-input", part: "input", placeholder: this.placeholder, value: this.inputValue, onInput: this.handleInputChange, onKeyDown: this.handleKeyDown, ref: (el) => (this.inputEl = el) })), h("le-slot", { name: "", tag: "div", description: "Custom popup content", type: "slot" }, h("slot", null))));
195
- }
196
- renderFooter() {
197
- if (this.hasSlot('footer')) {
198
- return (h("div", { class: "le-popup-footer", part: "footer" }, h("slot", { name: "footer" })));
199
- }
200
- // For custom type without footer slot, don't render default buttons
201
- if (this.type === 'custom') {
202
- return null;
203
- }
204
- return (h("div", { class: "le-popup-footer", part: "footer" }, (this.type === 'confirm' || this.type === 'prompt') && (h("le-button", { variant: "outlined", part: "button-cancel", class: "le-popup-btn", onClick: this.handleCancel }, this.cancelText)), h("le-button", { variant: "solid", part: "button-confirm", class: "le-popup-btn", onClick: this.handleConfirm }, this.confirmText)));
205
- }
206
- render() {
207
- const positionClass = `le-popup-position-${this.position}`;
208
- return (h("dialog", { key: '1c38c82d3f466449ff57f731fc22936a7e5af0eb', class: `le-popup-dialog ${positionClass}`, part: "dialog", ref: (el) => (this.dialogEl = el), onClick: this.handleBackdropClick }, h("le-component", { key: '8f82316129786f9fe17ae6cc5f5a8cf7cbc3a9b5', component: "le-popup" }, h("div", { key: 'e5fef42ae8b41ea52db123b4576849407be33c65', class: "le-popup-container", part: "container" }, this.renderHeader(), this.renderBody(), this.renderFooter()))));
209
- }
210
- static get is() { return "le-popup"; }
211
- static get encapsulation() { return "shadow"; }
212
- static get originalStyleUrls() {
213
- return {
214
- "$": ["le-popup.css"]
215
- };
216
- }
217
- static get styleUrls() {
218
- return {
219
- "$": ["le-popup.css"]
220
- };
221
- }
222
- static get properties() {
223
- return {
224
- "open": {
225
- "type": "boolean",
226
- "mutable": true,
227
- "complexType": {
228
- "original": "boolean",
229
- "resolved": "boolean",
230
- "references": {}
231
- },
232
- "required": false,
233
- "optional": false,
234
- "docs": {
235
- "tags": [],
236
- "text": "Whether the popup is currently visible"
237
- },
238
- "getter": false,
239
- "setter": false,
240
- "reflect": true,
241
- "attribute": "open",
242
- "defaultValue": "false"
243
- },
244
- "type": {
245
- "type": "string",
246
- "mutable": false,
247
- "complexType": {
248
- "original": "PopupType",
249
- "resolved": "\"alert\" | \"confirm\" | \"custom\" | \"prompt\"",
250
- "references": {
251
- "PopupType": {
252
- "location": "local",
253
- "path": "/Users/leechy/Projects/le-kit/src/components/le-popup/le-popup.tsx",
254
- "id": "src/components/le-popup/le-popup.tsx::PopupType"
255
- }
256
- }
257
- },
258
- "required": false,
259
- "optional": false,
260
- "docs": {
261
- "tags": [],
262
- "text": "Type of popup: alert (OK only), confirm (OK/Cancel), prompt (input + OK/Cancel), custom"
263
- },
264
- "getter": false,
265
- "setter": false,
266
- "reflect": false,
267
- "attribute": "type",
268
- "defaultValue": "'alert'"
269
- },
270
- "popupTitle": {
271
- "type": "string",
272
- "mutable": false,
273
- "complexType": {
274
- "original": "string",
275
- "resolved": "string",
276
- "references": {}
277
- },
278
- "required": false,
279
- "optional": true,
280
- "docs": {
281
- "tags": [],
282
- "text": "Optional title for the popup header"
283
- },
284
- "getter": false,
285
- "setter": false,
286
- "reflect": false,
287
- "attribute": "popup-title"
288
- },
289
- "message": {
290
- "type": "string",
291
- "mutable": false,
292
- "complexType": {
293
- "original": "string",
294
- "resolved": "string",
295
- "references": {}
296
- },
297
- "required": false,
298
- "optional": true,
299
- "docs": {
300
- "tags": [],
301
- "text": "Message text to display (for alert/confirm/prompt types)"
302
- },
303
- "getter": false,
304
- "setter": false,
305
- "reflect": false,
306
- "attribute": "message"
307
- },
308
- "modal": {
309
- "type": "boolean",
310
- "mutable": false,
311
- "complexType": {
312
- "original": "boolean",
313
- "resolved": "boolean",
314
- "references": {}
315
- },
316
- "required": false,
317
- "optional": false,
318
- "docs": {
319
- "tags": [],
320
- "text": "Whether the popup is modal (blocks interaction with page behind)"
321
- },
322
- "getter": false,
323
- "setter": false,
324
- "reflect": false,
325
- "attribute": "modal",
326
- "defaultValue": "true"
327
- },
328
- "position": {
329
- "type": "string",
330
- "mutable": false,
331
- "complexType": {
332
- "original": "PopupPosition",
333
- "resolved": "\"bottom\" | \"bottom-left\" | \"bottom-right\" | \"center\" | \"top\" | \"top-left\" | \"top-right\"",
334
- "references": {
335
- "PopupPosition": {
336
- "location": "local",
337
- "path": "/Users/leechy/Projects/le-kit/src/components/le-popup/le-popup.tsx",
338
- "id": "src/components/le-popup/le-popup.tsx::PopupPosition"
339
- }
340
- }
341
- },
342
- "required": false,
343
- "optional": false,
344
- "docs": {
345
- "tags": [],
346
- "text": "Position of the popup on screen"
347
- },
348
- "getter": false,
349
- "setter": false,
350
- "reflect": false,
351
- "attribute": "position",
352
- "defaultValue": "'center'"
353
- },
354
- "confirmText": {
355
- "type": "string",
356
- "mutable": false,
357
- "complexType": {
358
- "original": "string",
359
- "resolved": "string",
360
- "references": {}
361
- },
362
- "required": false,
363
- "optional": false,
364
- "docs": {
365
- "tags": [],
366
- "text": "Text for the confirm/OK button"
367
- },
368
- "getter": false,
369
- "setter": false,
370
- "reflect": false,
371
- "attribute": "confirm-text",
372
- "defaultValue": "'OK'"
373
- },
374
- "cancelText": {
375
- "type": "string",
376
- "mutable": false,
377
- "complexType": {
378
- "original": "string",
379
- "resolved": "string",
380
- "references": {}
381
- },
382
- "required": false,
383
- "optional": false,
384
- "docs": {
385
- "tags": [],
386
- "text": "Text for the cancel button"
387
- },
388
- "getter": false,
389
- "setter": false,
390
- "reflect": false,
391
- "attribute": "cancel-text",
392
- "defaultValue": "'Cancel'"
393
- },
394
- "placeholder": {
395
- "type": "string",
396
- "mutable": false,
397
- "complexType": {
398
- "original": "string",
399
- "resolved": "string",
400
- "references": {}
401
- },
402
- "required": false,
403
- "optional": false,
404
- "docs": {
405
- "tags": [],
406
- "text": "Placeholder text for prompt input"
407
- },
408
- "getter": false,
409
- "setter": false,
410
- "reflect": false,
411
- "attribute": "placeholder",
412
- "defaultValue": "''"
413
- },
414
- "defaultValue": {
415
- "type": "string",
416
- "mutable": false,
417
- "complexType": {
418
- "original": "string",
419
- "resolved": "string",
420
- "references": {}
421
- },
422
- "required": false,
423
- "optional": false,
424
- "docs": {
425
- "tags": [],
426
- "text": "Default value for prompt input"
427
- },
428
- "getter": false,
429
- "setter": false,
430
- "reflect": false,
431
- "attribute": "default-value",
432
- "defaultValue": "''"
433
- },
434
- "closeOnBackdrop": {
435
- "type": "boolean",
436
- "mutable": false,
437
- "complexType": {
438
- "original": "boolean",
439
- "resolved": "boolean",
440
- "references": {}
441
- },
442
- "required": false,
443
- "optional": false,
444
- "docs": {
445
- "tags": [],
446
- "text": "Whether clicking the backdrop closes the popup (modal only)"
447
- },
448
- "getter": false,
449
- "setter": false,
450
- "reflect": false,
451
- "attribute": "close-on-backdrop",
452
- "defaultValue": "true"
453
- }
454
- };
455
- }
456
- static get states() {
457
- return {
458
- "inputValue": {}
459
- };
460
- }
461
- static get events() {
462
- return [{
463
- "method": "leConfirm",
464
- "name": "leConfirm",
465
- "bubbles": true,
466
- "cancelable": true,
467
- "composed": true,
468
- "docs": {
469
- "tags": [],
470
- "text": "Emitted when the popup is confirmed (OK clicked)"
471
- },
472
- "complexType": {
473
- "original": "PopupResult",
474
- "resolved": "PopupResult",
475
- "references": {
476
- "PopupResult": {
477
- "location": "local",
478
- "path": "/Users/leechy/Projects/le-kit/src/components/le-popup/le-popup.tsx",
479
- "id": "src/components/le-popup/le-popup.tsx::PopupResult"
480
- }
481
- }
482
- }
483
- }, {
484
- "method": "leCancel",
485
- "name": "leCancel",
486
- "bubbles": true,
487
- "cancelable": true,
488
- "composed": true,
489
- "docs": {
490
- "tags": [],
491
- "text": "Emitted when the popup is cancelled (Cancel clicked or dismissed)"
492
- },
493
- "complexType": {
494
- "original": "PopupResult",
495
- "resolved": "PopupResult",
496
- "references": {
497
- "PopupResult": {
498
- "location": "local",
499
- "path": "/Users/leechy/Projects/le-kit/src/components/le-popup/le-popup.tsx",
500
- "id": "src/components/le-popup/le-popup.tsx::PopupResult"
501
- }
502
- }
503
- }
504
- }, {
505
- "method": "leOpen",
506
- "name": "leOpen",
507
- "bubbles": true,
508
- "cancelable": true,
509
- "composed": true,
510
- "docs": {
511
- "tags": [],
512
- "text": "Emitted when the popup opens"
513
- },
514
- "complexType": {
515
- "original": "void",
516
- "resolved": "void",
517
- "references": {}
518
- }
519
- }, {
520
- "method": "leClose",
521
- "name": "leClose",
522
- "bubbles": true,
523
- "cancelable": true,
524
- "composed": true,
525
- "docs": {
526
- "tags": [],
527
- "text": "Emitted when the popup closes"
528
- },
529
- "complexType": {
530
- "original": "PopupResult",
531
- "resolved": "PopupResult",
532
- "references": {
533
- "PopupResult": {
534
- "location": "local",
535
- "path": "/Users/leechy/Projects/le-kit/src/components/le-popup/le-popup.tsx",
536
- "id": "src/components/le-popup/le-popup.tsx::PopupResult"
537
- }
538
- }
539
- }
540
- }];
541
- }
542
- static get methods() {
543
- return {
544
- "show": {
545
- "complexType": {
546
- "signature": "() => Promise<PopupResult>",
547
- "parameters": [],
548
- "references": {
549
- "Promise": {
550
- "location": "global",
551
- "id": "global::Promise"
552
- },
553
- "PopupResult": {
554
- "location": "local",
555
- "path": "/Users/leechy/Projects/le-kit/src/components/le-popup/le-popup.tsx",
556
- "id": "src/components/le-popup/le-popup.tsx::PopupResult"
557
- }
558
- },
559
- "return": "Promise<PopupResult>"
560
- },
561
- "docs": {
562
- "text": "Opens the popup and returns a promise that resolves when closed",
563
- "tags": []
564
- }
565
- },
566
- "hide": {
567
- "complexType": {
568
- "signature": "(confirmed?: boolean) => Promise<void>",
569
- "parameters": [{
570
- "name": "confirmed",
571
- "type": "boolean",
572
- "docs": ""
573
- }],
574
- "references": {
575
- "Promise": {
576
- "location": "global",
577
- "id": "global::Promise"
578
- },
579
- "PopupResult": {
580
- "location": "local",
581
- "path": "/Users/leechy/Projects/le-kit/src/components/le-popup/le-popup.tsx",
582
- "id": "src/components/le-popup/le-popup.tsx::PopupResult"
583
- }
584
- },
585
- "return": "Promise<void>"
586
- },
587
- "docs": {
588
- "text": "Closes the popup with a result",
589
- "tags": []
590
- }
591
- }
592
- };
593
- }
594
- static get elementRef() { return "el"; }
595
- }
596
- //# sourceMappingURL=le-popup.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"le-popup.js","sourceRoot":"","sources":["../../../src/components/le-popup/le-popup.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAgB,KAAK,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAoBhG;;;;;;;;;;;;;GAaG;AAMH,MAAM,OAAO,OAAO;IACP,EAAE,CAAc;IAE3B;;OAEG;IACqC,IAAI,GAAY,KAAK,CAAC;IAE9D;;OAEG;IACK,IAAI,GAAc,OAAO,CAAC;IAElC;;OAEG;IACK,UAAU,CAAU;IAE5B;;OAEG;IACK,OAAO,CAAU;IAEzB;;OAEG;IACK,KAAK,GAAY,IAAI,CAAC;IAE9B;;OAEG;IACK,QAAQ,GAAkB,QAAQ,CAAC;IAE3C;;OAEG;IACK,WAAW,GAAW,IAAI,CAAC;IAEnC;;OAEG;IACK,UAAU,GAAW,QAAQ,CAAC;IAEtC;;OAEG;IACK,WAAW,GAAW,EAAE,CAAC;IAEjC;;OAEG;IACK,YAAY,GAAW,EAAE,CAAC;IAElC;;OAEG;IACK,eAAe,GAAY,IAAI,CAAC;IAExC;;OAEG;IACM,UAAU,GAAW,EAAE,CAAC;IAEjC;;OAEG;IACM,SAAS,CAA4B;IAE9C;;OAEG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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Prop, Method, Event, EventEmitter, State, Element, h } from '@stencil/core';\n\n/**\n * Popup type determines the buttons shown\n */\nexport type PopupType = 'alert' | 'confirm' | 'prompt' | 'custom';\n\n/**\n * Popup position on the screen\n */\nexport type PopupPosition = 'center' | 'top' | 'bottom' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';\n\n/**\n * Result returned by the popup when closed\n */\nexport interface PopupResult {\n confirmed: boolean;\n value?: string;\n}\n\n/**\n * A flexible popup/dialog component for alerts, confirms, prompts, and custom content.\n * \n * Uses the native HTML <dialog> element for proper modal behavior, accessibility,\n * and focus management. Can be used declaratively in HTML or programmatically \n * via leAlert(), leConfirm(), lePrompt().\n *\n * @slot - Default slot for custom body content\n * @slot header - Custom header content (replaces title)\n * @slot footer - Custom footer content (replaces default buttons)\n * \n * @cmsInternal true\n * @cmsCategory System\n */\n@Component({\n tag: 'le-popup',\n styleUrl: 'le-popup.css',\n shadow: true,\n})\nexport class LePopup {\n @Element() el: HTMLElement;\n\n /**\n * Whether the popup is currently visible\n */\n @Prop({ mutable: true, reflect: true }) open: boolean = false;\n\n /**\n * Type of popup: alert (OK only), confirm (OK/Cancel), prompt (input + OK/Cancel), custom\n */\n @Prop() type: PopupType = 'alert';\n\n /**\n * Optional title for the popup header\n */\n @Prop() popupTitle?: string;\n\n /**\n * Message text to display (for alert/confirm/prompt types)\n */\n @Prop() message?: string;\n\n /**\n * Whether the popup is modal (blocks interaction with page behind)\n */\n @Prop() modal: boolean = true;\n\n /**\n * Position of the popup on screen\n */\n @Prop() position: PopupPosition = 'center';\n\n /**\n * Text for the confirm/OK button\n */\n @Prop() confirmText: string = 'OK';\n\n /**\n * Text for the cancel button\n */\n @Prop() cancelText: string = 'Cancel';\n\n /**\n * Placeholder text for prompt input\n */\n @Prop() placeholder: string = '';\n\n /**\n * Default value for prompt input\n */\n @Prop() defaultValue: string = '';\n\n /**\n * Whether clicking the backdrop closes the popup (modal only)\n */\n @Prop() closeOnBackdrop: boolean = true;\n\n /**\n * Internal state for prompt input value\n */\n @State() inputValue: string = '';\n\n /**\n * Emitted when the popup is confirmed (OK clicked)\n */\n @Event() leConfirm: EventEmitter<PopupResult>;\n\n /**\n * Emitted when the popup is cancelled (Cancel clicked or dismissed)\n */\n @Event() leCancel: EventEmitter<PopupResult>;\n\n /**\n * Emitted when the popup opens\n */\n @Event() leOpen: EventEmitter<void>;\n\n /**\n * Emitted when the popup closes\n */\n @Event() leClose: EventEmitter<PopupResult>;\n\n private dialogEl?: HTMLDialogElement;\n private inputEl?: HTMLInputElement;\n private resolvePromise?: (result: PopupResult) => void;\n\n componentWillLoad() {\n this.inputValue = this.defaultValue;\n }\n\n componentDidLoad() {\n // Native dialog handles Escape key automatically when modal\n // We just need to listen for the cancel event\n this.dialogEl?.addEventListener('cancel', this.handleDialogCancel);\n }\n\n disconnectedCallback() {\n this.dialogEl?.removeEventListener('cancel', this.handleDialogCancel);\n }\n\n private handleDialogCancel = (e: Event) => {\n e.preventDefault(); // Prevent default close to handle it ourselves\n this.handleCancel();\n };\n\n /**\n * Opens the popup and returns a promise that resolves when closed\n */\n @Method()\n async show(): Promise<PopupResult> {\n return new Promise((resolve) => {\n this.resolvePromise = resolve;\n this.inputValue = this.defaultValue;\n this.open = true;\n \n // Use requestAnimationFrame to ensure the dialog element is rendered\n requestAnimationFrame(() => {\n if (this.dialogEl) {\n if (this.modal) {\n this.dialogEl.showModal();\n } else {\n this.dialogEl.show();\n }\n \n this.leOpen.emit();\n \n // Focus input for prompt type\n if (this.type === 'prompt' && this.inputEl) {\n this.inputEl.focus();\n this.inputEl.select();\n }\n }\n });\n });\n }\n\n /**\n * Closes the popup with a result\n */\n @Method()\n async hide(confirmed: boolean = false) {\n const result: PopupResult = {\n confirmed,\n value: this.type === 'prompt' ? this.inputValue : undefined,\n };\n \n this.dialogEl?.close();\n this.open = false;\n this.leClose.emit(result);\n \n if (this.resolvePromise) {\n this.resolvePromise(result);\n this.resolvePromise = undefined;\n }\n }\n\n private handleConfirm = () => {\n const result: PopupResult = {\n confirmed: true,\n value: this.type === 'prompt' ? this.inputValue : undefined,\n };\n this.leConfirm.emit(result);\n this.hide(true);\n };\n\n private handleCancel = () => {\n const result: PopupResult = {\n confirmed: false,\n value: undefined,\n };\n this.leCancel.emit(result);\n this.hide(false);\n };\n\n private handleBackdropClick = (e: MouseEvent) => {\n // Check if click was on the dialog backdrop (outside the dialog box)\n if (this.closeOnBackdrop && e.target === this.dialogEl) {\n const rect = this.dialogEl.getBoundingClientRect();\n const clickedInDialog = (\n e.clientX >= rect.left &&\n e.clientX <= rect.right &&\n e.clientY >= rect.top &&\n e.clientY <= rect.bottom\n );\n if (!clickedInDialog) {\n this.handleCancel();\n }\n }\n };\n\n private handleInputChange = (e: Event) => {\n this.inputValue = (e.target as HTMLInputElement).value;\n };\n\n private handleKeyDown = (e: KeyboardEvent) => {\n if (e.key === 'Enter' && this.type !== 'custom') {\n e.preventDefault();\n this.handleConfirm();\n }\n };\n\n private hasSlot(name: string): boolean {\n return !!this.el.querySelector(`[slot=\"${name}\"]`);\n }\n\n private renderHeader() {\n if (this.hasSlot('header')) {\n return (\n <div class=\"le-popup-header\" part=\"header\">\n <slot name=\"header\"></slot>\n </div>\n );\n }\n \n if (this.popupTitle) {\n return (\n <div class=\"le-popup-header\" part=\"header\">\n {this.popupTitle}\n </div>\n );\n }\n \n return null;\n }\n\n private renderBody() {\n return (\n <div class=\"le-popup-body\" part=\"body\">\n {this.message && <p class=\"le-popup-message\">{this.message}</p>}\n \n {this.type === 'prompt' && (\n <input\n type=\"text\"\n class=\"le-popup-input\"\n part=\"input\"\n placeholder={this.placeholder}\n value={this.inputValue}\n onInput={this.handleInputChange}\n onKeyDown={this.handleKeyDown}\n ref={(el) => (this.inputEl = el)}\n />\n )}\n \n {/* Default slot for custom content */}\n <le-slot name=\"\" tag=\"div\" description=\"Custom popup content\" type=\"slot\">\n <slot></slot>\n </le-slot>\n </div>\n );\n }\n\n private renderFooter() {\n if (this.hasSlot('footer')) {\n return (\n <div class=\"le-popup-footer\" part=\"footer\">\n <slot name=\"footer\"></slot>\n </div>\n );\n }\n \n // For custom type without footer slot, don't render default buttons\n if (this.type === 'custom') {\n return null;\n }\n \n return (\n <div class=\"le-popup-footer\" part=\"footer\">\n {(this.type === 'confirm' || this.type === 'prompt') && (\n <le-button\n variant=\"outlined\"\n part=\"button-cancel\"\n class=\"le-popup-btn\"\n onClick={this.handleCancel}\n >\n {this.cancelText}\n </le-button>\n )}\n <le-button\n variant=\"solid\"\n part=\"button-confirm\"\n class=\"le-popup-btn\"\n onClick={this.handleConfirm}\n >\n {this.confirmText}\n </le-button>\n </div>\n );\n }\n\n render() {\n const positionClass = `le-popup-position-${this.position}`;\n \n return (\n <dialog\n class={`le-popup-dialog ${positionClass}`}\n part=\"dialog\"\n ref={(el) => (this.dialogEl = el)}\n onClick={this.handleBackdropClick}\n >\n <le-component component=\"le-popup\">\n <div class=\"le-popup-container\" part=\"container\">\n {this.renderHeader()}\n {this.renderBody()}\n {this.renderFooter()}\n </div>\n </le-component>\n </dialog>\n );\n }\n}\n"]}
@@ -1,34 +0,0 @@
1
- .round-progress--container {
2
- position: relative;
3
- }
4
-
5
- .round-progress {
6
- position: absolute;
7
- top: 0;
8
- left: 0;
9
- right: 0;
10
- bottom: 0;
11
- display: block;
12
- }
13
-
14
- .round-progress--progress {
15
- filter: drop-shadow(var(--progress-shadow));
16
- }
17
-
18
- .round-progress--circle {
19
- fill: none;
20
- stroke: var(--progress-color, #999);
21
- stroke-width: var(--progress-width, 4);
22
- stroke-linecap: var(--progress-linecap, round);
23
- animation: progress--circle 0.5s ease-out forwards;
24
- transition: stroke-dasharray 0.5s ease-out;
25
- }
26
-
27
- @keyframes progress--circle {
28
- 0% { stroke-dasharray: 0 1000; }
29
- }
30
-
31
- .round-progress--path {
32
- fill: none;
33
- stroke-linecap: round;
34
- }