@dropi/ui 0.1.48 → 0.1.49

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 (37) hide show
  1. package/dist/cjs/dropi-alert-modal.cjs.entry.js +14 -37
  2. package/dist/cjs/dropi-empty-state.cjs.entry.js +87 -10
  3. package/dist/collection/components/dropi-alert-modal/dropi-alert-modal.js +24 -65
  4. package/dist/collection/components/dropi-empty-state/dropi-empty-state.js +24 -23
  5. package/dist/collection/utils/illustration-map.generated.js +73 -0
  6. package/dist/collection/utils/lottie-map.generated.js +10 -0
  7. package/dist/components/dropi-alert-modal.js +1 -1
  8. package/dist/components/dropi-empty-state.js +1 -1
  9. package/dist/components/p-B9-h_ikq.js +1 -0
  10. package/dist/components/p-B9rJd-Rf.js +1 -0
  11. package/dist/components/p-CCZ6rIo5.js +1 -0
  12. package/dist/components/p-D7GP-lmt.js +1 -0
  13. package/dist/components/p-DYAsdhfM.js +1 -0
  14. package/dist/components/p-Dnx3uXgo.js +1 -0
  15. package/dist/components/p-RQjw5hdz.js +1 -0
  16. package/dist/docs.json +31 -45
  17. package/dist/dropi-ui/dropi-ui.esm.js +1 -1
  18. package/dist/dropi-ui/p-0086fbc8.entry.js +1 -0
  19. package/dist/dropi-ui/p-04cd97a1.entry.js +1 -0
  20. package/dist/dropi-ui/p-11b83d87.entry.js +1 -0
  21. package/dist/dropi-ui/p-1c3a5cee.entry.js +1 -0
  22. package/dist/dropi-ui/p-3d7a3ea5.entry.js +1 -0
  23. package/dist/dropi-ui/p-68891c64.entry.js +1 -0
  24. package/dist/dropi-ui/p-ca7c025d.entry.js +1 -0
  25. package/dist/dropi-ui/p-ed4bd1cc.entry.js +1 -0
  26. package/dist/esm/dropi-alert-modal.entry.js +15 -38
  27. package/dist/esm/dropi-empty-state.entry.js +88 -11
  28. package/dist/types/components/dropi-alert-modal/dropi-alert-modal.d.ts +1 -39
  29. package/dist/types/components/dropi-empty-state/dropi-empty-state.d.ts +7 -13
  30. package/dist/types/components.d.ts +8 -105
  31. package/dist/types/utils/illustration-map.generated.d.ts +1 -0
  32. package/dist/types/utils/lottie-map.generated.d.ts +1 -0
  33. package/hydrate/index.js +101 -60
  34. package/hydrate/index.mjs +101 -60
  35. package/package.json +1 -1
  36. package/scripts/generate-illustration-map.js +37 -0
  37. package/scripts/generate-lottie-map.js +49 -0
@@ -1,53 +1,21 @@
1
1
  import { h } from "@stencil/core";
