sigpro-ui 1.0.6

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 (43) hide show
  1. package/Readme.md +146 -0
  2. package/dist/sigpro-ui.cjs +1677 -0
  3. package/dist/sigpro-ui.esm.js +1621 -0
  4. package/dist/sigpro-ui.umd.js +1680 -0
  5. package/dist/sigpro-ui.umd.min.js +1 -0
  6. package/index.js +40 -0
  7. package/package.json +52 -0
  8. package/src/components/Accordion.js +24 -0
  9. package/src/components/Alert.js +50 -0
  10. package/src/components/Autocomplete.js +95 -0
  11. package/src/components/Badge.js +6 -0
  12. package/src/components/Button.js +39 -0
  13. package/src/components/Checkbox.js +21 -0
  14. package/src/components/Colorpicker.js +81 -0
  15. package/src/components/Datepicker.js +252 -0
  16. package/src/components/Drawer.js +18 -0
  17. package/src/components/Dropdown.js +37 -0
  18. package/src/components/Fab.js +51 -0
  19. package/src/components/Fieldset.js +19 -0
  20. package/src/components/Fileinput.js +113 -0
  21. package/src/components/Indicator.js +9 -0
  22. package/src/components/Input.js +77 -0
  23. package/src/components/List.js +18 -0
  24. package/src/components/Loading.js +13 -0
  25. package/src/components/Menu.js +25 -0
  26. package/src/components/Modal.js +31 -0
  27. package/src/components/Navbar.js +6 -0
  28. package/src/components/Radio.js +25 -0
  29. package/src/components/Range.js +24 -0
  30. package/src/components/Rating.js +34 -0
  31. package/src/components/Select.js +36 -0
  32. package/src/components/Stack.js +6 -0
  33. package/src/components/Stat.js +11 -0
  34. package/src/components/Swap.js +13 -0
  35. package/src/components/Table.js +60 -0
  36. package/src/components/Tabs.js +46 -0
  37. package/src/components/Timeline.js +52 -0
  38. package/src/components/Toast.js +63 -0
  39. package/src/components/Tooltip.js +6 -0
  40. package/src/components/index.js +110 -0
  41. package/src/core/i18n.js +26 -0
  42. package/src/core/icons.js +17 -0
  43. package/src/core/utils.js +5 -0
