@dropi/ui 0.1.15 → 0.1.17
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/assets/lottie-files/failure.json +1 -0
- package/assets/lottie-files/question.json +1 -0
- package/assets/lottie-files/success.json +1 -0
- package/assets/lottie-files/warning.json +1 -0
- package/dist/cjs/dropi-accordion.cjs.entry.js +53 -0
- package/dist/cjs/dropi-badge.cjs.entry.js +1 -1
- package/dist/cjs/dropi-button.cjs.entry.js +2 -2
- package/dist/cjs/dropi-checkbox.cjs.entry.js +3 -3
- package/dist/cjs/dropi-empty-state.cjs.entry.js +35 -0
- package/dist/cjs/dropi-icon.cjs.entry.js +3 -3
- package/dist/cjs/dropi-input.cjs.entry.js +2 -2
- package/dist/cjs/dropi-modal.cjs.entry.js +113 -0
- package/dist/cjs/dropi-paginator.cjs.entry.js +89 -0
- package/dist/cjs/dropi-radio-button.cjs.entry.js +2 -2
- package/dist/cjs/dropi-select.cjs.entry.js +2 -2
- package/dist/cjs/dropi-skeleton.cjs.entry.js +47 -0
- package/dist/cjs/dropi-switch.cjs.entry.js +2 -2
- package/dist/cjs/dropi-tabs.cjs.entry.js +49 -0
- package/dist/cjs/dropi-tag.cjs.entry.js +2 -2
- package/dist/cjs/dropi-text-area.cjs.entry.js +3 -3
- package/dist/cjs/dropi-toast.cjs.entry.js +55 -0
- package/dist/cjs/dropi-tooltip.cjs.entry.js +42 -0
- package/dist/cjs/dropi-ui.cjs.js +2 -2
- package/dist/cjs/{index-CuGLZVqo.js → index-B6R6Ojma.js} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +8 -0
- package/dist/collection/components/dropi-accordion/dropi-accordion.css +21 -0
- package/dist/collection/components/dropi-accordion/dropi-accordion.js +170 -0
- package/dist/collection/components/dropi-button/dropi-button.css +7 -1
- package/dist/collection/components/dropi-checkbox/dropi-checkbox.js +2 -2
- package/dist/collection/components/dropi-empty-state/dropi-empty-state.css +58 -0
- package/dist/collection/components/dropi-empty-state/dropi-empty-state.js +195 -0
- package/dist/collection/components/dropi-icon/dropi-icon.css +2 -0
- package/dist/collection/components/dropi-icon/dropi-icon.js +1 -1
- package/dist/collection/components/dropi-input/dropi-input.css +2 -0
- package/dist/collection/components/dropi-modal/dropi-modal.css +124 -0
- package/dist/collection/components/dropi-modal/dropi-modal.js +406 -0
- package/dist/collection/components/dropi-paginator/dropi-paginator.css +100 -0
- package/dist/collection/components/dropi-paginator/dropi-paginator.js +241 -0
- package/dist/collection/components/dropi-radio-button/dropi-radio-button.js +1 -1
- package/dist/collection/components/dropi-select/dropi-select.js +1 -1
- package/dist/collection/components/dropi-skeleton/dropi-skeleton.css +27 -0
- package/dist/collection/components/dropi-skeleton/dropi-skeleton.js +162 -0
- package/dist/collection/components/dropi-switch/dropi-switch.js +1 -1
- package/dist/collection/components/dropi-tabs/dropi-tabs.css +42 -0
- package/dist/collection/components/dropi-tabs/dropi-tabs.js +159 -0
- package/dist/collection/components/dropi-tag/dropi-tag.js +1 -1
- package/dist/collection/components/dropi-text-area/dropi-text-area.js +2 -2
- package/dist/collection/components/dropi-toast/dropi-toast.css +63 -0
- package/dist/collection/components/dropi-toast/dropi-toast.js +164 -0
- package/dist/collection/components/dropi-tooltip/dropi-tooltip.css +67 -0
- package/dist/collection/components/dropi-tooltip/dropi-tooltip.js +147 -0
- package/dist/components/dropi-accordion.d.ts +11 -0
- package/dist/components/dropi-accordion.js +1 -0
- package/dist/components/dropi-button.js +1 -1
- package/dist/components/dropi-checkbox.js +1 -1
- package/dist/components/dropi-empty-state.d.ts +11 -0
- package/dist/components/dropi-empty-state.js +1 -0
- package/dist/components/dropi-icon.js +1 -1
- package/dist/components/dropi-input.js +1 -1
- package/dist/components/dropi-modal.d.ts +11 -0
- package/dist/components/dropi-modal.js +1 -0
- package/dist/components/dropi-paginator.d.ts +11 -0
- package/dist/components/dropi-paginator.js +1 -0
- package/dist/components/dropi-radio-button.js +1 -1
- package/dist/components/dropi-select.js +1 -1
- package/dist/components/dropi-skeleton.d.ts +11 -0
- package/dist/components/dropi-skeleton.js +1 -0
- package/dist/components/dropi-switch.js +1 -1
- package/dist/components/dropi-tabs.d.ts +11 -0
- package/dist/components/dropi-tabs.js +1 -0
- package/dist/components/dropi-tag.js +1 -1
- package/dist/components/dropi-text-area.js +1 -1
- package/dist/components/dropi-toast.d.ts +11 -0
- package/dist/components/dropi-toast.js +1 -0
- package/dist/components/dropi-tooltip.d.ts +11 -0
- package/dist/components/dropi-tooltip.js +1 -0
- package/dist/components/index.js +1 -1
- package/dist/components/{p-MNma8N1x.js → p-ChOXWKmI.js} +1 -1
- package/dist/components/p-NCyvfOs2.js +1 -0
- package/dist/dropi-ui/dropi-ui.css +1 -1
- package/dist/dropi-ui/dropi-ui.esm.js +1 -1
- package/dist/dropi-ui/p-082b7039.entry.js +1 -0
- package/dist/dropi-ui/p-09c38a49.entry.js +1 -0
- package/dist/dropi-ui/p-1739d20c.entry.js +1 -0
- package/dist/dropi-ui/{p-dd089a60.entry.js → p-26dbae0d.entry.js} +1 -1
- package/dist/dropi-ui/p-42179ae4.entry.js +1 -0
- package/dist/dropi-ui/p-4d582d58.entry.js +1 -0
- package/dist/dropi-ui/p-6031ac9d.entry.js +1 -0
- package/dist/dropi-ui/{p-bda1427f.entry.js → p-63e969da.entry.js} +1 -1
- package/dist/dropi-ui/p-65fa8558.entry.js +1 -0
- package/dist/dropi-ui/{p-52291024.entry.js → p-6d15d32f.entry.js} +1 -1
- package/dist/dropi-ui/{p-0faaab2b.entry.js → p-79466fec.entry.js} +1 -1
- package/dist/dropi-ui/p-Twbb5MNM.js +2 -0
- package/dist/dropi-ui/p-a5650d8f.entry.js +1 -0
- package/dist/dropi-ui/p-b0d3442e.entry.js +1 -0
- package/dist/dropi-ui/{p-f785011f.entry.js → p-e44242e2.entry.js} +1 -1
- package/dist/dropi-ui/{p-a46a05a6.entry.js → p-eb7f9a57.entry.js} +1 -1
- package/dist/dropi-ui/{p-a1944f3d.entry.js → p-ecda6e19.entry.js} +1 -1
- package/dist/dropi-ui/{p-9c7076d3.entry.js → p-f0e1e0f6.entry.js} +1 -1
- package/dist/dropi-ui/p-f283f41d.entry.js +1 -0
- package/dist/esm/dropi-accordion.entry.js +51 -0
- package/dist/esm/dropi-badge.entry.js +1 -1
- package/dist/esm/dropi-button.entry.js +2 -2
- package/dist/esm/dropi-checkbox.entry.js +3 -3
- package/dist/esm/dropi-empty-state.entry.js +33 -0
- package/dist/esm/dropi-icon.entry.js +3 -3
- package/dist/esm/dropi-input.entry.js +2 -2
- package/dist/esm/dropi-modal.entry.js +111 -0
- package/dist/esm/dropi-paginator.entry.js +87 -0
- package/dist/esm/dropi-radio-button.entry.js +2 -2
- package/dist/esm/dropi-select.entry.js +2 -2
- package/dist/esm/dropi-skeleton.entry.js +45 -0
- package/dist/esm/dropi-switch.entry.js +2 -2
- package/dist/esm/dropi-tabs.entry.js +47 -0
- package/dist/esm/dropi-tag.entry.js +2 -2
- package/dist/esm/dropi-text-area.entry.js +3 -3
- package/dist/esm/dropi-toast.entry.js +53 -0
- package/dist/esm/dropi-tooltip.entry.js +40 -0
- package/dist/esm/dropi-ui.js +3 -3
- package/dist/esm/{index-DFz-gwFP.js → index-Twbb5MNM.js} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/types/components/dropi-accordion/dropi-accordion.d.ts +29 -0
- package/dist/types/components/dropi-empty-state/dropi-empty-state.d.ts +24 -0
- package/dist/types/components/dropi-modal/dropi-modal.d.ts +37 -0
- package/dist/types/components/dropi-paginator/dropi-paginator.d.ts +32 -0
- package/dist/types/components/dropi-skeleton/dropi-skeleton.d.ts +19 -0
- package/dist/types/components/dropi-tabs/dropi-tabs.d.ts +38 -0
- package/dist/types/components/dropi-toast/dropi-toast.d.ts +38 -0
- package/dist/types/components/dropi-tooltip/dropi-tooltip.d.ts +25 -0
- package/dist/types/components.d.ts +832 -0
- package/package.json +1 -1
- package/readme.md +23 -51
- package/scripts/postinstall.js +19 -0
- package/scripts/setup.js +48 -19
- package/skills/install-dropi-ui/cursor.mdc +2 -7
- package/skills/install-dropi-ui/skill.md +25 -173
- package/dist/dropi-ui/p-21abf91a.entry.js +0 -1
- package/dist/dropi-ui/p-6f0aa619.entry.js +0 -1
- package/dist/dropi-ui/p-DFz-gwFP.js +0 -2
|
@@ -48,7 +48,7 @@ export class DropiTag {
|
|
|
48
48
|
return typeof this.text === 'string' && this.text.trim().length > 0;
|
|
49
49
|
}
|
|
50
50
|
render() {
|
|
51
|
-
return (h("div", { key: '
|
|
51
|
+
return (h("div", { key: 'd559f6c2ed27d543f018d3533d8d972bc47ceb9d', class: "container-chips" }, h("div", { key: 'd131a4626ead2d3d53d5c77875f8ebb19acc3b52', class: { tags: true, 'icon-only': this.showIcon && !this.hasContent }, style: { backgroundColor: this.bgColor, color: this.textColor } }, this.showIcon && this.icon && (h("dropi-icon", { key: '54775a2ca1bd87be3293b3d6417f4a26c6da0c85', class: "file-icon", name: this.icon, width: "16px", height: "16px", color: this.iconColor })), this.hasContent && h("span", { key: 'bce897f4094c33fd53dc98571cae60cd456e0706' }, this.text))));
|
|
52
52
|
}
|
|
53
53
|
static get is() { return "dropi-tag"; }
|
|
54
54
|
static get encapsulation() { return "shadow"; }
|
|
@@ -70,12 +70,12 @@ export class DropiTextArea {
|
|
|
70
70
|
render() {
|
|
71
71
|
const showAsterisk = this.required && this.showAsterisk && !this.disabled;
|
|
72
72
|
const showHelper = this.helperText || this.isInvalid;
|
|
73
|
-
return (h("div", { key: '
|
|
73
|
+
return (h("div", { key: '652b432e3f23f6ca383ca4c44ad3b0da599ecbfb', class: "textarea-wrapper" }, this.label && (h("label", { key: '370698235edc4d8f8d449e66ee4ef90ea9e191d0', htmlFor: this.resolvedId, style: { color: this.disabled ? 'var(--Gray-Gray-400)' : 'var(--Gray-Gray-600)' } }, this.label, showAsterisk && h("span", { key: 'd7c90f3a45b987d7b3229410f141d7fa51fd003d', class: "asterisk" }, " *"))), h("div", { key: '579fadaf791012ab93ddcdff06d237dab27efc9a', class: "textarea-container" }, h("textarea", { key: 'd81a5f25b541e044f7f632512570f53966b156cf', id: this.resolvedId, class: {
|
|
74
74
|
'form-control': true,
|
|
75
75
|
'Body-M-Regular': true,
|
|
76
76
|
'form-control-valid': !this.isInvalid && this.touched && !!this.value,
|
|
77
77
|
'form-control-invalid': this.isInvalid,
|
|
78
|
-
}, rows: this.rows, placeholder: this.placeholder, maxLength: this.maxlength, minLength: this.minlength, disabled: this.disabled, required: this.required, style: { resize: this.resize }, onInput: (e) => this.handleInput(e), onFocus: () => this.dropiFocus.emit(), onBlur: () => this.handleBlur() }, this.value), this.maxlength > 0 && (h("div", { key: '
|
|
78
|
+
}, rows: this.rows, placeholder: this.placeholder, maxLength: this.maxlength, minLength: this.minlength, disabled: this.disabled, required: this.required, style: { resize: this.resize }, onInput: (e) => this.handleInput(e), onFocus: () => this.dropiFocus.emit(), onBlur: () => this.handleBlur() }, this.value), this.maxlength > 0 && (h("div", { key: 'd6c80f4f693e12069a2b1147b489717d61e53e53', class: "char-counter" }, this.charCount, "/", this.maxlength))), showHelper && (h("div", { key: 'af317619d37311746ceefa083bb44ceff6514f92', class: "form-control-helper" }, this.isInvalid && (h("dropi-icon", { key: '2d92acfcb808a67319c8c1aa1a2c9c6c05affcef', name: "Warning-circle", width: "12px", height: "12px", color: "Error-Error-500" })), h("span", { key: 'd2fad4506be938c8376d41ed41186a808364adbf', class: { 'invalid-color': this.isInvalid }, style: { color: this.disabled ? 'var(--Gray-Gray-400)' : undefined } }, this.helperText)))));
|
|
79
79
|
}
|
|
80
80
|
static get is() { return "dropi-text-area"; }
|
|
81
81
|
static get encapsulation() { return "shadow"; }
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
:host { display: contents; }
|
|
2
|
+
*, *::before, *::after { box-sizing: border-box; }
|
|
3
|
+
|
|
4
|
+
.toast-container { position: fixed; z-index: 9999; display: flex; flex-direction: column; gap: 8px; max-width: 380px; width: 100%; pointer-events: none; }
|
|
5
|
+
.toast-container--top-right { top: 80px; right: 0; padding: var(--Size-2, 8px); }
|
|
6
|
+
.toast-container--top-left { top: 80px; left: 0; padding: var(--Size-2, 8px); }
|
|
7
|
+
.toast-container--bottom-right { bottom: 24px; right: 0; padding: var(--Size-2, 8px); flex-direction: column-reverse; }
|
|
8
|
+
.toast-container--bottom-left { bottom: 24px; left: 0; padding: var(--Size-2, 8px); flex-direction: column-reverse; }
|
|
9
|
+
.toast-container--top-center { top: 80px; left: 50%; transform: translateX(-50%); padding: var(--Size-2, 8px); }
|
|
10
|
+
.toast-container--bottom-center { bottom: 24px; left: 50%; transform: translateX(-50%); padding: var(--Size-2, 8px); flex-direction: column-reverse; }
|
|
11
|
+
|
|
12
|
+
.toast-wrapper { pointer-events: auto; animation: toast-in 0.28s ease; transition: opacity 0.28s ease, transform 0.28s ease, max-height 0.32s ease; overflow: hidden; max-height: 200px; }
|
|
13
|
+
.toast-wrapper--leaving { opacity: 0; transform: translateX(20px); max-height: 0; pointer-events: none; }
|
|
14
|
+
@keyframes toast-in { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
|
|
15
|
+
|
|
16
|
+
.toast { position: relative; display: flex; align-items: flex-start; border-radius: var(--Border-2,8px); background: var(--Neutral-White,#fff); box-shadow: 0.5px -1px 7px 0px rgba(0, 0, 0, 0.06); border-left: var(--Size-2, 8px) solid; overflow: hidden; min-width: 300px; }
|
|
17
|
+
.toast--success { border-color: var(--Success-Success-500,#34c38f); }
|
|
18
|
+
.toast--error { border-color: var(--Error-Error-500,#f46a6b); }
|
|
19
|
+
.toast--warn { border-color: var(--Warning-Warning-500,#f1b44c); }
|
|
20
|
+
.toast--info { border-color: var(--Info-Info-500,#50a5f1); }
|
|
21
|
+
|
|
22
|
+
.toast-content {
|
|
23
|
+
display: flex;
|
|
24
|
+
flex-direction: row;
|
|
25
|
+
align-items: flex-start;
|
|
26
|
+
padding: var(--Size-5) var(--Size-5) var(--Size-5) calc(var(--Size-5) - var(--Size-2, 8px));
|
|
27
|
+
gap: var(--Size-4, 16px);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.lottie-img {
|
|
31
|
+
width: 50px;
|
|
32
|
+
height: 50px;
|
|
33
|
+
flex-shrink: 0;
|
|
34
|
+
display: flex;
|
|
35
|
+
align-items: center;
|
|
36
|
+
justify-content: center;
|
|
37
|
+
position: relative;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.lottie-player-container {
|
|
41
|
+
position: absolute;
|
|
42
|
+
top: 0;
|
|
43
|
+
left: 0;
|
|
44
|
+
width: 100%;
|
|
45
|
+
height: 100%;
|
|
46
|
+
z-index: 2;
|
|
47
|
+
display: flex;
|
|
48
|
+
align-items: center;
|
|
49
|
+
justify-content: center;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
lottie-player {
|
|
53
|
+
width: 100%;
|
|
54
|
+
height: 100%;
|
|
55
|
+
display: block;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.info-container { flex: 1; min-width: 0; align-self: center; display: flex; flex-direction: column; gap: var(--Size-1, 4px); }
|
|
59
|
+
.title { margin: 0; font-size: var(--font-size-l,18px); font-weight: var(--font-weight-bold,700); color: var(--Gray-Gray-700,#32394d); line-height: 1.1; text-align: left; max-width: 250px; }
|
|
60
|
+
.description { margin: 0; font-size: var(--font-size-s,14px); color: var(--Gray-Gray-500,#6b7280); line-height: 1.4; text-align: left; max-width: 250px; }
|
|
61
|
+
|
|
62
|
+
.toast-close { position: absolute; top: 18px; right: 10px; background: none; border: none; cursor: pointer; padding: 0; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
|
|
63
|
+
.toast-close:hover { opacity: 0.7; }
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
/**
|
|
3
|
+
* @component dropi-toast
|
|
4
|
+
* Global toast notification stack. Place once in the app root, call show() from JS.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* const t = document.querySelector('dropi-toast');
|
|
8
|
+
* t.show({ severity: 'success', summary: '¡Guardado!', detail: 'Cambios aplicados.' });
|
|
9
|
+
*/
|
|
10
|
+
export class DropiToast {
|
|
11
|
+
/** Toast position */
|
|
12
|
+
position = 'top-right';
|
|
13
|
+
/** Default auto-close ms (0 = manual) */
|
|
14
|
+
life = 4000;
|
|
15
|
+
items = [];
|
|
16
|
+
idCounter = 0;
|
|
17
|
+
/** Show a toast */
|
|
18
|
+
async show(msg) {
|
|
19
|
+
const id = msg.id ?? `t${++this.idCounter}`;
|
|
20
|
+
const item = { msg: { ...msg, id, closable: msg.closable ?? true }, leaving: false };
|
|
21
|
+
this.items = [...this.items, item];
|
|
22
|
+
const ms = msg.life !== undefined ? msg.life : this.life;
|
|
23
|
+
if (ms > 0)
|
|
24
|
+
item.timer = setTimeout(() => this.remove(id), ms);
|
|
25
|
+
}
|
|
26
|
+
/** Remove all toasts */
|
|
27
|
+
async clear() {
|
|
28
|
+
this.items.forEach(i => {
|
|
29
|
+
if (i.timer)
|
|
30
|
+
clearTimeout(i.timer);
|
|
31
|
+
});
|
|
32
|
+
this.items = [];
|
|
33
|
+
}
|
|
34
|
+
remove(id) {
|
|
35
|
+
this.items = this.items.map(i => (i.msg.id === id ? { ...i, leaving: true } : i));
|
|
36
|
+
setTimeout(() => {
|
|
37
|
+
this.items = this.items.filter(i => i.msg.id !== id);
|
|
38
|
+
}, 320);
|
|
39
|
+
}
|
|
40
|
+
lottieMap = {
|
|
41
|
+
success: '/assets/lottie-files/success.json',
|
|
42
|
+
error: '/assets/lottie-files/failure.json',
|
|
43
|
+
warn: '/assets/lottie-files/warning.json',
|
|
44
|
+
info: '/assets/lottie-files/question.json',
|
|
45
|
+
};
|
|
46
|
+
getLottieHtml(severity) {
|
|
47
|
+
return `<lottie-player src="${this.lottieMap[severity]}" background="transparent" speed="1" loop autoplay></lottie-player>`;
|
|
48
|
+
}
|
|
49
|
+
render() {
|
|
50
|
+
return (h("div", { key: '8cce9f62a0b8cac6415881be5f2e6d82bd35668e', class: `toast-container toast-container--${this.position}` }, this.items.map(item => (h("div", { key: item.msg.id, class: { 'toast-wrapper': true, 'toast-wrapper--leaving': item.leaving } }, h("div", { class: `toast toast--${item.msg.severity}` }, h("div", { class: "toast-content" }, h("div", { class: "lottie-img" }, h("div", { class: "lottie-player-container", innerHTML: this.getLottieHtml(item.msg.severity) })), h("div", { class: "info-container" }, h("p", { class: "title" }, item.msg.summary), item.msg.detail && h("p", { class: "description" }, item.msg.detail))), item.msg.closable && (h("button", { class: "toast-close", onClick: () => this.remove(item.msg.id) }, h("dropi-icon", { name: "Close-small", width: "20px", height: "20px", color: "Gray-Gray-400" })))))))));
|
|
51
|
+
}
|
|
52
|
+
static get is() { return "dropi-toast"; }
|
|
53
|
+
static get encapsulation() { return "shadow"; }
|
|
54
|
+
static get originalStyleUrls() {
|
|
55
|
+
return {
|
|
56
|
+
"$": ["dropi-toast.css"]
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
static get styleUrls() {
|
|
60
|
+
return {
|
|
61
|
+
"$": ["dropi-toast.css"]
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
static get properties() {
|
|
65
|
+
return {
|
|
66
|
+
"position": {
|
|
67
|
+
"type": "string",
|
|
68
|
+
"mutable": false,
|
|
69
|
+
"complexType": {
|
|
70
|
+
"original": "'top-right' | 'top-left' | 'bottom-right' | 'bottom-left' | 'top-center' | 'bottom-center'",
|
|
71
|
+
"resolved": "\"bottom-center\" | \"bottom-left\" | \"bottom-right\" | \"top-center\" | \"top-left\" | \"top-right\"",
|
|
72
|
+
"references": {}
|
|
73
|
+
},
|
|
74
|
+
"required": false,
|
|
75
|
+
"optional": false,
|
|
76
|
+
"docs": {
|
|
77
|
+
"tags": [],
|
|
78
|
+
"text": "Toast position"
|
|
79
|
+
},
|
|
80
|
+
"getter": false,
|
|
81
|
+
"setter": false,
|
|
82
|
+
"reflect": false,
|
|
83
|
+
"attribute": "position",
|
|
84
|
+
"defaultValue": "'top-right'"
|
|
85
|
+
},
|
|
86
|
+
"life": {
|
|
87
|
+
"type": "number",
|
|
88
|
+
"mutable": false,
|
|
89
|
+
"complexType": {
|
|
90
|
+
"original": "number",
|
|
91
|
+
"resolved": "number",
|
|
92
|
+
"references": {}
|
|
93
|
+
},
|
|
94
|
+
"required": false,
|
|
95
|
+
"optional": false,
|
|
96
|
+
"docs": {
|
|
97
|
+
"tags": [],
|
|
98
|
+
"text": "Default auto-close ms (0 = manual)"
|
|
99
|
+
},
|
|
100
|
+
"getter": false,
|
|
101
|
+
"setter": false,
|
|
102
|
+
"reflect": false,
|
|
103
|
+
"attribute": "life",
|
|
104
|
+
"defaultValue": "4000"
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
static get states() {
|
|
109
|
+
return {
|
|
110
|
+
"items": {}
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
static get methods() {
|
|
114
|
+
return {
|
|
115
|
+
"show": {
|
|
116
|
+
"complexType": {
|
|
117
|
+
"signature": "(msg: ToastMessage) => Promise<void>",
|
|
118
|
+
"parameters": [{
|
|
119
|
+
"name": "msg",
|
|
120
|
+
"type": "ToastMessage",
|
|
121
|
+
"docs": ""
|
|
122
|
+
}],
|
|
123
|
+
"references": {
|
|
124
|
+
"Promise": {
|
|
125
|
+
"location": "global",
|
|
126
|
+
"id": "global::Promise"
|
|
127
|
+
},
|
|
128
|
+
"ToastMessage": {
|
|
129
|
+
"location": "local",
|
|
130
|
+
"path": "/Users/mac-ti/Documents/dropi/dropi-ui/src/components/dropi-toast/dropi-toast.tsx",
|
|
131
|
+
"id": "src/components/dropi-toast/dropi-toast.tsx::ToastMessage"
|
|
132
|
+
},
|
|
133
|
+
"ToastItem": {
|
|
134
|
+
"location": "global",
|
|
135
|
+
"id": "global::ToastItem"
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
"return": "Promise<void>"
|
|
139
|
+
},
|
|
140
|
+
"docs": {
|
|
141
|
+
"text": "Show a toast",
|
|
142
|
+
"tags": []
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
"clear": {
|
|
146
|
+
"complexType": {
|
|
147
|
+
"signature": "() => Promise<void>",
|
|
148
|
+
"parameters": [],
|
|
149
|
+
"references": {
|
|
150
|
+
"Promise": {
|
|
151
|
+
"location": "global",
|
|
152
|
+
"id": "global::Promise"
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
"return": "Promise<void>"
|
|
156
|
+
},
|
|
157
|
+
"docs": {
|
|
158
|
+
"text": "Remove all toasts",
|
|
159
|
+
"tags": []
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
:host { display: inline-block; }
|
|
2
|
+
*, *::before, *::after { box-sizing: border-box; }
|
|
3
|
+
|
|
4
|
+
.tooltip-wrapper { position: relative; display: inline-flex; align-items: center; justify-content: center; }
|
|
5
|
+
|
|
6
|
+
.tooltip-bubble {
|
|
7
|
+
position: absolute; z-index: 9999;
|
|
8
|
+
background: #1f2433; color: var(--Neutral-White,#fff);
|
|
9
|
+
font-size: var(--font-size-s,14px); line-height: 1.5;
|
|
10
|
+
padding: 8px 12px; border-radius: 8px;
|
|
11
|
+
white-space: normal; pointer-events: none;
|
|
12
|
+
opacity: 0; transition: opacity 0.15s ease, transform 0.15s ease;
|
|
13
|
+
word-break: break-word;
|
|
14
|
+
box-shadow: var(--Shadow-medium);
|
|
15
|
+
text-align: left;
|
|
16
|
+
width: max-content;
|
|
17
|
+
}
|
|
18
|
+
.tooltip-bubble--visible { opacity: 1; }
|
|
19
|
+
|
|
20
|
+
.tooltip-bubble--top { bottom: calc(100% + 12px); left: 50%; transform: translateX(-50%); }
|
|
21
|
+
.tooltip-bubble--bottom { top: calc(100% + 12px); left: 50%; transform: translateX(-50%); }
|
|
22
|
+
.tooltip-bubble--left { right: calc(100% + 12px); top: 50%; transform: translateY(-50%); }
|
|
23
|
+
.tooltip-bubble--right { left: calc(100% + 12px); top: 50%; transform: translateY(-50%); }
|
|
24
|
+
|
|
25
|
+
.tooltip-arrow { position: absolute; width: 12px; height: 6px; }
|
|
26
|
+
.tooltip-arrow::before {
|
|
27
|
+
content: '';
|
|
28
|
+
position: absolute;
|
|
29
|
+
width: 0;
|
|
30
|
+
height: 0;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.tooltip-arrow--top {
|
|
34
|
+
top: 100%; left: 50%; transform: translateX(-50%);
|
|
35
|
+
}
|
|
36
|
+
.tooltip-arrow--top::before {
|
|
37
|
+
border-left: 6px solid transparent;
|
|
38
|
+
border-right: 6px solid transparent;
|
|
39
|
+
border-top: 6px solid #1f2433;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.tooltip-arrow--bottom {
|
|
43
|
+
bottom: 100%; left: 50%; transform: translateX(-50%);
|
|
44
|
+
}
|
|
45
|
+
.tooltip-arrow--bottom::before {
|
|
46
|
+
border-left: 6px solid transparent;
|
|
47
|
+
border-right: 6px solid transparent;
|
|
48
|
+
border-bottom: 6px solid #1f2433;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.tooltip-arrow--left {
|
|
52
|
+
left: 100%; top: 50%; transform: translateY(-50%);
|
|
53
|
+
}
|
|
54
|
+
.tooltip-arrow--left::before {
|
|
55
|
+
border-top: 6px solid transparent;
|
|
56
|
+
border-bottom: 6px solid transparent;
|
|
57
|
+
border-left: 6px solid #1f2433;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.tooltip-arrow--right {
|
|
61
|
+
right: 100%; top: 50%; transform: translateY(-50%);
|
|
62
|
+
}
|
|
63
|
+
.tooltip-arrow--right::before {
|
|
64
|
+
border-top: 6px solid transparent;
|
|
65
|
+
border-bottom: 6px solid transparent;
|
|
66
|
+
border-right: 6px solid #1f2433;
|
|
67
|
+
}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
/**
|
|
3
|
+
* @component dropi-tooltip
|
|
4
|
+
* Wraps content and shows a tooltip bubble on hover/focus.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* <dropi-tooltip text="Más información" position="top">
|
|
8
|
+
* <dropi-button text="Hover" />
|
|
9
|
+
* </dropi-tooltip>
|
|
10
|
+
*/
|
|
11
|
+
export class DropiTooltip {
|
|
12
|
+
/** Tooltip text */
|
|
13
|
+
text = '';
|
|
14
|
+
/** Position: top | bottom | left | right */
|
|
15
|
+
position = 'top';
|
|
16
|
+
/** Max CSS width of the bubble */
|
|
17
|
+
maxWidth = '280px';
|
|
18
|
+
/** Delay in ms before showing */
|
|
19
|
+
showDelay = 0;
|
|
20
|
+
visible = false;
|
|
21
|
+
showTimer = null;
|
|
22
|
+
show = () => {
|
|
23
|
+
if (this.showDelay > 0) {
|
|
24
|
+
this.showTimer = setTimeout(() => { this.visible = true; }, this.showDelay);
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
this.visible = true;
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
hide = () => {
|
|
31
|
+
if (this.showTimer) {
|
|
32
|
+
clearTimeout(this.showTimer);
|
|
33
|
+
this.showTimer = null;
|
|
34
|
+
}
|
|
35
|
+
this.visible = false;
|
|
36
|
+
};
|
|
37
|
+
render() {
|
|
38
|
+
return (h("div", { key: 'c6179d8dfb9f4c3cc2a6a4e79f2e1a9ff8bbd641', class: "tooltip-wrapper", onMouseEnter: this.show, onMouseLeave: this.hide, onFocusin: this.show, onFocusout: this.hide }, h("slot", { key: 'aee7bae9d384369faaa5b078e40f3a8763690bb3' }), this.text && (h("div", { key: 'd00e75f536c5f88c7062ac6359dec3fe7d866cd0', class: { 'tooltip-bubble': true, [`tooltip-bubble--${this.position}`]: true, 'tooltip-bubble--visible': this.visible }, style: { maxWidth: this.maxWidth }, role: "tooltip" }, this.text, h("span", { key: 'aec6a936bbc6677b0e1abf3a18233d90d757cd96', class: `tooltip-arrow tooltip-arrow--${this.position}` })))));
|
|
39
|
+
}
|
|
40
|
+
static get is() { return "dropi-tooltip"; }
|
|
41
|
+
static get encapsulation() { return "shadow"; }
|
|
42
|
+
static get originalStyleUrls() {
|
|
43
|
+
return {
|
|
44
|
+
"$": ["dropi-tooltip.css"]
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
static get styleUrls() {
|
|
48
|
+
return {
|
|
49
|
+
"$": ["dropi-tooltip.css"]
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
static get properties() {
|
|
53
|
+
return {
|
|
54
|
+
"text": {
|
|
55
|
+
"type": "string",
|
|
56
|
+
"mutable": false,
|
|
57
|
+
"complexType": {
|
|
58
|
+
"original": "string",
|
|
59
|
+
"resolved": "string",
|
|
60
|
+
"references": {}
|
|
61
|
+
},
|
|
62
|
+
"required": false,
|
|
63
|
+
"optional": false,
|
|
64
|
+
"docs": {
|
|
65
|
+
"tags": [],
|
|
66
|
+
"text": "Tooltip text"
|
|
67
|
+
},
|
|
68
|
+
"getter": false,
|
|
69
|
+
"setter": false,
|
|
70
|
+
"reflect": false,
|
|
71
|
+
"attribute": "text",
|
|
72
|
+
"defaultValue": "''"
|
|
73
|
+
},
|
|
74
|
+
"position": {
|
|
75
|
+
"type": "string",
|
|
76
|
+
"mutable": false,
|
|
77
|
+
"complexType": {
|
|
78
|
+
"original": "TooltipPosition",
|
|
79
|
+
"resolved": "\"bottom\" | \"left\" | \"right\" | \"top\"",
|
|
80
|
+
"references": {
|
|
81
|
+
"TooltipPosition": {
|
|
82
|
+
"location": "local",
|
|
83
|
+
"path": "/Users/mac-ti/Documents/dropi/dropi-ui/src/components/dropi-tooltip/dropi-tooltip.tsx",
|
|
84
|
+
"id": "src/components/dropi-tooltip/dropi-tooltip.tsx::TooltipPosition"
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
"required": false,
|
|
89
|
+
"optional": false,
|
|
90
|
+
"docs": {
|
|
91
|
+
"tags": [],
|
|
92
|
+
"text": "Position: top | bottom | left | right"
|
|
93
|
+
},
|
|
94
|
+
"getter": false,
|
|
95
|
+
"setter": false,
|
|
96
|
+
"reflect": false,
|
|
97
|
+
"attribute": "position",
|
|
98
|
+
"defaultValue": "'top'"
|
|
99
|
+
},
|
|
100
|
+
"maxWidth": {
|
|
101
|
+
"type": "string",
|
|
102
|
+
"mutable": false,
|
|
103
|
+
"complexType": {
|
|
104
|
+
"original": "string",
|
|
105
|
+
"resolved": "string",
|
|
106
|
+
"references": {}
|
|
107
|
+
},
|
|
108
|
+
"required": false,
|
|
109
|
+
"optional": false,
|
|
110
|
+
"docs": {
|
|
111
|
+
"tags": [],
|
|
112
|
+
"text": "Max CSS width of the bubble"
|
|
113
|
+
},
|
|
114
|
+
"getter": false,
|
|
115
|
+
"setter": false,
|
|
116
|
+
"reflect": false,
|
|
117
|
+
"attribute": "max-width",
|
|
118
|
+
"defaultValue": "'280px'"
|
|
119
|
+
},
|
|
120
|
+
"showDelay": {
|
|
121
|
+
"type": "number",
|
|
122
|
+
"mutable": false,
|
|
123
|
+
"complexType": {
|
|
124
|
+
"original": "number",
|
|
125
|
+
"resolved": "number",
|
|
126
|
+
"references": {}
|
|
127
|
+
},
|
|
128
|
+
"required": false,
|
|
129
|
+
"optional": false,
|
|
130
|
+
"docs": {
|
|
131
|
+
"tags": [],
|
|
132
|
+
"text": "Delay in ms before showing"
|
|
133
|
+
},
|
|
134
|
+
"getter": false,
|
|
135
|
+
"setter": false,
|
|
136
|
+
"reflect": false,
|
|
137
|
+
"attribute": "show-delay",
|
|
138
|
+
"defaultValue": "0"
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
static get states() {
|
|
143
|
+
return {
|
|
144
|
+
"visible": {}
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface DropiAccordion extends Components.DropiAccordion, HTMLElement {}
|
|
4
|
+
export const DropiAccordion: {
|
|
5
|
+
prototype: DropiAccordion;
|
|
6
|
+
new (): DropiAccordion;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e,p as o,H as a,c as i,h as t}from"./index.js";import{d as r}from"./p-ChOXWKmI.js";const d=o(class extends a{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.dropiToggle=i(this,"dropiToggle")}header="";open=!1;disabled=!1;preIcon="";dropiToggle;contentHeight="0px";contentRef;openChanged(e){this.updateHeight(e)}componentDidLoad(){this.updateHeight(this.open)}updateHeight(e){this.contentRef&&(this.contentHeight=e?this.contentRef.scrollHeight+"px":"0px")}handleToggle(){this.disabled||(this.open=!this.open,this.dropiToggle.emit(this.open),setTimeout((()=>this.updateHeight(this.open)),0))}render(){return t("div",{key:"4da35da859fc9fdb7c874c026ef1178c93b7bfd5",class:{accordion:!0,"accordion--open":this.open,"accordion--disabled":this.disabled}},t("button",{key:"77af39a3e990b23b5e185fa99176dadce219a911",class:"accordion-header",onClick:()=>this.handleToggle(),"aria-expanded":this.open+"",disabled:this.disabled},t("span",{key:"cda6c545f4d8342a5e9604245b102defe88be227",class:"accordion-header-left"},this.preIcon&&t("dropi-icon",{key:"b73a39adc40193ae93b235ad5a4169a6ec4caa16",name:this.preIcon,width:"20px",height:"20px",color:"Gray-Gray-600"}),t("span",{key:"d7c4543d5c5580ce421deeca47752c850918efd2",class:"accordion-title"},this.header)),t("span",{key:"9e8884a62c4f9a20e6e15ee69499990db9ded865",class:{"accordion-chevron":!0,"accordion-chevron--open":this.open}},t("dropi-icon",{key:"a4eb14dc1f0ac9c45865e8ee69cf698e1a5c50a7",name:"Dropdown-down",width:"20px",height:"20px",color:"Gray-Gray-500"}))),t("div",{key:"a23b40bb950b86dafca96851319aee3c8bb6656e",class:"accordion-body",style:{maxHeight:this.contentHeight},ref:e=>this.contentRef=e},t("div",{key:"bf69ecafa7d59d776d38c55df10fa25d84d2152a",class:"accordion-content"},t("slot",{key:"bcb928fd4551e65b9e286770979e2e67ff9fb1aa"}))))}static get watchers(){return{open:[{openChanged:0}]}}static get style(){return":host{display:block;width:100%}*,*::before,*::after{box-sizing:border-box}.accordion{border:1px solid var(--Gray-Gray-100,#e6eaf2);border-radius:var(--Border-2,8px);background:var(--Neutral-White,#fff);overflow:hidden}.accordion-header{width:100%;display:flex;align-items:center;justify-content:space-between;padding:var(--Size-4,16px) var(--Size-5,20px);background:transparent;border:none;cursor:pointer;gap:12px;text-align:left}.accordion-header:disabled{cursor:not-allowed;opacity:0.5}.accordion--open .accordion-header{border-bottom:1px solid var(--Gray-Gray-100,#e6eaf2)}.accordion-header-left{display:flex;align-items:center;gap:8px;flex:1;min-width:0}.accordion-title{font-size:var(--font-size-m,14px);font-weight:var(--font-weight-bold,700);color:var(--Gray-Gray-700,#32394d);line-height:1.4}.accordion-chevron{display:flex;align-items:center;flex-shrink:0;transition:transform 0.22s ease}.accordion-chevron--open{transform:rotate(180deg)}.accordion-body{max-height:0;overflow:hidden;transition:max-height 0.28s ease}.accordion-content{padding:0 var(--Size-5,20px) var(--Size-4,16px);color:var(--Gray-Gray-600,#475066);font-size:var(--font-size-s,12px);line-height:1.6}"}},[769,"dropi-accordion",{header:[1],open:[1540],disabled:[4],preIcon:[1,"pre-icon"],contentHeight:[32]},void 0,{open:[{openChanged:0}]}]);function c(){"undefined"!=typeof customElements&&["dropi-accordion","dropi-icon"].forEach((o=>{switch(o){case"dropi-accordion":customElements.get(e(o))||customElements.define(e(o),d);break;case"dropi-icon":customElements.get(e(o))||r()}}))}c();const n=d,s=c;export{n as DropiAccordion,s as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{D as s,d as o}from"./p-NCyvfOs2.js";const p=s,r=o;export{p as DropiButton,r as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e,p as r,H as i,c as t,h as o}from"./index.js";const c=r(class extends i{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.dropiChange=t(this,"dropiChange")}checked=!1;disabled=!1;dropiChange;changeState(){this.disabled||(this.checked=!this.checked,this.dropiChange.emit(this.checked))}render(){return o("div",{key:"
|
|
1
|
+
import{t as e,p as r,H as i,c as t,h as o}from"./index.js";const c=r(class extends i{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.dropiChange=t(this,"dropiChange")}checked=!1;disabled=!1;dropiChange;changeState(){this.disabled||(this.checked=!this.checked,this.dropiChange.emit(this.checked))}render(){return o("div",{key:"f37dba8ec47aec07302f0b6f52d402b4367aa8da",class:"container-dropi-checkbox",onClick:()=>this.changeState()},o("div",{key:"21c72608204b4384de76720192542763c8190b27",class:{check:!0,isCheck:this.checked,noCheck:!this.checked,disabled:this.disabled}},o("svg",{key:"06881031251120f3942fc938e7c0ffad5dde7494",xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none"},o("path",{key:"dd52bac77eca77270cfd645f02fb06a39a7cf519",d:"M20.5991 5.69251L9.08325 17.2075C9.00583 17.2852 8.91382 17.3469 8.8125 17.389C8.71118 17.4311 8.60255 17.4527 8.49283 17.4527C8.38312 17.4527 8.27449 17.4311 8.17317 17.389C8.07185 17.3469 7.97984 17.2852 7.90242 17.2075L3.44908 12.75C3.37166 12.6723 3.27965 12.6106 3.17833 12.5685C3.07701 12.5264 2.96838 12.5048 2.85867 12.5048C2.74896 12.5048 2.64032 12.5264 2.53901 12.5685C2.43769 12.6106 2.34568 12.6723 2.26825 12.75C2.19052 12.8274 2.12884 12.9194 2.08676 13.0208C2.04467 13.1221 2.02301 13.2307 2.02301 13.3404C2.02301 13.4501 2.04467 13.5588 2.08676 13.6601C2.12884 13.7614 2.19052 13.8534 2.26825 13.9308L6.72325 18.385C7.19321 18.8541 7.83008 19.1175 8.49408 19.1175C9.15809 19.1175 9.79496 18.8541 10.2649 18.385L21.7799 6.87251C21.8575 6.7951 21.9191 6.70314 21.9611 6.6019C22.0031 6.50065 22.0247 6.39212 22.0247 6.28251C22.0247 6.17289 22.0031 6.06436 21.9611 5.96312C21.9191 5.86188 21.8575 5.76992 21.7799 5.69251C21.7025 5.61478 21.6105 5.5531 21.5092 5.51101C21.4078 5.46893 21.2992 5.44727 21.1895 5.44727C21.0798 5.44727 20.9712 5.46893 20.8698 5.51101C20.7685 5.5531 20.6765 5.61478 20.5991 5.69251Z",fill:"#FFFFFF"}))))}static get formAssociated(){return!0}static get style(){return":host{display:inline-block}*,*::before,*::after{box-sizing:border-box}.container-dropi-checkbox{display:inline-block}.check{width:20px;height:20px;border-radius:var(--Border-1, 4px);cursor:pointer;transition:background-color 0.3s ease-in-out, border-style 0.3s ease-in-out}.noCheck{border-style:solid;border-width:2px;border-color:var(--Gray-Gray-200, #c3c9d9);display:flex;justify-content:center;align-items:center}.noCheck svg{visibility:hidden}.isCheck{display:flex;background-color:var(--Primary-Primary-500, #f49a3d);justify-content:center;align-items:center}.disabled{background-color:var(--Gray-Gray-50, #f7f8fa);border-color:var(--Gray-Gray-100, #e6eaf2);cursor:not-allowed}"}},[577,"dropi-checkbox",{checked:[1540],disabled:[516]}]);function s(){"undefined"!=typeof customElements&&["dropi-checkbox"].forEach((r=>{"dropi-checkbox"===r&&(customElements.get(e(r))||customElements.define(e(r),c))}))}s();const a=c,d=s;export{a as DropiCheckbox,d as defineCustomElement}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface DropiEmptyState extends Components.DropiEmptyState, HTMLElement {}
|
|
4
|
+
export const DropiEmptyState: {
|
|
5
|
+
prototype: DropiEmptyState;
|
|
6
|
+
new (): DropiEmptyState;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t,p as e,H as a,c as i,h as s}from"./index.js";import{d as r}from"./p-NCyvfOs2.js";import{d as o}from"./p-ChOXWKmI.js";const c=e(class extends a{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.dropiAction=i(this,"dropiAction"),this.dropiSecondaryAction=i(this,"dropiSecondaryAction")}header="";description="";imageUrl="";imageAlt="Sin resultados";actionLabel="";secondaryLabel="";dropiAction;dropiSecondaryAction;render(){return s("div",{key:"1aea01715d0e50b308904d496be7bc2f607bf5aa",class:"empty-state"},this.imageUrl?s("img",{class:"empty-state-img",src:this.imageUrl,alt:this.imageAlt}):s("div",{class:"empty-state-placeholder"},s("svg",{viewBox:"0 0 80 80",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"empty-state-svg"},s("rect",{width:"80",height:"80",rx:"40",fill:"var(--Gray-Gray-100, #e6eaf2)"}),s("path",{d:"M40 20C29 20 20 29 20 40s9 20 20 20 20-9 20-20S51 20 40 20zm0 36c-8.8 0-16-7.2-16-16S31.2 24 40 24s16 7.2 16 16-7.2 16-16 16zm-1-28h2v12h-2zm0 14h2v2h-2z",fill:"var(--Gray-Gray-400, #858ea6)"}))),this.header&&s("h3",{key:"41e5da8d482456f4b9006449a27a9f9d172d87b4",class:"empty-state-title"},this.header),this.description&&s("p",{key:"ffa6399489ec56cd2cf84bb39d12c112bee64302",class:"empty-state-description"},this.description),s("slot",{key:"6ccdfed94a22ad7ece2388fba3d4734aa6a2b509"}),(this.actionLabel||this.secondaryLabel)&&s("div",{key:"0da97fd516eccd1cabe846b2d002fdf75306674d",class:"empty-state-actions"},this.secondaryLabel&&s("dropi-button",{key:"de1b1ad4d6a50cfd251de243a3b5ea3beb10019b",text:this.secondaryLabel,severity:"secondary",onDropiClick:()=>this.dropiSecondaryAction.emit()}),this.actionLabel&&s("dropi-button",{key:"59f3b47ee14f3ac89aa4acc5b42d856f26d02d19",text:this.actionLabel,severity:"primary",onDropiClick:()=>this.dropiAction.emit()})))}static get style(){return":host{display:block}*,*::before,*::after{box-sizing:border-box}.empty-state{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--Size-3, 12px);padding:var(--Size-6, 32px) var(--Size-5, 20px);text-align:center}.empty-state-img{max-width:200px;width:100%;height:auto;object-fit:contain}.empty-state-svg{width:80px;height:80px}.empty-state-placeholder{display:flex;align-items:center;justify-content:center}.empty-state-title{margin:0;font-size:var(--font-size-l, 18px);font-weight:var(--font-weight-bold, 700);color:var(--Gray-Gray-700, #32394d);line-height:1.3}.empty-state-description{margin:0;font-size:var(--font-size-s, 12px);color:var(--Gray-Gray-500, #69738c);line-height:1.6;max-width:400px}.empty-state-actions{display:flex;align-items:center;gap:var(--Size-3, 12px);flex-wrap:wrap;justify-content:center;margin-top:var(--Size-2, 8px)}"}},[769,"dropi-empty-state",{header:[1],description:[1],imageUrl:[1,"image-url"],imageAlt:[1,"image-alt"],actionLabel:[1,"action-label"],secondaryLabel:[1,"secondary-label"]}]);function n(){"undefined"!=typeof customElements&&["dropi-empty-state","dropi-button","dropi-icon"].forEach((e=>{switch(e){case"dropi-empty-state":customElements.get(t(e))||customElements.define(t(e),c);break;case"dropi-button":customElements.get(t(e))||r();break;case"dropi-icon":customElements.get(t(e))||o()}}))}n();const d=c,p=n;export{d as DropiEmptyState,p as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{D as o,d as s}from"./p-
|
|
1
|
+
import{D as o,d as s}from"./p-ChOXWKmI.js";const m=o,p=s;export{m as DropiIcon,p as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e,p as
|
|
1
|
+
import{t as e,p as t,H as r,c as o,h as a}from"./index.js";import{d as i}from"./p-ChOXWKmI.js";const s=t(class extends r{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.dropiInput=o(this,"dropiInput"),this.dropiChange=o(this,"dropiChange"),this.dropiFocus=o(this,"dropiFocus"),this.dropiBlur=o(this,"dropiBlur"),this.internals=this.attachInternals()}internals;inputId="";name="";label="";placeholder=" ";value="";maxlength;disabled=!1;required=!1;showAsterisk=!0;fixedLabel=!1;inputMode="text";passwordInput=!1;moneyFormat=!1;thousandSeparator=!1;onlyNumbers=!1;allowDecimals=!1;onlyLetters=!1;icon="";iconColor="Gray-Gray-400";invalid=!1;helperText="";showHelperOnlyOnError=!1;showPassword=!1;touched=!1;dropiInput;dropiChange;dropiFocus;dropiBlur;valueChanged(e){this.internals.setFormValue(e)}disabledChanged(e){this.internals.setValidity(e?{customError:!0}:{},e?"Field is disabled":"")}componentWillLoad(){this.internals.setFormValue(this.value??"")}handleInput(e){let t=e.target.value;this.onlyNumbers&&(t=this.filterNumbers(t)),this.onlyLetters&&(t=this.filterLetters(t)),(this.moneyFormat||this.thousandSeparator)&&(t=this.formatThousands(t,this.moneyFormat)),this.value=t,this.internals.setFormValue(t),this.dropiInput.emit(t)}handleKeyDown(e){this.onlyNumbers&&!this.isAllowedNumberKey(e)&&e.preventDefault(),this.onlyLetters&&!this.isAllowedLetterKey(e)&&e.preventDefault()}handleFocus(){this.dropiFocus.emit()}handleBlur(){this.touched=!0,this.dropiChange.emit(this.value),this.dropiBlur.emit()}togglePassword(){this.disabled||(this.showPassword=!this.showPassword)}filterNumbers(e){return e.replace(this.allowDecimals?/[^0-9.]/g:/[^0-9]/g,"")}filterLetters(e){return e.replace(/[^a-zA-ZáéíóúÁÉÍÓÚñÑüÜ\s]/g,"")}isAllowedNumberKey(e){return!!(["Backspace","Delete","ArrowLeft","ArrowRight","Tab","Enter","Home","End"].includes(e.key)||e.ctrlKey||e.metaKey||/^[0-9]$/.test(e.key)||this.allowDecimals&&"."===e.key)}isAllowedLetterKey(e){return!!["Backspace","Delete","ArrowLeft","ArrowRight","Tab","Enter","Home","End"," "].includes(e.key)||!(!e.ctrlKey&&!e.metaKey)||/^[a-zA-ZáéíóúÁÉÍÓÚñÑüÜ]$/.test(e.key)}formatThousands(e,t){const r=e.replace(/[^0-9.]/g,""),[o,a]=r.split("."),i=o.replace(/\B(?=(\d{3})+(?!\d))/g,","),s=void 0!==a?`${i}.${a}`:i;return t?"$"+s:s}get resolvedId(){return this.inputId||this.label}get inputType(){return this.passwordInput?this.showPassword?"text":"password":"text"}get showHelper(){return!!this.helperText&&(!this.showHelperOnlyOnError||this.invalid&&this.touched)}get isInvalid(){return this.invalid&&this.touched}render(){const e=this.required&&this.showAsterisk&&!this.disabled,t=!!this.icon&&!!this.value;return a("div",{key:"4ea9c2118e6452345a2a92eedc807e6d94019784",class:{"fixed-label-container":this.fixedLabel}},this.fixedLabel&&a("div",{key:"b8c1269e9d583becd9614f6f3c28f6a2b536f18f",class:"input-label Body-S-Regular"},this.label,e&&a("span",{key:"945665772caab1a1c95f1a054dea1b8dd88287a3",class:"asterisk"}," *")),a("div",{key:"f550584dde83c907429255d9a98b8a59ff322cbb",class:"form-group"},a("div",{key:"6cc46f5822e62d59bb211e7d9eb7909ab2b833c9",class:"input-container"},t&&a("dropi-icon",{key:"c860e808ae7cd805aa9c430d52743f7eab0aaeba",class:"icon-input",name:this.icon,color:this.iconColor,width:"20px",height:"20px"}),this.passwordInput&&a("dropi-icon",{key:"ba571d4d14ec2a911a8b0bd4cdc7a8481aebe746",class:"icon-input-password",name:this.showPassword?"Eye":"Eye-crossed",width:"20px",height:"20px",color:"Gray-Gray-500",onClick:()=>this.togglePassword()}),a("input",{key:"aad18a94d94c9600236bac7c23e38b1c1c41f06a",id:this.resolvedId,class:{"form-control":!0,"form-control-valid":!this.isInvalid&&this.touched&&!!this.value,"form-control-invalid":this.isInvalid,"padding-icon":t,"text-password":this.passwordInput&&!this.showPassword,"fixed-label-input":this.fixedLabel},type:this.inputType,value:this.value,placeholder:this.fixedLabel?this.placeholder:" ",disabled:this.disabled,required:this.required,maxLength:this.maxlength,inputMode:this.inputMode,"data-cy":void 0,onInput:e=>this.handleInput(e),onKeyDown:e=>this.handleKeyDown(e),onFocus:()=>this.handleFocus(),onBlur:()=>this.handleBlur()}),!this.fixedLabel&&a("label",{key:"8ba7ea50525aa8990662d45829ba732094c41f80",class:"Body-S-Regular label-bottom",htmlFor:this.resolvedId},this.label,e&&a("span",{key:"3916d3de6392da62b8086920cd2fce3b96238416",class:"asterisk"}," *")),this.showHelper&&a("div",{key:"83e17f7d0cdb503b86fd035775e1cb45d9f41709",class:"form-control-helper"},this.isInvalid&&a("dropi-icon",{key:"4e034348270853f8a3aafbbbb938a5974076aebd",name:"Warning-circle",width:"12px",height:"12px",color:"Error-Error-500"}),a("span",{key:"7832f200ccc6f6273d65012b9e642c313399a277",class:{"disabled-helper":this.disabled,"invalid-color":this.isInvalid}},this.helperText)))))}static get formAssociated(){return!0}static get watchers(){return{value:[{valueChanged:0}],disabled:[{disabledChanged:0}]}}static get style(){return":host{display:block;width:100%}*,*::before,*::after{box-sizing:border-box}.fixed-label-container{display:flex;width:100%;flex-direction:column;align-items:flex-start;gap:8px}.input-label{color:var(--Gray-Gray-600, #475066);font-size:var(--font-size-xs, 10px);font-weight:var(--font-weight-regular, 400);text-align:left}.asterisk{color:var(--Error-Error-500, #f46a6b)}.form-group{position:relative;width:100%}.input-container{position:relative}.icon-input{position:absolute;top:10px;left:5px;z-index:1}.icon-input-password{position:absolute;top:10px;right:13px;cursor:pointer;z-index:1}.form-control{box-sizing:border-box;width:100%;padding:var(--Size-2, 8px);border:1px solid var(--Gray-Gray-200, #c3c9d9);border-radius:var(--Border-2, 8px);background:var(--Neutral-White, #fff);font-size:var(--font-size-s, 12px);font-family:inherit;color:var(--Gray-Gray-700, #32394d);transition:border-color 0.3s ease-in-out;height:40px;outline:none;appearance:none;text-align:left}.form-control::placeholder{color:transparent;transition:color 0.2s ease-in-out}.form-control:focus::placeholder,.fixed-label-input::placeholder{color:var(--Gray-Gray-400, #858ea6)}.form-control:focus{border-color:var(--Info-Info-500, #50a5f1)}.form-control-valid{border-color:var(--Gray-Gray-400, #858ea6) !important;color:var(--Gray-Gray-600, #475066)}.form-control-invalid{border-color:var(--Error-Error-500, #f46a6b) !important;color:var(--Gray-Gray-600, #475066)}.form-control:disabled{border-color:var(--Gray-Gray-200, #c3c9d9) !important;color:var(--Gray-Gray-400, #858ea6);background-color:var(--Gray-Gray-50, #f7f8fa);cursor:not-allowed}.padding-icon{padding-left:28px}.text-password{-webkit-text-security:disc;text-security:disc}label.label-bottom{position:absolute;font-weight:var(--font-weight-regular, 400);top:10px;font-size:var(--font-size-s, 12px);color:var(--Gray-Gray-500, #69738c);left:10px;transition:all 0.2s ease-in-out;pointer-events:none;overflow:hidden;width:90%;white-space:nowrap}.form-control:focus+label.label-bottom,.form-control:not(:placeholder-shown)+label.label-bottom{top:-22px;left:0;font-size:var(--font-size-xs, 10px);color:var(--Gray-Gray-600, #475066);width:unset}.form-control:disabled+label.label-bottom{color:var(--Gray-Gray-400, #858ea6)}.form-control-helper{display:flex;position:absolute;top:100%;left:0;gap:4px;align-items:center;margin-top:4px}.form-control-helper span{display:block;color:var(--Gray-Gray-600, #475066);font-size:var(--font-size-xs, 10px)}.invalid-color{color:var(--Error-Error-500, #f46a6b) !important}.disabled-helper{color:var(--Gray-Gray-400, #858ea6) !important}.disabled-helper{color:var(--Gray-Gray-400, #858ea6) !important}"}},[577,"dropi-input",{inputId:[1,"input-id"],name:[1],label:[1],placeholder:[1],value:[1025],maxlength:[2],disabled:[516],required:[516],showAsterisk:[4,"show-asterisk"],fixedLabel:[4,"fixed-label"],inputMode:[1,"input-mode"],passwordInput:[4,"password-input"],moneyFormat:[4,"money-format"],thousandSeparator:[4,"thousand-separator"],onlyNumbers:[4,"only-numbers"],allowDecimals:[4,"allow-decimals"],onlyLetters:[4,"only-letters"],icon:[1],iconColor:[1,"icon-color"],invalid:[4],helperText:[1,"helper-text"],showHelperOnlyOnError:[4,"show-helper-only-on-error"],showPassword:[32],touched:[32]},void 0,{value:[{valueChanged:0}],disabled:[{disabledChanged:0}]}]);function l(){"undefined"!=typeof customElements&&["dropi-input","dropi-icon"].forEach((t=>{switch(t){case"dropi-input":customElements.get(e(t))||customElements.define(e(t),s);break;case"dropi-icon":customElements.get(e(t))||i()}}))}l();const n=s,d=l;export{n as DropiInput,d as defineCustomElement}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface DropiModal extends Components.DropiModal, HTMLElement {}
|
|
4
|
+
export const DropiModal: {
|
|
5
|
+
prototype: DropiModal;
|
|
6
|
+
new (): DropiModal;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|