2
- /**
3
- * @component dropi-alert-modal
4
- * Confirmation/alert modal with Lottie animation, title, message and action buttons.
5
- * Uses dropi-modal internally.
6
- *
7
- * @example
8
- * const el = document.querySelector('dropi-alert-modal');
9
- * el.visible = true;
10
- */
2
+ import { LOTTIE_MAP } from "../../utils/lottie-map.generated";
11
3
  export class DropiAlertModal {
12
- /** Controls visibility */
4
+ el;
13
5
  visible = false;
14
- /** Modal type — determines Lottie animation */
15
6
  type = 'question';
16
- /** Bold title */
17
7
  tittle = '';
18
- /** Body message */
19
8
  message = '';
20
- /** Primary button label */
21
9
  primaryButton = 'Accept';
22
- /** Secondary button label (hidden if empty) */
23
10
  secondaryButton = '';
24
- /** Show loading state with loading.json Lottie */
25
11
  loading = false;
26
- /** Show close icon in header */
27
12
  closable = false;
28
- /** Hide action buttons */
29
13
  displayButtons = true;
30
- /** Loading title */
31
14
  loadingTitle = 'Loading';
32
- /** Loading message */
33
15
  loadingMessage = 'Please wait a moment';
34
- /**
35
- * When true, primary button does NOT auto-close the modal (matches Angular `isStep`).
36
- * Useful for step-by-step flows.
37
- */
38
16
  isStep = false;
39
- /** Base z-index for the internal modal overlay (matches Angular `baseZIndex`) */
40
17
  baseZIndex = 0;
41
- /**
42
- * Use White Label (MB) illustration style instead of Lottie animation.
43
- */
44
18
  isWhiteLabel = false;
45
- /**
46
- * Convenience object prop — matches Angular `params: ModalParams`.
47
- * Fields: tittle, type, message, primaryButton, secondaryButton, loadingTitle,
48
- * loadingMessage, closable, displayButtons.
49
- * When provided, its values override the corresponding individual props.
50
- */
51
19
  params = null;
52
20
  paramsChanged(val) {
53
21
  if (!val)
@@ -71,21 +39,10 @@ export class DropiAlertModal {
71
39
  if (val.displayButtons !== undefined)
72
40
  this.displayButtons = val.displayButtons;
73
41
  }
74
- /** Emitted when primary button is clicked — matches Angular 'primaryButtonEvent' */
75
42
  dropiPrimaryClick;
76
- /** Emitted when secondary button is clicked — matches Angular 'secondaryButtonEvent' */
77
43
  dropiSecondaryClick;
78
- /** Emitted when modal open state changes — matches Angular 'modalOpenChange' */
79
44
  dropiVisibleChange;
80
- /** Emitted when modal is hidden — matches Angular 'onHide' */
81
45
  dropiHide;
82
- lottieMap = {
83
- question: '/assets/lottie-files/question.json',
84
- warning: '/assets/lottie-files/warning.json',
85
- success: '/assets/lottie-files/success.json',
86
- error: '/assets/lottie-files/failure.json',
87
- loading: '/assets/lottie-files/loading.json',
88
- };
89
46
  componentWillLoad() {
90
47
  if (this.params)
91
48
  this.paramsChanged(this.params);
@@ -116,7 +73,8 @@ export class DropiAlertModal {
116
73
  render() {
117
74
  const lottieKey = this.loading ? 'loading' : this.type;
118
75
  const isLottieLoading = lottieKey === 'loading';
119
- return (h("dropi-modal", { key: '322c59ea0a067a4c0cb28a5ffbe9cbc0c642eee6', visible: this.visible, showHeader: this.closable, showCloseIcon: this.closable, dismissable: false, closeOnEscape: false, showFooter: false, size: "s", onDropiHide: () => this.onModalHide() }, h("div", { key: '06530f3da45738d1ed75a4e8b5b8b0b80dfd2647', class: "body-alert" }, this.lottieMap[lottieKey] && (h("div", { key: '7a4ab4fbbdf3cbbacfa22f918d212b788f4392a4', class: `lottie-img${isLottieLoading ? ' lottie-img--loading' : ''}` }, h("lottie-player", { key: lottieKey, src: this.lottieMap[lottieKey], background: "transparent", speed: "1", loop: true, autoplay: true }))), h("div", { key: '0e72f42d10c59047e82df8b2842affd38ab60fc7', class: "content-alert" }, h("h2", { key: '8262de8fbcf5b87fbac34740d34d99d0b6ff921d' }, this.loading ? this.loadingTitle : this.tittle), h("p", { key: 'ca9c734e0b9686bff7e2616ae98224446ac0ca33' }, this.loading ? this.loadingMessage : this.message)), h("div", { key: '1b5edb3af1044cb0dd0b57a425517b1d824672be', class: "custom-content" }, h("slot", { key: '57f4a8acdbcf8a11445f7c8233355bb4ac46c9ab' })), !this.loading && this.displayButtons && (h("div", { key: '32580f42d98f628b4c1d1f300b5a3aaaa1be2486', class: "actions" }, this.secondaryButton && h("dropi-button", { key: 'dcf8707a7f4d8b80126a10022dd6de1c0ea44dc7', text: this.secondaryButton, severity: "secondary", onDropiClick: () => this.handleSecondary(), fullWidth: true }), h("dropi-button", { key: '3ed494fc7a83021174c4d006ae4327348d400e93', text: this.primaryButton, severity: "primary", onDropiClick: () => this.handlePrimary(), fullWidth: true }))))));
76
+ const lottieSrc = LOTTIE_MAP[lottieKey];
77
+ return (h("dropi-modal", { key: 'db5113694460c0cc84715a713389470ac7f6b9b1', visible: this.visible, showHeader: this.closable, showCloseIcon: this.closable, dismissable: false, closeOnEscape: false, showFooter: false, size: "s", onDropiHide: () => this.onModalHide() }, h("div", { key: 'abe4496cbcd52f257b713a5bdfd9f44d0de106f0', class: "body-alert" }, lottieSrc && (h("div", { key: 'b1ad0a1816dd8cdc6efb203090215837c8be8bdb', class: `lottie-img${isLottieLoading ? ' lottie-img--loading' : ''}` }, h("lottie-player", { key: lottieKey, src: lottieSrc, background: "transparent", speed: "1", loop: true, autoplay: true }))), h("div", { key: '6749aebfaf51f42c8cb6e8b70c474ba691adf1f6', class: "content-alert" }, h("h2", { key: '575c3c8db1175610bcfa6455063fa427b8cfed5b' }, this.loading ? this.loadingTitle : this.tittle), h("p", { key: '0f542e5944cabe7fe06c0898fccf6d1076742fec' }, this.loading ? this.loadingMessage : this.message)), h("div", { key: 'a891be75965672b1e4e83ee441c0043e5da39580', class: "custom-content" }, h("slot", { key: '1a2124b8f8682be02b231b806e57fd62b8dcdf45' })), !this.loading && this.displayButtons && (h("div", { key: 'f6d1b5a105f185c9127a005642d4630a7f1897c5', class: "actions" }, this.secondaryButton && h("dropi-button", { key: '008d2b52b1510a3d9283d05acbf2bfd2f3e7fb08', text: this.secondaryButton, severity: "secondary", onDropiClick: () => this.handleSecondary(), fullWidth: true }), h("dropi-button", { key: 'ea004b1b9698a5e05450fe366bf62cda44a4f352', text: this.primaryButton, severity: "primary", onDropiClick: () => this.handlePrimary(), fullWidth: true }))))));
120
78
  }
121
79
  static get is() { return "dropi-alert-modal"; }
122
80
  static get originalStyleUrls() {
@@ -143,7 +101,7 @@ export class DropiAlertModal {
143
101
  "optional": false,
144
102
  "docs": {
145
103
  "tags": [],
146
- "text": "Controls visibility"
104
+ "text": ""
147
105
  },
148
106
  "getter": false,
149
107
  "setter": false,
@@ -169,7 +127,7 @@ export class DropiAlertModal {
169
127
  "optional": false,
170
128
  "docs": {
171
129
  "tags": [],
172
- "text": "Modal type \u2014 determines Lottie animation"
130
+ "text": ""
173
131
  },
174
132
  "getter": false,
175
133
  "setter": false,
@@ -189,7 +147,7 @@ export class DropiAlertModal {
189
147
  "optional": false,
190
148
  "docs": {
191
149
  "tags": [],
192
- "text": "Bold title"
150
+ "text": ""
193
151
  },
194
152
  "getter": false,
195
153
  "setter": false,
@@ -209,7 +167,7 @@ export class DropiAlertModal {
209
167
  "optional": false,
210
168
  "docs": {
211
169
  "tags": [],
212
- "text": "Body message"
170
+ "text": ""
213
171
  },
214
172
  "getter": false,
215
173
  "setter": false,
@@ -229,7 +187,7 @@ export class DropiAlertModal {
229
187
  "optional": false,
230
188
  "docs": {
231
189
  "tags": [],
232
- "text": "Primary button label"
190
+ "text": ""
233
191
  },
234
192
  "getter": false,
235
193
  "setter": false,
@@ -249,7 +207,7 @@ export class DropiAlertModal {
249
207
  "optional": false,
250
208
  "docs": {
251
209
  "tags": [],
252
- "text": "Secondary button label (hidden if empty)"
210
+ "text": ""
253
211
  },
254
212
  "getter": false,
255
213
  "setter": false,
@@ -269,7 +227,7 @@ export class DropiAlertModal {
269
227
  "optional": false,
270
228
  "docs": {
271
229
  "tags": [],
272
- "text": "Show loading state with loading.json Lottie"
230
+ "text": ""
273
231
  },
274
232
  "getter": false,
275
233
  "setter": false,
@@ -289,7 +247,7 @@ export class DropiAlertModal {
289
247
  "optional": false,
290
248
  "docs": {
291
249
  "tags": [],
292
- "text": "Show close icon in header"
250
+ "text": ""
293
251
  },
294
252
  "getter": false,
295
253
  "setter": false,
@@ -309,7 +267,7 @@ export class DropiAlertModal {
309
267
  "optional": false,
310
268
  "docs": {
311
269
  "tags": [],
312
- "text": "Hide action buttons"
270
+ "text": ""
313
271
  },
314
272
  "getter": false,
315
273
  "setter": false,
@@ -329,7 +287,7 @@ export class DropiAlertModal {
329
287
  "optional": false,
330
288
  "docs": {
331
289
  "tags": [],
332
- "text": "Loading title"
290
+ "text": ""
333
291
  },
334
292
  "getter": false,
335
293
  "setter": false,
@@ -349,7 +307,7 @@ export class DropiAlertModal {
349
307
  "optional": false,
350
308
  "docs": {
351
309
  "tags": [],
352
- "text": "Loading message"
310
+ "text": ""
353
311
  },
354
312
  "getter": false,
355
313
  "setter": false,
@@ -369,7 +327,7 @@ export class DropiAlertModal {
369
327
  "optional": false,
370
328
  "docs": {
371
329
  "tags": [],
372
- "text": "When true, primary button does NOT auto-close the modal (matches Angular `isStep`).\nUseful for step-by-step flows."
330
+ "text": ""
373
331
  },
374
332
  "getter": false,
375
333
  "setter": false,
@@ -389,7 +347,7 @@ export class DropiAlertModal {
389
347
  "optional": false,
390
348
  "docs": {
391
349
  "tags": [],
392
- "text": "Base z-index for the internal modal overlay (matches Angular `baseZIndex`)"
350
+ "text": ""
393
351
  },
394
352
  "getter": false,
395
353
  "setter": false,
@@ -409,7 +367,7 @@ export class DropiAlertModal {
409
367
  "optional": false,
410
368
  "docs": {
411
369
  "tags": [],
412
- "text": "Use White Label (MB) illustration style instead of Lottie animation."
370
+ "text": ""
413
371
  },
414
372
  "getter": false,
415
373
  "setter": false,
@@ -429,7 +387,7 @@ export class DropiAlertModal {
429
387
  "optional": false,
430
388
  "docs": {
431
389
  "tags": [],
432
- "text": "Convenience object prop \u2014 matches Angular `params: ModalParams`.\nFields: tittle, type, message, primaryButton, secondaryButton, loadingTitle,\nloadingMessage, closable, displayButtons.\nWhen provided, its values override the corresponding individual props."
390
+ "text": ""
433
391
  },
434
392
  "getter": false,
435
393
  "setter": false,
@@ -448,7 +406,7 @@ export class DropiAlertModal {
448
406
  "composed": true,
449
407
  "docs": {
450
408
  "tags": [],
451
- "text": "Emitted when primary button is clicked \u2014 matches Angular 'primaryButtonEvent'"
409
+ "text": ""
452
410
  },
453
411
  "complexType": {
454
412
  "original": "boolean",
@@ -463,7 +421,7 @@ export class DropiAlertModal {
463
421
  "composed": true,
464
422
  "docs": {
465
423
  "tags": [],
466
- "text": "Emitted when secondary button is clicked \u2014 matches Angular 'secondaryButtonEvent'"
424
+ "text": ""
467
425
  },
468
426
  "complexType": {
469
427
  "original": "boolean",
@@ -478,7 +436,7 @@ export class DropiAlertModal {
478
436
  "composed": true,
479
437
  "docs": {
480
438
  "tags": [],
481
- "text": "Emitted when modal open state changes \u2014 matches Angular 'modalOpenChange'"
439
+ "text": ""
482
440
  },
483
441
  "complexType": {
484
442
  "original": "boolean",
@@ -493,7 +451,7 @@ export class DropiAlertModal {
493
451
  "composed": true,
494
452
  "docs": {
495
453
  "tags": [],
496
- "text": "Emitted when modal is hidden \u2014 matches Angular 'onHide'"
454
+ "text": ""
497
455
  },
498
456
  "complexType": {
499
457
  "original": "void",
@@ -540,6 +498,7 @@ export class DropiAlertModal {
540
498
  }
541
499
  };
542
500
  }
501
+ static get elementRef() { return "el"; }
543
502
  static get watchers() {
544
503
  return [{
545
504
  "propName": "params",
@@ -1,29 +1,29 @@
1
1
  import { h } from "@stencil/core";
2
- /**
3
- * @component dropi-empty-state
4
- * Empty state illustration with title, description and optional action button.
5
- */
2
+ import { ILLUSTRATION_MAP } from "../../utils/illustration-map.generated";
6
3
  export class DropiEmptyState {
7
- /** Title text (matches Angular 'title') */
4
+ el;
8
5
  title = '';
9
- /** Description text */
10
6
  description = '';
11
- /** URL of the illustration image */
7
+ /** URL of an external illustration image (overrides dropiIcon) */
12
8
  imageUrl = '';
13
- /** Alt text for the image */
14
9
  imageAlt = 'Sin resultados';
15
- /** Primary action button label (empty = hidden) — matches Angular 'buttonText' */
10
+ /** Primary action button label (empty = hidden) */
16
11
  buttonText = '';
17
- /** Icon name for button matches Angular 'buttonIcon' */
12
+ /** Icon name for the action button */
18
13
  buttonIcon = '';
19
- /** State of the illustration (default, loading, sorry, love, success, error) — matches Angular 'dropiIcon' */
14
+ /** Built-in illustration state */
20
15
  dropiIcon = 'default';
21
- /** Severity for the action button — matches Angular 'buttonSeverity' */
22
16
  buttonSeverity = 'tertiary';
23
- /** Emitted when button is clicked — matches Angular 'buttonClickEvent' */
24
17
  buttonClickEvent;
18
+ illustrationRef;
19
+ componentDidRender() {
20
+ if (this.illustrationRef && !this.imageUrl) {
21
+ const key = this.dropiIcon && ILLUSTRATION_MAP[this.dropiIcon] ? this.dropiIcon : 'default';
22
+ this.illustrationRef.innerHTML = ILLUSTRATION_MAP[key];
23
+ }
24
+ }
25
25
  render() {
26
- return (h("div", { key: '50a720a8b293a19dbabccce8f7aa0fa996e5fd63', class: "empty-state" }, h("div", { key: 'd13894b011225337234301bd514891d89caac3d7', class: "empty-state-visual" }, this.imageUrl ? (h("img", { class: "empty-state-img", src: this.imageUrl, alt: this.imageAlt })) : (h("img", { class: "empty-state-img", src: `assets/icons/ilustration/${(!this.dropiIcon || String(this.dropiIcon) === 'undefined' || String(this.dropiIcon) === 'null') ? 'default' : this.dropiIcon}.svg`, alt: this.imageAlt, onError: (e) => e.target.src = 'assets/icons/ilustration/default.svg' }))), this.title && h("h3", { key: 'eb40395b4bd3c623f27bc3290bb37427420c5e94', class: "empty-state-title" }, this.title), this.description && h("p", { key: 'f942c17f7a8d320bbe81dfcd45d13e56d7ea8eba', class: "empty-state-description" }, this.description), h("slot", { key: '513f49ffeeb77e2be1318d6d251a1bcabff2689a' }), this.buttonText && (h("div", { key: 'f6d9c391feee26eac44a8904e1768678bbb1604c', class: "empty-state-actions" }, h("dropi-button", { key: 'f9ea9563a76a80bd29b6e6aaf8405092046a62a8', text: this.buttonText, preIcon: this.buttonIcon, severity: this.buttonSeverity, onClick: () => this.buttonClickEvent.emit() })))));
26
+ return (h("div", { key: '0d8767fe7139adbcc9ba962cfc554ac532678684', class: "empty-state" }, h("div", { key: '3a250c2aab247e465a8b122420748c5ed6bb0e8a', class: "empty-state-visual" }, this.imageUrl ? (h("img", { class: "empty-state-img", src: this.imageUrl, alt: this.imageAlt })) : (h("div", { class: "empty-state-img", ref: (el) => { this.illustrationRef = el; } }))), this.title && h("h3", { key: 'eb1717c48091ff1a05defc703a6a581e4cc2691b', class: "empty-state-title" }, this.title), this.description && h("p", { key: '049ec39cffbc935a44ee8ade7832c80790ae086e', class: "empty-state-description" }, this.description), h("slot", { key: 'e4498968e7f0cb0d505e55d9fe3d4b1bb3a51dc1' }), this.buttonText && (h("div", { key: '1a1263395d6e20dfa89f9702557c064ea0255ef4', class: "empty-state-actions" }, h("dropi-button", { key: '176b76887376c0520398e30cd1006139a163edc7', text: this.buttonText, preIcon: this.buttonIcon, severity: this.buttonSeverity, onClick: () => this.buttonClickEvent.emit() })))));
27
27
  }
28
28
  static get is() { return "dropi-empty-state"; }
29
29
  static get encapsulation() { return "shadow"; }
@@ -51,7 +51,7 @@ export class DropiEmptyState {
51
51
  "optional": false,
52
52
  "docs": {
53
53
  "tags": [],
54
- "text": "Title text (matches Angular 'title')"
54
+ "text": ""
55
55
  },
56
56
  "getter": false,
57
57
  "setter": false,
@@ -71,7 +71,7 @@ export class DropiEmptyState {
71
71
  "optional": false,
72
72
  "docs": {
73
73
  "tags": [],
74
- "text": "Description text"
74
+ "text": ""
75
75
  },
76
76
  "getter": false,
77
77
  "setter": false,
@@ -91,7 +91,7 @@ export class DropiEmptyState {
91
91
  "optional": false,
92
92
  "docs": {
93
93
  "tags": [],
94
- "text": "URL of the illustration image"
94
+ "text": "URL of an external illustration image (overrides dropiIcon)"
95
95
  },
96
96
  "getter": false,
97
97
  "setter": false,
@@ -111,7 +111,7 @@ export class DropiEmptyState {
111
111
  "optional": false,
112
112
  "docs": {
113
113
  "tags": [],
114
- "text": "Alt text for the image"
114
+ "text": ""
115
115
  },
116
116
  "getter": false,
117
117
  "setter": false,
@@ -131,7 +131,7 @@ export class DropiEmptyState {
131
131
  "optional": false,
132
132
  "docs": {
133
133
  "tags": [],
134
- "text": "Primary action button label (empty = hidden) \u2014 matches Angular 'buttonText'"
134
+ "text": "Primary action button label (empty = hidden)"
135
135
  },
136
136
  "getter": false,
137
137
  "setter": false,
@@ -151,7 +151,7 @@ export class DropiEmptyState {
151
151
  "optional": false,
152
152
  "docs": {
153
153
  "tags": [],
154
- "text": "Icon name for button \u2014 matches Angular 'buttonIcon'"
154
+ "text": "Icon name for the action button"
155
155
  },
156
156
  "getter": false,
157
157
  "setter": false,
@@ -171,7 +171,7 @@ export class DropiEmptyState {
171
171
  "optional": false,
172
172
  "docs": {
173
173
  "tags": [],
174
- "text": "State of the illustration (default, loading, sorry, love, success, error) \u2014 matches Angular 'dropiIcon'"
174
+ "text": "Built-in illustration state"
175
175
  },
176
176
  "getter": false,
177
177
  "setter": false,
@@ -191,7 +191,7 @@ export class DropiEmptyState {
191
191
  "optional": false,
192
192
  "docs": {
193
193
  "tags": [],
194
- "text": "Severity for the action button \u2014 matches Angular 'buttonSeverity'"
194
+ "text": ""
195
195
  },
196
196
  "getter": false,
197
197
  "setter": false,
@@ -210,7 +210,7 @@ export class DropiEmptyState {
210
210
  "composed": true,
211
211
  "docs": {
212
212
  "tags": [],
213
- "text": "Emitted when button is clicked \u2014 matches Angular 'buttonClickEvent'"
213
+ "text": ""
214
214
  },
215
215
  "complexType": {
216
216
  "original": "void",
@@ -219,4 +219,5 @@ export class DropiEmptyState {
219
219
  }
220
220
  }];
221
221
  }
222
+ static get elementRef() { return "el"; }
222
223
  }