@@ -0,0 +1,1621 @@
1
+ import { $html, $, $for, $if, $mount } from 'sigpro';
2
+
3
+ const val = t => typeof t === "function" ? t() : t;
4
+
5
+ const joinClass = (t, l) => typeof l === "function"
6
+ ? () => `${t} ${l() || ""}`.trim()
7
+ : `${t} ${l || ""}`.trim();
8
+
9
+ var Utils = /*#__PURE__*/Object.freeze({
10
+ __proto__: null,
11
+ joinClass: joinClass,
12
+ val: val
13
+ });
14
+
15
+ /** ACCORDION */
16
+ const Accordion = (props, children) => {
17
+ const { title, name, open, ...rest } = props;
18
+
19
+ return $html(
20
+ "div",
21
+ {
22
+ ...rest,
23
+ class: joinClass("collapse collapse-arrow bg-base-200 mb-2", props.class),
24
+ },
25
+ [
26
+ $html("input", {
27
+ type: name ? "radio" : "checkbox",
28
+ name: name,
29
+ checked: open
30
+ }),
31
+ $html("div", { class: "collapse-title text-xl font-medium" }, title),
32
+ $html("div", { class: "collapse-content" }, children),
33
+ ],
34
+ );
35
+ };
36
+
37
+ var AccordionModule = /*#__PURE__*/Object.freeze({
38
+ __proto__: null,
39
+ Accordion: Accordion
40
+ });
41
+
42
+ const iconShow = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAAdgAAAHYBTnsmCAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAADjSURBVDiN3dJNSgNBEAXgz4DZeAAVJ9tko2St3kaIFxAVt4KZeAD1GKKi7vQSydI/yHgALxAXU02GxniAFBR0v1ev+3V1sZSxjxtM8BM5wTX2/hNu4gFvOMI21iJ3cIwP3GMjF/dQ4RyraOMS34GPAmvjIrBeEnfwjoPGgSM8ooh8QtngB6Ep4BWnmaMqkY1LqqzmDC8tzNDK3/RHzLL9SloUYWfQIMuw3Yl8xrDBH6qbvZWALqbqBqVmlWF7GuKEDwPr5hbXcYdPnKBv/o39wL5wG7ULY1c9NGPzQRrjKrhli1/02zEjWyWMBwAAAABJRU5ErkJggg==";
43
+ const iconHide = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAAdgAAAHYBTnsmCAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAEDSURBVDiN1dK/K8VhFAbwD+VLGSxKcu9guSQ/Zils/gNkuaX4BxRZDTdklYU/QAaDlEVGGwu2Kz/uVbKJzWDwfuv1+jHz1Km3c85znuf0Hv4jxnD2W8MItnCJ5xAX2MQcHsOQL+jEAapYQD9aQwxiDy+B3JKSe1DHCpqQYQ0PeMJOpDyAmyAAirjGbDRwFYcoYCZSzjGP+8B1gqXEUT2QxyPlqaRnGceNeENzUswwil1MBocbSU9DCAXUUI6K25HtIo5QSVaooitP9OEO65iIbE+HXSvBVRbeNZQSR9pxGil3o83HNw5hEbfYR0dKFki5ci+u8OrzIQ1/R8xx7ocL+9t4B0HPOVXjoptxAAAAAElFTkSuQmCC";
44
+ const iconClose = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAAdgAAAHYBTnsmCAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAABcSURBVDiN3dIxDoAwCIXhL563g3bSm+hlq4O6GFNbO+k/EV54QIDfsSBk9IA5ZxCQEG+0eGi5BqDHivEhV2xSXXwy2EdOR3xLV+ta0/26wvSm+KTYpPmMzY/0QTZeZR2f+FxhRQAAAABJRU5ErkJggg==";
45
+ const iconCalendar = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAAdgAAAHYBTnsmCAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAACLSURBVDiN7dO9CQJBFEXhb38K0FwQrMNEVpuwB0NjrcYabECsQk0sQ1mTF4zIjrgmBh54MMx998AEwzOrmC5e8gJjbDHCJO7PHYI0v2JT4Ig9DljGwq5DkOZTLOCOMoIhBpknpHmFWx3ldaaUo6oTc2/ab7rl+508f8GvCC5oenTn4tM1cWg/nBNmD4fBH/Kfvt2TAAAAAElFTkSuQmCC";
46
+ const iconLock = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAAWQAAAFkBqp2phgAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAACQSURBVDiN7dKxDcJQDATQJ0YgXQQ1bAgDEIZBETPQwjakIjRQ8CMSyR8SiZKTrvHZd/r+JsYSNZrEI1ZR4ywzfElcJ55xwiITOECNTVDf4jDGoEEZ1Etcxxg8pmjRDiahb7BH20uKKPVUkVmL+YjQArdI+PT2bO9Pd/A34O71Rd9QeN/LAFUSckfUscWuG3oCgP8nrDH6T5AAAAAASUVORK5CYII=";
47
+ const iconAbc = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAAdgAAAHYBTnsmCAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAADFSURBVDiN7dCxSoIBFAXgr1BbgmgSB5ubxKAHaAkcgnBpySVaDET3WhzcpQfoHZojawgX0ZZcfAWDSDdBoeUKP/8ojZ7tnnPv4dzDFv+KZzwl5jf84B354C4wwjdeUV4vl7DCEsXgxmhigDpOMcMVjoKr7cTyI/ZxiE90wmCB4zi+RRatZOxd7OEavxHtBmvjIV5wH2a59N8ZXIZQisMCzkL/wgGq6EYffXzgHHNo4y5h+oBGlLjEBJVUiVP0cJJOtMUG+APtfyYzbH7eVgAAAABJRU5ErkJggg==";
48
+ const icon123 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAB2AAAAdgFOeyYIAAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAAMxJREFUOI3t0bFKwlEUBvBfmmBEr1APIDZJ9AJJQyAIvkGP0C4uQruza+DUmuIc9AC9gBG4Nmpkw/8IB3Vw1w8u95zvnvPde77LEeUUV9HAF67QRA2nmMf5A+o4x3cWOsMYy8j7WMX6jaYbLBL/mAWe8RcHm1ihs8G94gVKQQzwlAouMcQo8p/Y28HdYpYFZmsi0MVdxD1MdrxsC500wijdvgtbI1AYtDbxMwkuFAZmE1uYwkkSqOIaHyHcxEU0vUXNPSqKr37fZ6xDwD9DPS0OyHjQHQAAAABJRU5ErkJggg==";
49
+ const iconMail = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAAdgAAAHYBTnsmCAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAC4SURBVDiNxdIxagJRFIXhLzLFBNJYaJslSEylWOhq3IorMGQ16SyjYCFiZWU5pTaDFvOUyTAZ8RHID69555577oXLf/OEGaY4R3g/4IhORHg3eOXYYvSAeRQ8OWQYYoNPvDQYnxUr7zBB1grCAv3QbIlxjXmAb7Txhq+rkFUKq9NUU8vcJiizwDtOWGEdmvTKqT+61H0GXsP7jSxpEGF/R1e3wkO0FBeVRnhTSBTneBB3yvOI4D/mAnvrIwKM5s4AAAAAAElFTkSuQmCC";
50
+ const iconInfo = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAnXAAAJ1wGxbhe3AAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAASVJREFUOI190r0uhFEQBuBnVxaF2PUTCkFchV0SV6BQi0rEbShFlCqNktJP0Iqf3i3YVSlXVEQozojP8e2+ySSTed+ZMzNnKnpjCFPhv+C9j/YPlnCBV3TCujhHq19iFftoYxOjBa4esTb2QvsP+7jFWJ9HxnEXRf5gGU9Z8gKucBl+sUgHTahE8AJnOCoIT/AcmhmsF7gtrGINBqWFFWcmLXMUhzjIuEbk1GA+2i/DNh4wUsK1MVfFV2GUHJO4xlsPHr8j1Eu44bAcDek2agP4lDZaxWMm3MEKbrL4hjT/8U+gJc00nglnw4qYkL5xMW9rTzqSvEiefI/dMrIaRTrSPzcKXCNinUguPeUfNKWj6kqH9Bz+aVnbvb6PtKTp8F/wUSb6Bu5YN5n7ff0kAAAAAElFTkSuQmCC";
51
+ const iconSuccess = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAnXAAAJ1wGxbhe3AAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAAQtJREFUOI2F0jFOAlEQBuAPImoFqyTa6TEEbfUihruYDYfwCAg3UDsTY20na0VjgqUWWuxgHsuy/skk82bmn/fPm9eyHXs4Cn+Br4baNZxjhk8UYUtMMWwitjHGHNfoJrlexObIo3YDY9zjoOGSQzxEkzVc4O0fctqkwCANzkJiE9LmI9ytDrvKB+tWGQnylIAsOB04VcrfdluO55CeYo6THfygVUne4jX8S1zho1LTDu7fCL2KxCe8oF8zUqb8G51VYGrzEffD6jDCJA0MY6bqnHXoK9d4Vk3kyk/S1KSPR9zUJdvRpAiJWZLLIlYEufYrrzBQ7nyJ97ClcuYN2dX1pejgOPwFvuuKfgHXiDR+HL1j1AAAAABJRU5ErkJggg==";
52
+ const iconError = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAnXAAAJ1wGxbhe3AAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAARZJREFUOI2V0j1KQ1EQBeDPp4lWRiMoKVyAK9AoiLgJGytxD9oJNhKyDyvBnw2IugC3YGKVRk1KRbR48yC5vjzwwIHL3DPnzp2ZGdMxj9U4D/BZoZ3ANu4wQj84xC3aVYkZuujhCItjd42I9dAJ7R908YDlikeaeAyTCezgpST5IJia9LFVlA0nOMd7It4IjuMttKeFQR17uKooPcUV9lHL0ArX0T8MPqLa1hx+MDNFWDX7LHLV4/VGiWghmGJJvhu1WXzLO5rhORGeYRf3SfwQNVwWgbZ8SZqJcD04jhX5GDfTsjryJUlN0uQnXJRdZmHSx7H8nwWWItaP5NJVLrCFG3mTXoNDXJeVPW185E1ai/MAX2WiX9S3NSPYbj+uAAAAAElFTkSuQmCC";
53
+ const iconWarning = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAnXAAAJ1wGxbhe3AAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAARJJREFUOI2l0r8uRFEQBvAfu9glwUYiUaxHUEl0VDpKeq+wpZBINAqFRHgTKg0tCSqVhmKDEM1u/Esodm725rq7iC+ZzMnM982ZmXP4JwpdchWsYBrXeMkj9XQQV3GEi+BMYR63v+mqiDPUUrEaTiP3I1ZxEOcySnE+jFxXVPEQPimWiCYzOdCbKbCFPe1Z+8PgBvvBycVMCIdSsY2wBEPBmcnrYBtraKRib2EJGljHjswLLuI8Z6SS9hLTl15iIR08wZLv2AzLYjk0YATP8n9lVWbrgUJohosYxCdG8Zghdvp5ldCUi6hrPd0VjvGEVzTxEYLkogGMYQ67uEtvcgKzGA8y9IV/D9/Evdb89Q7d/Q1fB8U0mpUmzV0AAAAASUVORK5CYII=";
54
+ const iconLeft = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAAdgAAAHYBTnsmCAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAABfSURBVDiNY2AY8oCZSHWxDAwMEgwMDHfJsaSAgYHhH9QQsjT/Z2BgKKe75gQGiLMLCSlkwiHOSI6t6ADmhYoBN6SIARIeidgkiUlIxxkYGB4xMDB8YmBguE6JSwYpAACvLRHTKwPjZgAAAABJRU5ErkJggg==";
55
+ const iconRight = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAAdgAAAHYBTnsmCAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAABNSURBVDiN3dAxCoAwFATRh3fU2oAHiDbi5Y1F2jT+gKLbzyy7/DYjUo8g4cTWI8koOF6XrOqc5ifDDVGJthfsj8OLujtHYJgwR+GP5QKMxA9/SolDQgAAAABJRU5ErkJggg==";
56
+ const iconLLeft = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAAdgAAAHYBTnsmCAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAABlSURBVDiN3ZLBDUBAEEUfmtCchA5woUMlOO1FCQrAwbqwf8eFhHd7mfzJn2Tg82TGvABywAmPUgOLD4XcDK9AJ/y5cOlrNsIvpCdPDL/FUbkX/t6Slv3+SjgQf6QBmIAZGAP+FzZJViOd89x8pAAAAABJRU5ErkJggg==";
57
+ const iconRRight = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAAdgAAAHYBTnsmCAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAABmSURBVDiN3dGxCoAgEMbxfz1dL1BTREJzmUv08trgDYcg6VCD3/YD7zvkoLmMgFEegLmmwAAecOJVvNeUWCAAt7IHjt9LThkyiRf9qC8oCom70u0BuDL+bngj/tNm/JqJePucW8wDvGYdzT0nMUkAAAAASUVORK5CYII=";
58
+ const iconUpload = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAAdgAAAHYBTnsmCAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAADNSURBVDiNndOxTgJRFIThz41ZDMFKqH0DLSRSq4lQ0RifUcMzUJlYQKjtLcHVSimBggPRNSzs/sk0kzPnTHEvxZyHKnGJD3yhXSWcYRnKwvvH0Y7wEG/4wQI1XOEek6LLF3FtiDoGoXp4WcxsSXILHjFCH/Nf/jy8ER6KGuTZNNhJvkFpEpygUyHbRi1BFy8VFryilyANlSVFerxn6N36IRVyG0PNEtdbkbmBU8zwdOCSJp4xRWNj3sWS5YGaRvM/f6GBa5ztafCJMb5hBQQ/MMwXLnnZAAAAAElFTkSuQmCC";
59
+
60
+ var Icons = /*#__PURE__*/Object.freeze({
61
+ __proto__: null,
62
+ icon123: icon123,
63
+ iconAbc: iconAbc,
64
+ iconCalendar: iconCalendar,
65
+ iconClose: iconClose,
66
+ iconError: iconError,
67
+ iconHide: iconHide,
68
+ iconInfo: iconInfo,
69
+ iconLLeft: iconLLeft,
70
+ iconLeft: iconLeft,
71
+ iconLock: iconLock,
72
+ iconMail: iconMail,
73
+ iconRRight: iconRRight,
74
+ iconRight: iconRight,
75
+ iconShow: iconShow,
76
+ iconSuccess: iconSuccess,
77
+ iconUpload: iconUpload,
78
+ iconWarning: iconWarning
79
+ });
80
+
81
+ /** ALERT */
82
+ const Alert = (props, children) => {
83
+ const { type = "info", soft = true, ...rest } = props;
84
+
85
+ const icons = {
86
+ info: iconInfo,
87
+ success: iconSuccess,
88
+ warning: iconWarning,
89
+ error: iconError,
90
+ };
91
+
92
+ const typeClass = () => {
93
+ const t = val(type);
94
+ const map = {
95
+ info: "alert-info",
96
+ success: "alert-success",
97
+ warning: "alert-warning",
98
+ error: "alert-error",
99
+ };
100
+ return map[t] || t;
101
+ };
102
+
103
+ const content = children || props.message;
104
+
105
+ return $html(
106
+ "div",
107
+ {
108
+ ...rest,
109
+ role: "alert",
110
+ class: () => `alert ${typeClass()} ${val(soft) ? "alert-soft" : ""} ${props.class || ""}`,
111
+ },
112
+ [
113
+ $html("img", {
114
+ src: icons[val(type)] || icons.info,
115
+ class: "w-4 h-4 object-contain",
116
+ alt: val(type),
117
+ }),
118
+ $html("div", { class: "flex-1" }, [
119
+ $html("span", {}, [typeof content === "function" ? content() : content])
120
+ ]),
121
+ props.actions ? $html("div", { class: "flex-none" }, [
122
+ typeof props.actions === "function" ? props.actions() : props.actions
123
+ ]) : null,
124
+ ],
125
+ );
126
+ };
127
+
128
+ var AlertModule = /*#__PURE__*/Object.freeze({
129
+ __proto__: null,
130
+ Alert: Alert
131
+ });
132
+
133
+ const i18n = {
134
+ es: {
135
+ close: "Cerrar",
136
+ confirm: "Confirmar",
137
+ cancel: "Cancelar",
138
+ search: "Buscar...",
139
+ loading: "Cargando...",
140
+ nodata: "Sin datos"
141
+ },
142
+ en: {
143
+ close: "Close",
144
+ confirm: "Confirm",
145
+ cancel: "Cancel",
146
+ search: "Search...",
147
+ loading: "Loading...",
148
+ nodata: "No data"
149
+ }
150
+ };
151
+
152
+ const currentLocale = $("es");
153
+
154
+ const tt = t => () => i18n[currentLocale()][t] || t;
155
+
156
+ /** INPUT */
157
+ const Input = (props) => {
158
+ const { label, tip, value, error, isSearch, icon, type = "text", ...rest } = props;
159
+ const isPassword = type === "password";
160
+ const visible = $(false);
161
+
162
+ const iconsByType = {
163
+ text: iconAbc,
164
+ password: iconLock,
165
+ date: iconCalendar,
166
+ number: icon123,
167
+ email: iconMail,
168
+ };
169
+
170
+ const inputEl = $html("input", {
171
+ ...rest,
172
+ type: () => (isPassword ? (visible() ? "text" : "password") : type),
173
+ placeholder: props.placeholder || label || (isSearch ? tt("search")() : " "),
174
+ class: joinClass("grow order-2 focus:outline-none", props.class),
175
+ value: value,
176
+ oninput: (e) => props.oninput?.(e),
177
+ disabled: () => val(props.disabled),
178
+ });
179
+
180
+ const leftIcon = icon ? icon : iconsByType[type] ? $html("img", { src: iconsByType[type], class: "opacity-50", alt: type }) : null;
181
+
182
+ return $html(
183
+ "label",
184
+ {
185
+ class: () => joinClass("input input-bordered floating-label flex items-center gap-2 w-full relative", val(error) ? "input-error" : ""),
186
+ },
187
+ [
188
+ leftIcon ? $html("div", { class: "order-1 shrink-0" }, leftIcon) : null,
189
+ label ? $html("span", { class: "text-base-content/60 order-0" }, label) : null,
190
+ inputEl,
191
+ isPassword
192
+ ? $html(
193
+ "button",
194
+ {
195
+ type: "button",
196
+ class: "order-3 btn btn-ghost btn-xs btn-circle opacity-50 hover:opacity-100",
197
+ onclick: (e) => {
198
+ e.preventDefault();
199
+ visible(!visible());
200
+ },
201
+ },
202
+ () =>
203
+ $html("img", {
204
+ class: "w-5 h-5",
205
+ src: visible() ? iconShow : iconHide,
206
+ }),
207
+ )
208
+ : null,
209
+ tip
210
+ ? $html(
211
+ "div",
212
+ { class: "tooltip tooltip-left order-4", "data-tip": tip },
213
+ $html("span", { class: "badge badge-ghost badge-xs cursor-help" }, "?"),
214
+ )
215
+ : null,
216
+ () => (val(error) ? $html("span", { class: "text-error text-[10px] absolute -bottom-5 left-2" }, val(error)) : null),
217
+ ],
218
+ );
219
+ };
220
+
221
+ var InputModule = /*#__PURE__*/Object.freeze({
222
+ __proto__: null,
223
+ Input: Input
224
+ });
225
+
226
+ /** AUTOCOMPLETE */
227
+ const Autocomplete = (props) => {
228
+ const { options = [], value, onSelect, label, placeholder, ...rest } = props;
229
+
230
+ const query = $(val(value) || "");
231
+ const isOpen = $(false);
232
+ const cursor = $(-1);
233
+
234
+ const list = $(() => {
235
+ const q = query().toLowerCase();
236
+ const data = val(options) || [];
237
+ return q
238
+ ? data.filter((o) => (typeof o === "string" ? o : o.label).toLowerCase().includes(q))
239
+ : data;
240
+ });
241
+
242
+ const pick = (opt) => {
243
+ const valStr = typeof opt === "string" ? opt : opt.value;
244
+ const labelStr = typeof opt === "string" ? opt : opt.label;
245
+
246
+ query(labelStr);
247
+ if (typeof value === "function") value(valStr);
248
+ onSelect?.(opt);
249
+
250
+ isOpen(false);
251
+ cursor(-1);
252
+ };
253
+
254
+ const nav = (e) => {
255
+ const items = list();
256
+ if (e.key === "ArrowDown") {
257
+ e.preventDefault();
258
+ isOpen(true);
259
+ cursor(Math.min(cursor() + 1, items.length - 1));
260
+ } else if (e.key === "ArrowUp") {
261
+ e.preventDefault();
262
+ cursor(Math.max(cursor() - 1, 0));
263
+ } else if (e.key === "Enter" && cursor() >= 0) {
264
+ e.preventDefault();
265
+ pick(items[cursor()]);
266
+ } else if (e.key === "Escape") {
267
+ isOpen(false);
268
+ }
269
+ };
270
+
271
+ return $html("div", { class: "relative w-full" }, [
272
+ Input({
273
+ label,
274
+ placeholder: placeholder || tt("search")(),
275
+ value: query,
276
+ onfocus: () => isOpen(true),
277
+ onblur: () => setTimeout(() => isOpen(false), 150),
278
+ onkeydown: nav,
279
+ oninput: (e) => {
280
+ const v = e.target.value;
281
+ query(v);
282
+ if (typeof value === "function") value(v);
283
+ isOpen(true);
284
+ cursor(-1);
285
+ },
286
+ ...rest,
287
+ }),
288
+ $html(
289
+ "ul",
290
+ {
291
+ class: "absolute left-0 w-full menu bg-base-100 rounded-box mt-1 p-2 shadow-xl max-h-60 overflow-y-auto border border-base-300 z-50",
292
+ style: () => (isOpen() && list().length ? "display:block" : "display:none"),
293
+ },
294
+ [
295
+ $for(
296
+ list,
297
+ (opt, i) =>
298
+ $html("li", {}, [
299
+ $html(
300
+ "a",
301
+ {
302
+ class: () => `block w-full ${cursor() === i ? "active bg-primary text-primary-content" : ""}`,
303
+ onclick: () => pick(opt),
304
+ onmouseenter: () => cursor(i),
305
+ },
306
+ typeof opt === "string" ? opt : opt.label,
307
+ ),
308
+ ]),
309
+ (opt, i) => (typeof opt === "string" ? opt : opt.value) + i,
310
+ ),
311
+ () => (list().length ? null : $html("li", { class: "p-2 text-center opacity-50" }, "No results")),
312
+ ],
313
+ ),
314
+ ]);
315
+ };
316
+
317
+ var AutocompleteModule = /*#__PURE__*/Object.freeze({
318
+ __proto__: null,
319
+ Autocomplete: Autocomplete
320
+ });
321
+
322
+ /** BADGE */
323
+ const Badge = (props, children) =>
324
+ $html("span", { ...props, class: joinClass("badge", props.class) }, children);
325
+
326
+ var BadgeModule = /*#__PURE__*/Object.freeze({
327
+ __proto__: null,
328
+ Badge: Badge
329
+ });
330
+
331
+ /** BUTTON */
332
+ const Button = (props, children) => {
333
+ const { badge, badgeClass, tooltip, icon, loading, ...rest } = props;
334
+
335
+ const btn = $html(
336
+ "button",
337
+ {
338
+ ...rest,
339
+ // Usamos props.class directamente
340
+ class: joinClass("btn", props.class),
341
+ disabled: () => val(loading) || val(props.disabled),
342
+ },
343
+ [
344
+ () => (val(loading) ? $html("span", { class: "loading loading-spinner" }) : null),
345
+ icon ? $html("span", { class: "mr-1" }, icon) : null,
346
+ children,
347
+ ]
348
+ );
349
+
350
+ let out = btn;
351
+
352
+ if (badge) {
353
+ out = $html("div", { class: "indicator" }, [
354
+ $html(
355
+ "span",
356
+ { class: joinClass("indicator-item badge", badgeClass || "badge-secondary") },
357
+ badge
358
+ ),
359
+ out,
360
+ ]);
361
+ }
362
+
363
+ return tooltip
364
+ ? $html("div", { class: "tooltip", "data-tip": tooltip }, out)
365
+ : out;
366
+ };
367
+
368
+ var ButtonModule = /*#__PURE__*/Object.freeze({
369
+ __proto__: null,
370
+ Button: Button
371
+ });
372
+
373
+ /** CHECKBOX */
374
+ const Checkbox = (props) => {
375
+ const { value, tooltip, toggle, label, ...rest } = props;
376
+
377
+ const checkEl = $html("input", {
378
+ ...rest,
379
+ type: "checkbox",
380
+ class: () => (val(toggle) ? "toggle" : "checkbox"),
381
+ checked: value
382
+ });
383
+
384
+ const layout = $html("label", { class: "label cursor-pointer justify-start gap-3" }, [
385
+ checkEl,
386
+ label ? $html("span", { class: "label-text" }, label) : null,
387
+ ]);
388
+
389
+ return tooltip ? $html("div", { class: "tooltip", "data-tip": tooltip }, layout) : layout;
390
+ };
391
+
392
+ var CheckboxModule = /*#__PURE__*/Object.freeze({
393
+ __proto__: null,
394
+ Checkbox: Checkbox
395
+ });
396
+
397
+ /** COLORPICKER */
398
+ const Colorpicker = (props) => {
399
+ const { value, label, ...rest } = props;
400
+ const isOpen = $(false);
401
+
402
+ const palette = [
403
+ ...["#000", "#1A1A1A", "#333", "#4D4D4D", "#666", "#808080", "#B3B3B3", "#FFF"],
404
+ ...["#450a0a", "#7f1d1d", "#991b1b", "#b91c1c", "#dc2626", "#ef4444", "#f87171", "#fca5a5"],
405
+ ...["#431407", "#7c2d12", "#9a3412", "#c2410c", "#ea580c", "#f97316", "#fb923c", "#ffedd5"],
406
+ ...["#713f12", "#a16207", "#ca8a04", "#eab308", "#facc15", "#fde047", "#fef08a", "#fff9c4"],
407
+ ...["#064e3b", "#065f46", "#059669", "#10b981", "#34d399", "#4ade80", "#84cc16", "#d9f99d"],
408
+ ...["#082f49", "#075985", "#0284c7", "#0ea5e9", "#38bdf8", "#7dd3fc", "#22d3ee", "#cffafe"],
409
+ ...["#1e1b4b", "#312e81", "#4338ca", "#4f46e5", "#6366f1", "#818cf8", "#a5b4fc", "#e0e7ff"],
410
+ ...["#2e1065", "#4c1d95", "#6d28d9", "#7c3aed", "#8b5cf6", "#a855f7", "#d946ef", "#fae8ff"],
411
+ ];
412
+
413
+ const getColor = () => val(value) || "#000000";
414
+
415
+ return $html("div", { class: "relative w-fit" }, [
416
+ $html(
417
+ "button",
418
+ {
419
+ type: "button",
420
+ class: "btn px-3 bg-base-100 border-base-300 hover:border-primary/50 flex items-center gap-2 shadow-sm font-normal normal-case",
421
+ onclick: (e) => {
422
+ e.stopPropagation();
423
+ isOpen(!isOpen());
424
+ },
425
+ ...rest,
426
+ },
427
+ [
428
+ $html("div", {
429
+ class: "size-5 rounded-sm shadow-inner border border-black/10 shrink-0",
430
+ style: () => `background-color: ${getColor()}`,
431
+ }),
432
+ label ? $html("span", { class: "opacity-80" }, label) : null,
433
+ ],
434
+ ),
435
+
436
+ $if(isOpen, () =>
437
+ $html(
438
+ "div",
439
+ {
440
+ class: "absolute left-0 mt-2 p-3 bg-base-100 border border-base-300 shadow-2xl rounded-box z-[110] w-64 select-none",
441
+ onclick: (e) => e.stopPropagation(),
442
+ },
443
+ [
444
+ $html(
445
+ "div",
446
+ { class: "grid grid-cols-8 gap-1" },
447
+ palette.map((c) =>
448
+ $html("button", {
449
+ type: "button",
450
+ style: `background-color: ${c}`,
451
+ class: () => {
452
+ const active = getColor().toLowerCase() === c.toLowerCase();
453
+ return `size-6 rounded-sm cursor-pointer transition-all hover:scale-125 hover:z-10 active:scale-95 outline-none border border-black/5
454
+ ${active ? "ring-2 ring-offset-1 ring-primary z-10 scale-110" : ""}`;
455
+ },
456
+ onclick: () => {
457
+ if (typeof value === "function") value(c);
458
+ isOpen(false);
459
+ },
460
+ }),
461
+ ),
462
+ ),
463
+ ],
464
+ ),
465
+ ),
466
+
467
+ $if(isOpen, () =>
468
+ $html("div", {
469
+ class: "fixed inset-0 z-[100]",
470
+ onclick: () => isOpen(false),
471
+ }),
472
+ ),
473
+ ]);
474
+ };
475
+
476
+ var ColorpickerModule = /*#__PURE__*/Object.freeze({
477
+ __proto__: null,
478
+ Colorpicker: Colorpicker
479
+ });
480
+
481
+ /** DATEPICKER */
482
+ const Datepicker = (props) => {
483
+ const { value, range, label, placeholder, hour = false, ...rest } = props;
484
+
485
+ const isOpen = $(false);
486
+ const internalDate = $(new Date());
487
+ const hoverDate = $(null);
488
+ const startHour = $(0);
489
+ const endHour = $(0);
490
+ const isRangeMode = () => val(range) === true;
491
+
492
+ const now = new Date();
493
+ const todayStr = `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, "0")}-${String(now.getDate()).padStart(2, "0")}`;
494
+
495
+ const formatDate = (d) => {
496
+ const year = d.getFullYear();
497
+ const month = String(d.getMonth() + 1).padStart(2, "0");
498
+ const day = String(d.getDate()).padStart(2, "0");
499
+ return `${year}-${month}-${day}`;
500
+ };
501
+
502
+ const selectDate = (date) => {
503
+ const dateStr = formatDate(date);
504
+ const current = val(value);
505
+
506
+ if (isRangeMode()) {
507
+ if (!current?.start || (current.start && current.end)) {
508
+ if (typeof value === "function") {
509
+ value({
510
+ start: dateStr,
511
+ end: null,
512
+ ...(hour && { startHour: startHour() }),
513
+ });
514
+ }
515
+ } else {
516
+ const start = current.start;
517
+ if (typeof value === "function") {
518
+ const newValue = dateStr < start ? { start: dateStr, end: start } : { start, end: dateStr };
519
+ if (hour) {
520
+ newValue.startHour = current.startHour || startHour();
521
+ newValue.endHour = current.endHour || endHour();
522
+ }
523
+ value(newValue);
524
+ }
525
+ isOpen(false);
526
+ }
527
+ } else {
528
+ if (typeof value === "function") {
529
+ value(hour ? `${dateStr}T${String(startHour()).padStart(2, "0")}:00:00` : dateStr);
530
+ }
531
+ isOpen(false);
532
+ }
533
+ };
534
+
535
+ const displayValue = $(() => {
536
+ const v = val(value);
537
+ if (!v) return "";
538
+ if (typeof v === "string") {
539
+ if (hour && v.includes("T")) return v.replace("T", " ");
540
+ return v;
541
+ }
542
+ if (v.start && v.end) {
543
+ const startStr = hour && v.startHour ? `${v.start} ${String(v.startHour).padStart(2, "0")}:00` : v.start;
544
+ const endStr = hour && v.endHour ? `${v.end} ${String(v.endHour).padStart(2, "0")}:00` : v.end;
545
+ return `${startStr} - ${endStr}`;
546
+ }
547
+ if (v.start) {
548
+ const startStr = hour && v.startHour ? `${v.start} ${String(v.startHour).padStart(2, "0")}:00` : v.start;
549
+ return `${startStr}...`;
550
+ }
551
+ return "";
552
+ });
553
+
554
+ const move = (m) => {
555
+ const d = internalDate();
556
+ internalDate(new Date(d.getFullYear(), d.getMonth() + m, 1));
557
+ };
558
+
559
+ const moveYear = (y) => {
560
+ const d = internalDate();
561
+ internalDate(new Date(d.getFullYear() + y, d.getMonth(), 1));
562
+ };
563
+
564
+ const HourSlider = ({ value: hVal, onChange }) => {
565
+ return $html("div", { class: "flex-1" }, [
566
+ $html("div", { class: "flex gap-2 items-center" }, [
567
+ $html("input", {
568
+ type: "range",
569
+ min: 0,
570
+ max: 23,
571
+ value: hVal,
572
+ class: "range range-xs flex-1",
573
+ oninput: (e) => {
574
+ const newHour = parseInt(e.target.value);
575
+ onChange(newHour);
576
+ },
577
+ }),
578
+ $html("span", { class: "text-sm font-mono min-w-[48px] text-center" },
579
+ () => String(val(hVal)).padStart(2, "0") + ":00"
580
+ ),
581
+ ]),
582
+ ]);
583
+ };
584
+
585
+ return $html("div", { class: "relative w-full" }, [
586
+ Input({
587
+ label,
588
+ placeholder: placeholder || (isRangeMode() ? "Seleccionar rango..." : "Seleccionar fecha..."),
589
+ value: displayValue,
590
+ readonly: true,
591
+ icon: $html("img", { src: iconCalendar, class: "opacity-40" }),
592
+ onclick: (e) => {
593
+ e.stopPropagation();
594
+ isOpen(!isOpen());
595
+ },
596
+ ...rest,
597
+ }),
598
+
599
+ $if(isOpen, () =>
600
+ $html(
601
+ "div",
602
+ {
603
+ class: "absolute left-0 mt-2 p-4 bg-base-100 border border-base-300 shadow-2xl rounded-box z-[100] w-80 select-none",
604
+ onclick: (e) => e.stopPropagation(),
605
+ },
606
+ [
607
+ $html("div", { class: "flex justify-between items-center mb-4 gap-1" }, [
608
+ $html("div", { class: "flex gap-0.5" }, [
609
+ $html("button", { type: "button", class: "btn btn-ghost btn-xs px-1", onclick: () => moveYear(-1) },
610
+ $html("img", { src: iconLLeft, class: "opacity-40" })
611
+ ),
612
+ $html("button", { type: "button", class: "btn btn-ghost btn-xs px-1", onclick: () => move(-1) },
613
+ $html("img", { src: iconLeft, class: "opacity-40" })
614
+ ),
615
+ ]),
616
+ $html("span", { class: "font-bold uppercase flex-1 text-center" }, [
617
+ () => internalDate().toLocaleString("es-ES", { month: "short", year: "numeric" }),
618
+ ]),
619
+ $html("div", { class: "flex gap-0.5" }, [
620
+ $html("button", { type: "button", class: "btn btn-ghost btn-xs px-1", onclick: () => move(1) },
621
+ $html("img", { src: iconRight, class: "opacity-40" })
622
+ ),
623
+ $html("button", { type: "button", class: "btn btn-ghost btn-xs px-1", onclick: () => moveYear(1) },
624
+ $html("img", { src: iconRRight, class: "opacity-40" })
625
+ ),
626
+ ]),
627
+ ]),
628
+
629
+ $html("div", { class: "grid grid-cols-7 gap-1", onmouseleave: () => hoverDate(null) }, [
630
+ ...["L", "M", "X", "J", "V", "S", "D"].map((d) => $html("div", { class: "text-[10px] opacity-40 font-bold text-center" }, d)),
631
+ () => {
632
+ const d = internalDate();
633
+ const year = d.getFullYear();
634
+ const month = d.getMonth();
635
+ const firstDay = new Date(year, month, 1).getDay();
636
+ const offset = firstDay === 0 ? 6 : firstDay - 1;
637
+ const daysInMonth = new Date(year, month + 1, 0).getDate();
638
+
639
+ const nodes = [];
640
+ for (let i = 0; i < offset; i++) nodes.push($html("div"));
641
+
642
+ for (let i = 1; i <= daysInMonth; i++) {
643
+ const date = new Date(year, month, i);
644
+ const dStr = formatDate(date);
645
+
646
+ nodes.push(
647
+ $html(
648
+ "button",
649
+ {
650
+ type: "button",
651
+ class: () => {
652
+ const v = val(value);
653
+ const h = hoverDate();
654
+ const isStart = typeof v === "string" ? v.split("T")[0] === dStr : v?.start === dStr;
655
+ const isEnd = v?.end === dStr;
656
+ let inRange = false;
657
+
658
+ if (isRangeMode() && v?.start) {
659
+ const start = v.start;
660
+ if (!v.end && h) {
661
+ inRange = (dStr > start && dStr <= h) || (dStr < start && dStr >= h);
662
+ } else if (v.end) {
663
+ inRange = dStr > start && dStr < v.end;
664
+ }
665
+ }
666
+
667
+ const base = "btn btn-xs p-0 aspect-square min-h-0 h-auto font-normal relative";
668
+ const state = isStart || isEnd ? "btn-primary z-10" : inRange ? "bg-primary/20 border-none rounded-none" : "btn-ghost";
669
+ const today = dStr === todayStr ? "ring-1 ring-primary ring-inset font-black text-primary" : "";
670
+
671
+ return `${base} ${state} ${today}`;
672
+ },
673
+ onmouseenter: () => { if (isRangeMode()) hoverDate(dStr); },
674
+ onclick: () => selectDate(date),
675
+ },
676
+ [i.toString()],
677
+ ),
678
+ );
679
+ }
680
+ return nodes;
681
+ },
682
+ ]),
683
+
684
+ hour ? $html("div", { class: "mt-3 pt-2 border-t border-base-300" }, [
685
+ isRangeMode()
686
+ ? $html("div", { class: "flex gap-4" }, [
687
+ HourSlider({
688
+ value: startHour,
689
+ onChange: (newHour) => {
690
+ startHour(newHour);
691
+ const currentVal = val(value);
692
+ if (currentVal?.start) value({ ...currentVal, startHour: newHour });
693
+ },
694
+ }),
695
+ HourSlider({
696
+ value: endHour,
697
+ onChange: (newHour) => {
698
+ endHour(newHour);
699
+ const currentVal = val(value);
700
+ if (currentVal?.end) value({ ...currentVal, endHour: newHour });
701
+ },
702
+ }),
703
+ ])
704
+ : HourSlider({
705
+ value: startHour,
706
+ onChange: (newHour) => {
707
+ startHour(newHour);
708
+ const currentVal = val(value);
709
+ if (currentVal && typeof currentVal === "string" && currentVal.includes("-")) {
710
+ value(currentVal.split("T")[0] + "T" + String(newHour).padStart(2, "0") + ":00:00");
711
+ }
712
+ },
713
+ }),
714
+ ]) : null,
715
+ ],
716
+ ),
717
+ ),
718
+
719
+ $if(isOpen, () => $html("div", { class: "fixed inset-0 z-[90]", onclick: () => isOpen(false) })),
720
+ ]);
721
+ };
722
+
723
+ var DatepickerModule = /*#__PURE__*/Object.freeze({
724
+ __proto__: null,
725
+ Datepicker: Datepicker
726
+ });
727
+
728
+ /** DRAWER */
729
+ const Drawer = (props) =>
730
+ $html("div", { class: joinClass("drawer", props.class) }, [
731
+ $html("input", {
732
+ id: props.id,
733
+ type: "checkbox",
734
+ class: "drawer-toggle",
735
+ checked: props.open,
736
+ }),
737
+ $html("div", { class: "drawer-content" }, props.content),
738
+ $html("div", { class: "drawer-side" }, [
739
+ $html("label", { for: props.id, class: "drawer-overlay", onclick: () => props.open?.(false) }),
740
+ $html("div", { class: "min-h-full bg-base-200 w-80" }, props.side),
741
+ ]),
742
+ ]);
743
+
744
+ var DrawerModule = /*#__PURE__*/Object.freeze({
745
+ __proto__: null,
746
+ Drawer: Drawer
747
+ });
748
+
749
+ /** DROPDOWN */
750
+ const Dropdown = (props, children) => {
751
+ const { label, icon, ...rest } = props;
752
+
753
+ return $html(
754
+ "div",
755
+ {
756
+ ...rest,
757
+ class: () => `dropdown ${val(props.class) || props.class || ""}`,
758
+ },
759
+ [
760
+ $html(
761
+ "div",
762
+ {
763
+ tabindex: 0,
764
+ role: "button",
765
+ class: "btn m-1 flex items-center gap-2",
766
+ },
767
+ [
768
+ icon ? (typeof icon === "function" ? icon() : icon) : null,
769
+ label ? (typeof label === "function" ? label() : label) : null
770
+ ],
771
+ ),
772
+ $html(
773
+ "ul",
774
+ {
775
+ tabindex: 0,
776
+ class: "dropdown-content z-[50] menu p-2 shadow bg-base-100 rounded-box min-w-max border border-base-300",
777
+ },
778
+ [typeof children === "function" ? children() : children],
779
+ ),
780
+ ],
781
+ );
782
+ };
783
+
784
+ var DropdownModule = /*#__PURE__*/Object.freeze({
785
+ __proto__: null,
786
+ Dropdown: Dropdown
787
+ });
788
+
789
+ /** FAB (Floating Action Button) */
790
+ const Fab = (props) => {
791
+ const { icon, label, actions = [], position = "bottom-6 right-6", ...rest } = props;
792
+
793
+ return $html(
794
+ "div",
795
+ {
796
+ ...rest,
797
+ class: () => `fab fixed ${val(position)} flex flex-col-reverse items-end gap-3 z-[100] ${
798
+ props.class || ""
799
+ }`,
800
+ },
801
+ [
802
+ // Botón principal
803
+ $html(
804
+ "div",
805
+ {
806
+ tabindex: 0,
807
+ role: "button",
808
+ class: "btn btn-lg btn-circle btn-primary shadow-2xl",
809
+ },
810
+ [
811
+ icon ? (typeof icon === "function" ? icon() : icon) : null,
812
+ !icon && label ? label : null
813
+ ],
814
+ ),
815
+
816
+ // Acciones secundarias (se despliegan hacia arriba)
817
+ ...val(actions).map((act) =>
818
+ $html("div", { class: "flex items-center gap-3 transition-all duration-300" }, [
819
+ act.label ? $html("span", { class: "badge badge-ghost shadow-sm whitespace-nowrap" }, act.label) : null,
820
+ $html(
821
+ "button",
822
+ {
823
+ type: "button",
824
+ class: `btn btn-circle shadow-lg ${act.class || ""}`,
825
+ onclick: (e) => {
826
+ e.stopPropagation();
827
+ act.onclick?.(e);
828
+ },
829
+ },
830
+ [act.icon ? (typeof act.icon === "function" ? act.icon() : act.icon) : act.text || ""],
831
+ ),
832
+ ]),
833
+ ),
834
+ ],
835
+ );
836
+ };
837
+
838
+ var FabModule = /*#__PURE__*/Object.freeze({
839
+ __proto__: null,
840
+ Fab: Fab
841
+ });
842
+
843
+ /** FIELDSET */
844
+ const Fieldset = (props, children) =>
845
+ $html(
846
+ "fieldset",
847
+ {
848
+ ...props,
849
+ class: joinClass("fieldset bg-base-200 border border-base-300 p-4 rounded-lg", props.class),
850
+ },
851
+ [
852
+ () => {
853
+ const legendText = val(props.legend);
854
+ return legendText ? $html("legend", { class: "fieldset-legend font-bold" }, [legendText]) : null;
855
+ },
856
+ children,
857
+ ],
858
+ );
859
+
860
+ var FieldsetModule = /*#__PURE__*/Object.freeze({
861
+ __proto__: null,
862
+ Fieldset: Fieldset
863
+ });
864
+
865
+ /** FILEINPUT */
866
+ const Fileinput = (props) => {
867
+ const { tooltip, max = 2, accept = "*", onSelect } = props;
868
+
869
+ const selectedFiles = $([]);
870
+ const isDragging = $(false);
871
+ const error = $(null);
872
+ const MAX_BYTES = max * 1024 * 1024;
873
+
874
+ const handleFiles = (files) => {
875
+ const fileList = Array.from(files);
876
+ error(null);
877
+ const oversized = fileList.find((f) => f.size > MAX_BYTES);
878
+
879
+ if (oversized) {
880
+ error(`Máx ${max}MB`);
881
+ return;
882
+ }
883
+
884
+ selectedFiles([...selectedFiles(), ...fileList]);
885
+ onSelect?.(selectedFiles());
886
+ };
887
+
888
+ const removeFile = (index) => {
889
+ const updated = selectedFiles().filter((_, i) => i !== index);
890
+ selectedFiles(updated);
891
+ onSelect?.(updated);
892
+ };
893
+
894
+ return $html("fieldset", { class: "fieldset w-full p-0" }, [
895
+ $html(
896
+ "div",
897
+ {
898
+ class: () => `w-full ${tooltip ? "tooltip tooltip-top before:z-50 after:z-50" : ""}`,
899
+ "data-tip": tooltip,
900
+ },
901
+ [
902
+ $html(
903
+ "label",
904
+ {
905
+ class: () => `
906
+ relative flex items-center justify-between w-full h-12 px-4
907
+ border-2 border-dashed rounded-lg cursor-pointer
908
+ transition-all duration-200
909
+ ${isDragging() ? "border-primary bg-primary/10" : "border-base-content/20 bg-base-100 hover:bg-base-200"}
910
+ `,
911
+ ondragover: (e) => {
912
+ e.preventDefault();
913
+ isDragging(true);
914
+ },
915
+ ondragleave: () => isDragging(false),
916
+ ondrop: (e) => {
917
+ e.preventDefault();
918
+ isDragging(false);
919
+ handleFiles(e.dataTransfer.files);
920
+ },
921
+ },
922
+ [
923
+ $html("div", { class: "flex items-center gap-3 w-full" }, [
924
+ $html("img", { src: iconUpload, class: "w-5 h-5 opacity-50 shrink-0" }),
925
+ $html("span", { class: "text-sm opacity-70 truncate grow text-left" }, "Arrastra o selecciona archivos..."),
926
+ $html("span", { class: "text-[10px] opacity-40 shrink-0" }, `Máx ${max}MB`),
927
+ ]),
928
+ $html("input", {
929
+ type: "file",
930
+ multiple: true,
931
+ accept: accept,
932
+ class: "hidden",
933
+ onchange: (e) => handleFiles(e.target.files),
934
+ }),
935
+ ],
936
+ ),
937
+ ],
938
+ ),
939
+
940
+ () => (error() ? $html("span", { class: "text-[10px] text-error mt-1 px-1 font-medium" }, error()) : null),
941
+
942
+ $if(
943
+ () => selectedFiles().length > 0,
944
+ () =>
945
+ $html("ul", { class: "mt-2 space-y-1" }, [
946
+ $for(
947
+ selectedFiles,
948
+ (file, index) =>
949
+ $html("li", { class: "flex items-center justify-between p-1.5 pl-3 text-xs bg-base-200/50 rounded-md border border-base-300" }, [
950
+ $html("div", { class: "flex items-center gap-2 truncate" }, [
951
+ $html("span", { class: "opacity-50" }, "📄"),
952
+ $html("span", { class: "truncate font-medium max-w-[200px]" }, file.name),
953
+ $html("span", { class: "text-[9px] opacity-40" }, `(${(file.size / 1024).toFixed(0)} KB)`),
954
+ ]),
955
+ $html(
956
+ "button",
957
+ {
958
+ type: "button",
959
+ class: "btn btn-ghost btn-xs btn-circle",
960
+ onclick: (e) => {
961
+ e.preventDefault();
962
+ e.stopPropagation();
963
+ removeFile(index);
964
+ },
965
+ },
966
+ [$html("img", { src: iconClose, class: "w-3 h-3 opacity-70" })],
967
+ ),
968
+ ]),
969
+ (file) => file.name + file.lastModified,
970
+ ),
971
+ ]),
972
+ ),
973
+ ]);
974
+ };
975
+
976
+ var FileinputModule = /*#__PURE__*/Object.freeze({
977
+ __proto__: null,
978
+ Fileinput: Fileinput
979
+ });
980
+
981
+ /** INDICATOR */
982
+ const Indicator = (props, children) =>
983
+ $html("div", { class: joinClass("indicator", props.class) }, [
984
+ children,
985
+ $html("span", { class: joinClass("indicator-item badge", props.badgeClass) }, props.badge),
986
+ ]);
987
+
988
+ var IndicatorModule = /*#__PURE__*/Object.freeze({
989
+ __proto__: null,
990
+ Indicator: Indicator
991
+ });
992
+
993
+ /** LIST */
994
+ const List = (props) => {
995
+ const { items, header, render, keyFn, class: className } = props;
996
+
997
+ return $html(
998
+ "ul",
999
+ {
1000
+ class: joinClass("list bg-base-100 rounded-box shadow-md", className),
1001
+ },
1002
+ [
1003
+ $if(header, () => $html("li", { class: "p-4 pb-2 text-xs opacity-60 tracking-wide" }, [val(header)])),
1004
+ $for(items, (item, index) => $html("li", { class: "list-row" }, [render(item, index)]), keyFn),
1005
+ ],
1006
+ );
1007
+ };
1008
+
1009
+ var ListModule = /*#__PURE__*/Object.freeze({
1010
+ __proto__: null,
1011
+ List: List
1012
+ });
1013
+
1014
+ /** LOADING (Overlay Component) */
1015
+ const Loading = (props) => {
1016
+ // Se espera un signal props.$show para controlar la visibilidad
1017
+ return $if(props.$show, () =>
1018
+ $html("div", {
1019
+ class: "fixed inset-0 z-[100] flex items-center justify-center backdrop-blur-sm bg-base-100/30"
1020
+ }, [
1021
+ $html("span", { class: "loading loading-spinner loading-lg text-primary" }),
1022
+ ]),
1023
+ );
1024
+ };
1025
+
1026
+ var LoadingModule = /*#__PURE__*/Object.freeze({
1027
+ __proto__: null,
1028
+ Loading: Loading
1029
+ });
1030
+
1031
+ /** MENU */
1032
+ const Menu = (props) => {
1033
+ const renderItems = (items) =>
1034
+ $for(
1035
+ () => items || [],
1036
+ (it) =>
1037
+ $html("li", {}, [
1038
+ it.children
1039
+ ? $html("details", { open: it.open }, [
1040
+ $html("summary", {}, [it.icon && $html("span", { class: "mr-2" }, it.icon), it.label]),
1041
+ $html("ul", {}, renderItems(it.children)),
1042
+ ])
1043
+ : $html("a", { class: () => (val(it.active) ? "active" : ""), onclick: it.onclick }, [
1044
+ it.icon && $html("span", { class: "mr-2" }, it.icon),
1045
+ it.label,
1046
+ ]),
1047
+ ]),
1048
+ (it, i) => it.label || i,
1049
+ );
1050
+
1051
+ return $html("ul", { ...props, class: joinClass("menu bg-base-200 rounded-box", props.class) }, renderItems(props.items));
1052
+ };
1053
+
1054
+ var MenuModule = /*#__PURE__*/Object.freeze({
1055
+ __proto__: null,
1056
+ Menu: Menu
1057
+ });
1058
+
1059
+ /** MODAL */
1060
+ const Modal = (props, children) => {
1061
+ const { title, buttons, open, ...rest } = props;
1062
+ const close = () => open(false);
1063
+
1064
+ return $if(open, () =>
1065
+ $html("dialog", { ...rest, class: "modal modal-open" }, [
1066
+ $html("div", { class: "modal-box" }, [
1067
+ title ? $html("h3", { class: "text-lg font-bold mb-4" }, title) : null,
1068
+ typeof children === "function" ? children() : children,
1069
+ $html("div", { class: "modal-action flex gap-2" }, [
1070
+ ...(Array.isArray(buttons) ? buttons : [buttons]).filter(Boolean),
1071
+ Button({ onclick: close }, tt("close")()),
1072
+ ]),
1073
+ ]),
1074
+ $html(
1075
+ "form",
1076
+ {
1077
+ method: "dialog",
1078
+ class: "modal-backdrop",
1079
+ onclick: (e) => (e.preventDefault(), close()),
1080
+ },
1081
+ [$html("button", {}, "close")],
1082
+ ),
1083
+ ]),
1084
+ );
1085
+ };
1086
+
1087
+ var ModalModule = /*#__PURE__*/Object.freeze({
1088
+ __proto__: null,
1089
+ Modal: Modal
1090
+ });
1091
+
1092
+ /** NAVBAR */
1093
+ const Navbar = (props, children) =>
1094
+ $html("div", { ...props, class: joinClass("navbar bg-base-100 shadow-sm px-4", props.class) }, children);
1095
+
1096
+ var NavbarModule = /*#__PURE__*/Object.freeze({
1097
+ __proto__: null,
1098
+ Navbar: Navbar
1099
+ });
1100
+
1101
+ /** RADIO */
1102
+ const Radio = (props) => {
1103
+ const { label, tooltip, value, ...rest } = props;
1104
+
1105
+ const radioEl = $html("input", {
1106
+ ...rest,
1107
+ type: "radio",
1108
+ class: joinClass("radio", props.class),
1109
+ checked: () => val(value) === props.value,
1110
+ disabled: () => val(props.disabled),
1111
+ onclick: () => typeof value === "function" && value(props.value),
1112
+ });
1113
+
1114
+ if (!label && !tooltip) return radioEl;
1115
+
1116
+ const layout = $html("label", { class: "label cursor-pointer justify-start gap-3" }, [
1117
+ radioEl,
1118
+ label ? $html("span", { class: "label-text" }, label) : null,
1119
+ ]);
1120
+
1121
+ return tooltip ? $html("div", { class: "tooltip", "data-tip": tooltip }, layout) : layout;
1122
+ };
1123
+
1124
+ var RadioModule = /*#__PURE__*/Object.freeze({
1125
+ __proto__: null,
1126
+ Radio: Radio
1127
+ });
1128
+
1129
+ /** RANGE */
1130
+ const Range = (props) => {
1131
+ const { label, tooltip, value, ...rest } = props;
1132
+
1133
+ const rangeEl = $html("input", {
1134
+ ...rest,
1135
+ type: "range",
1136
+ class: joinClass("range", props.class),
1137
+ value: value,
1138
+ disabled: () => val(props.disabled)
1139
+ });
1140
+
1141
+ if (!label && !tooltip) return rangeEl;
1142
+
1143
+ const layout = $html("div", { class: "flex flex-col gap-2" }, [
1144
+ label ? $html("span", { class: "label-text" }, label) : null,
1145
+ rangeEl
1146
+ ]);
1147
+
1148
+ return tooltip ? $html("div", { class: "tooltip", "data-tip": tooltip }, layout) : layout;
1149
+ };
1150
+
1151
+ var RangeModule = /*#__PURE__*/Object.freeze({
1152
+ __proto__: null,
1153
+ Range: Range
1154
+ });
1155
+
1156
+ /** RATING */
1157
+ const Rating = (props) => {
1158
+ const { value, count = 5, mask = "mask-star", readonly = false, ...rest } = props;
1159
+
1160
+ // Generamos un ID único para el grupo de radio buttons
1161
+ const ratingGroup = `rating-${Math.random().toString(36).slice(2, 7)}`;
1162
+
1163
+ return $html(
1164
+ "div",
1165
+ {
1166
+ ...rest,
1167
+ class: () => `rating ${val(readonly) ? "pointer-events-none" : ""} ${props.class || ""}`,
1168
+ },
1169
+ Array.from({ length: val(count) }, (_, i) => {
1170
+ const starValue = i + 1;
1171
+
1172
+ return $html("input", {
1173
+ type: "radio",
1174
+ name: ratingGroup,
1175
+ class: `mask ${mask}`,
1176
+ "aria-label": `${starValue} star`,
1177
+ checked: () => Math.round(val(value)) === starValue,
1178
+ onchange: () => {
1179
+ if (!val(readonly) && typeof value === "function") {
1180
+ value(starValue);
1181
+ }
1182
+ },
1183
+ });
1184
+ })
1185
+ );
1186
+ };
1187
+
1188
+ var RatingModule = /*#__PURE__*/Object.freeze({
1189
+ __proto__: null,
1190
+ Rating: Rating
1191
+ });
1192
+
1193
+ /** SELECT */
1194
+ const Select = (props) => {
1195
+ const { label, options, value, ...rest } = props;
1196
+
1197
+ const selectEl = $html(
1198
+ "select",
1199
+ {
1200
+ ...rest,
1201
+ class: joinClass("select select-bordered w-full", props.class),
1202
+ value: value
1203
+ },
1204
+ $for(
1205
+ () => val(options) || [],
1206
+ (opt) =>
1207
+ $html(
1208
+ "option",
1209
+ {
1210
+ value: opt.value,
1211
+ $selected: () => String(val(value)) === String(opt.value),
1212
+ },
1213
+ opt.label,
1214
+ ),
1215
+ (opt) => opt.value,
1216
+ ),
1217
+ );
1218
+
1219
+ if (!label) return selectEl;
1220
+
1221
+ return $html("label", { class: "fieldset-label flex flex-col gap-1" }, [
1222
+ $html("span", {}, label),
1223
+ selectEl
1224
+ ]);
1225
+ };
1226
+
1227
+ var SelectModule = /*#__PURE__*/Object.freeze({
1228
+ __proto__: null,
1229
+ Select: Select
1230
+ });
1231
+
1232
+ /** STACK */
1233
+ const Stack = (props, children) =>
1234
+ $html("div", { ...props, class: joinClass("stack", props.class) }, children);
1235
+
1236
+ var StackModule = /*#__PURE__*/Object.freeze({
1237
+ __proto__: null,
1238
+ Stack: Stack
1239
+ });
1240
+
1241
+ /** STAT */
1242
+ const Stat = (props) =>
1243
+ $html("div", { ...props, class: joinClass("stat", props.class) }, [
1244
+ props.icon && $html("div", { class: "stat-figure text-secondary" }, props.icon),
1245
+ props.label && $html("div", { class: "stat-title" }, props.label),
1246
+ $html("div", { class: "stat-value" }, () => val(props.value) ?? props.value),
1247
+ props.desc && $html("div", { class: "stat-desc" }, props.desc),
1248
+ ]);
1249
+
1250
+ var StatModule = /*#__PURE__*/Object.freeze({
1251
+ __proto__: null,
1252
+ Stat: Stat
1253
+ });
1254
+
1255
+ /** SWAP */
1256
+ const Swap = (props) =>
1257
+ $html("label", { class: joinClass("swap", props.class) }, [
1258
+ $html("input", {
1259
+ type: "checkbox",
1260
+ checked: props.value
1261
+ }),
1262
+ $html("div", { class: "swap-on" }, props.on),
1263
+ $html("div", { class: "swap-off" }, props.off),
1264
+ ]);
1265
+
1266
+ var SwapModule = /*#__PURE__*/Object.freeze({
1267
+ __proto__: null,
1268
+ Swap: Swap
1269
+ });
1270
+
1271
+ /** TABLE */
1272
+ const Table = (props) => {
1273
+ const {
1274
+ items = [],
1275
+ columns = [],
1276
+ keyFn,
1277
+ zebra = false,
1278
+ pinRows = false,
1279
+ empty = tt("nodata")(),
1280
+ ...rest
1281
+ } = props;
1282
+
1283
+ const tableClass = () => joinClass(
1284
+ "table",
1285
+ `${val(zebra) ? "table-zebra" : ""} ${val(pinRows) ? "table-pin-rows" : ""} ${props.class || ""}`
1286
+ );
1287
+
1288
+ return $html("div", { class: "overflow-x-auto w-full bg-base-100 rounded-box border border-base-300" }, [
1289
+ $html("table", { ...rest, class: tableClass }, [
1290
+ $html("thead", {}, [
1291
+ $html("tr", {},
1292
+ columns.map(col => $html("th", { class: col.class || "" }, col.label))
1293
+ )
1294
+ ]),
1295
+ $html("tbody", {}, [
1296
+ $for(items, (item, index) => {
1297
+ return $html("tr", { class: "hover" },
1298
+ columns.map(col => {
1299
+ const cellContent = () => {
1300
+ if (col.render) return col.render(item, index);
1301
+ const value = item[col.key];
1302
+ return val(value);
1303
+ };
1304
+ return $html("td", { class: col.class || "" }, [cellContent]);
1305
+ })
1306
+ );
1307
+ }, keyFn || ((item, idx) => item.id || idx)),
1308
+
1309
+ $if(() => val(items).length === 0, () =>
1310
+ $html("tr", {}, [
1311
+ $html("td", { colspan: columns.length, class: "text-center p-10 opacity-50" }, [
1312
+ val(empty)
1313
+ ])
1314
+ ])
1315
+ )
1316
+ ]),
1317
+ $if(() => columns.some(c => c.footer), () =>
1318
+ $html("tfoot", {}, [
1319
+ $html("tr", {},
1320
+ columns.map(col => $html("th", {}, col.footer || ""))
1321
+ )
1322
+ ])
1323
+ )
1324
+ ])
1325
+ ]);
1326
+ };
1327
+
1328
+ var TableModule = /*#__PURE__*/Object.freeze({
1329
+ __proto__: null,
1330
+ Table: Table
1331
+ });
1332
+
1333
+ /** TABS */
1334
+ const Tabs = (props) => {
1335
+ const { items, ...rest } = props;
1336
+ const itemsSignal = typeof items === "function" ? items : () => items || [];
1337
+
1338
+ return $html("div", { ...rest, class: "flex flex-col gap-4 w-full" }, [
1339
+ $html(
1340
+ "div",
1341
+ {
1342
+ role: "tablist",
1343
+ class: joinClass("tabs tabs-box", props.class),
1344
+ },
1345
+ $for(
1346
+ itemsSignal,
1347
+ (it) =>
1348
+ $html(
1349
+ "a",
1350
+ {
1351
+ role: "tab",
1352
+ class: () => joinClass(
1353
+ "tab",
1354
+ val(it.active) && "tab-active",
1355
+ val(it.disabled) && "tab-disabled",
1356
+ it.tip && "tooltip"
1357
+ ),
1358
+ "data-tip": it.tip,
1359
+ onclick: (e) => !val(it.disabled) && it.onclick?.(e),
1360
+ },
1361
+ it.label,
1362
+ ),
1363
+ (t) => t.label,
1364
+ ),
1365
+ ),
1366
+ () => {
1367
+ const active = itemsSignal().find((it) => val(it.active));
1368
+ if (!active) return null;
1369
+ const content = val(active.content);
1370
+ return $html("div", { class: "p-4" }, [
1371
+ typeof content === "function" ? content() : content
1372
+ ]);
1373
+ },
1374
+ ]);
1375
+ };
1376
+
1377
+ var TabsModule = /*#__PURE__*/Object.freeze({
1378
+ __proto__: null,
1379
+ Tabs: Tabs
1380
+ });
1381
+
1382
+ /** TIMELINE */
1383
+ const Timeline = (props) => {
1384
+ const { items = [], vertical = true, compact = false, ...rest } = props;
1385
+
1386
+ const icons = {
1387
+ info: iconInfo,
1388
+ success: iconSuccess,
1389
+ warning: iconWarning,
1390
+ error: iconError,
1391
+ };
1392
+
1393
+ return $html(
1394
+ "ul",
1395
+ {
1396
+ ...rest,
1397
+ class: () =>
1398
+ `timeline ${val(vertical) ? "timeline-vertical" : "timeline-horizontal"} ${
1399
+ val(compact) ? "timeline-compact" : ""
1400
+ } ${props.class || ""}`,
1401
+ },
1402
+ [
1403
+ $for(
1404
+ items,
1405
+ (item, i) => {
1406
+ const isFirst = i === 0;
1407
+ const isLast = i === val(items).length - 1;
1408
+ const itemType = item.type || "success";
1409
+ const renderSlot = (content) => (typeof content === "function" ? content() : content);
1410
+
1411
+ return $html("li", { class: "flex-1" }, [
1412
+ !isFirst ? $html("hr", { class: item.completed ? "bg-primary" : "" }) : null,
1413
+ $html("div", { class: "timeline-start" }, [renderSlot(item.title)]),
1414
+ $html("div", { class: "timeline-middle" }, [
1415
+ $html("img", {
1416
+ src: icons[itemType] || item.icon || icons.success,
1417
+ class: "w-4 h-4 object-contain mx-1",
1418
+ alt: itemType,
1419
+ }),
1420
+ ]),
1421
+ $html("div", { class: "timeline-end timeline-box shadow-sm" }, [renderSlot(item.detail)]),
1422
+ !isLast ? $html("hr", { class: item.completed ? "bg-primary" : "" }) : null,
1423
+ ]);
1424
+ },
1425
+ (item, i) => item.id || i,
1426
+ ),
1427
+ ],
1428
+ );
1429
+ };
1430
+
1431
+ var TimelineModule = /*#__PURE__*/Object.freeze({
1432
+ __proto__: null,
1433
+ Timeline: Timeline
1434
+ });
1435
+
1436
+ /** TOAST (Imperative Function) */
1437
+ const Toast = (message, type = "alert-success", duration = 3500) => {
1438
+ let container = document.getElementById("sigpro-toast-container");
1439
+
1440
+ // Crear el contenedor global si no existe
1441
+ if (!container) {
1442
+ container = $html("div", {
1443
+ id: "sigpro-toast-container",
1444
+ class: "fixed top-0 right-0 z-[9999] p-4 flex flex-col gap-2 pointer-events-none",
1445
+ });
1446
+ document.body.appendChild(container);
1447
+ }
1448
+
1449
+ const toastHost = $html("div", { style: "display: contents" });
1450
+ container.appendChild(toastHost);
1451
+
1452
+ let timeoutId;
1453
+
1454
+ const close = () => {
1455
+ clearTimeout(timeoutId);
1456
+ const el = toastHost.firstElementChild;
1457
+ if (el && !el.classList.contains("opacity-0")) {
1458
+ el.classList.add("translate-x-full", "opacity-0");
1459
+ setTimeout(() => {
1460
+ instance.destroy();
1461
+ toastHost.remove();
1462
+ // Limpiar el contenedor si ya no hay más toasts
1463
+ if (!container.hasChildNodes()) container.remove();
1464
+ }, 300);
1465
+ } else {
1466
+ instance.destroy();
1467
+ toastHost.remove();
1468
+ }
1469
+ };
1470
+
1471
+ const ToastComponent = () => {
1472
+ const el = $html(
1473
+ "div",
1474
+ {
1475
+ class: `alert alert-soft ${type} shadow-lg transition-all duration-300 translate-x-10 opacity-0 pointer-events-auto`,
1476
+ },
1477
+ [
1478
+ $html("span", {}, [typeof message === "function" ? message() : message]),
1479
+ Button({ class: "btn-xs btn-circle btn-ghost", onclick: close }, "✕")
1480
+ ],
1481
+ );
1482
+
1483
+ // Animación de entrada
1484
+ requestAnimationFrame(() => el.classList.remove("translate-x-10", "opacity-0"));
1485
+ return el;
1486
+ };
1487
+
1488
+ const instance = $mount(ToastComponent, toastHost);
1489
+
1490
+ if (duration > 0) {
1491
+ timeoutId = setTimeout(close, duration);
1492
+ }
1493
+
1494
+ return close;
1495
+ };
1496
+
1497
+ var ToastModule = /*#__PURE__*/Object.freeze({
1498
+ __proto__: null,
1499
+ Toast: Toast
1500
+ });
1501
+
1502
+ /** TOOLTIP */
1503
+ const Tooltip = (props, children) =>
1504
+ $html("div", { ...props, class: joinClass("tooltip", props.class), "data-tip": props.tip }, children);
1505
+
1506
+ var TooltipModule = /*#__PURE__*/Object.freeze({
1507
+ __proto__: null,
1508
+ Tooltip: Tooltip
1509
+ });
1510
+
1511
+ const Components = {
1512
+ ...AccordionModule,
1513
+ ...AlertModule,
1514
+ ...AutocompleteModule,
1515
+ ...BadgeModule,
1516
+ ...ButtonModule,
1517
+ ...CheckboxModule,
1518
+ ...ColorpickerModule,
1519
+ ...DatepickerModule,
1520
+ ...DrawerModule,
1521
+ ...DropdownModule,
1522
+ ...FabModule,
1523
+ ...FieldsetModule,
1524
+ ...FileinputModule,
1525
+ ...IndicatorModule,
1526
+ ...InputModule,
1527
+ ...ListModule,
1528
+ ...LoadingModule,
1529
+ ...MenuModule,
1530
+ ...ModalModule,
1531
+ ...NavbarModule,
1532
+ ...RadioModule,
1533
+ ...RangeModule,
1534
+ ...RatingModule,
1535
+ ...SelectModule,
1536
+ ...StackModule,
1537
+ ...StatModule,
1538
+ ...SwapModule,
1539
+ ...TableModule,
1540
+ ...TabsModule,
1541
+ ...TimelineModule,
1542
+ ...ToastModule,
1543
+ ...TooltipModule
1544
+ };
1545
+
1546
+ var index = {
1547
+ ...Components,
1548
+ install: (target = window) => {
1549
+ Object.entries(Components).forEach(([name, component]) => {
1550
+ target[name] = component;
1551
+ });
1552
+ console.log("🚀 SigproUI");
1553
+ }
1554
+ };
1555
+
1556
+ var Components$1 = /*#__PURE__*/Object.freeze({
1557
+ __proto__: null,
1558
+ Accordion: Accordion,
1559
+ Alert: Alert,
1560
+ Autocomplete: Autocomplete,
1561
+ Badge: Badge,
1562
+ Button: Button,
1563
+ Checkbox: Checkbox,
1564
+ Colorpicker: Colorpicker,
1565
+ Datepicker: Datepicker,
1566
+ Drawer: Drawer,
1567
+ Dropdown: Dropdown,
1568
+ Fab: Fab,
1569
+ Fieldset: Fieldset,
1570
+ Fileinput: Fileinput,
1571
+ Indicator: Indicator,
1572
+ Input: Input,
1573
+ List: List,
1574
+ Loading: Loading,
1575
+ Menu: Menu,
1576
+ Modal: Modal,
1577
+ Navbar: Navbar,
1578
+ Radio: Radio,
1579
+ Range: Range,
1580
+ Rating: Rating,
1581
+ Select: Select,
1582
+ Stack: Stack,
1583
+ Stat: Stat,
1584
+ Swap: Swap,
1585
+ Table: Table,
1586
+ Tabs: Tabs,
1587
+ Timeline: Timeline,
1588
+ Toast: Toast,
1589
+ Tooltip: Tooltip,
1590
+ default: index
1591
+ });
1592
+
1593
+ /**
1594
+ * SigproUI - Entry Point
1595
+ */
1596
+
1597
+
1598
+ const SigproUI = {
1599
+ ...Components$1,
1600
+ Icons,
1601
+ Utils,
1602
+ tt,
1603
+
1604
+ install: (target = (typeof window !== 'undefined' ? window : {})) => {
1605
+ Object.entries(Components$1).forEach(([name, component]) => {
1606
+ target[name] = component;
1607
+ });
1608
+
1609
+ target.Icons = Icons;
1610
+ target.Utils = Utils;
1611
+ target.tt = tt;
1612
+
1613
+ console.log("🌟 SigproUI");
1614
+ }
1615
+ };
1616
+
1617
+ if (typeof window !== 'undefined') {
1618
+ SigproUI.install(window);
1619
+ }
1620
+
1621
+ export { Accordion, Alert, Autocomplete, Badge, Button, Checkbox, Colorpicker, Datepicker, Drawer, Dropdown, Fab, Fieldset, Fileinput, Indicator, Input, List, Loading, Menu, Modal, Navbar, Radio, Range, Rating, Select, Stack, Stat, Swap, Table, Tabs, Timeline, Toast, Tooltip, SigproUI as default, icon123, iconAbc, iconCalendar, iconClose, iconError, iconHide, iconInfo, iconLLeft, iconLeft, iconLock, iconMail, iconRRight, iconRight, iconShow, iconSuccess, iconUpload, iconWarning, joinClass, tt, val };