monobill-mintui 0.6.716 → 0.6.720

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 (174) hide show
  1. package/bin/component-dependencies.json +1 -0
  2. package/dist/back-button.css +1 -1
  3. package/dist/button.css +1 -1
  4. package/dist/checkbox.css +1 -1
  5. package/dist/chip.css +1 -1
  6. package/dist/components/alert/browser.js +4 -4
  7. package/dist/components/alert/index.cjs +1 -1
  8. package/dist/components/alert/index.js +4 -4
  9. package/dist/components/back-button/browser.js +1 -1
  10. package/dist/components/back-button/index.cjs +1 -1
  11. package/dist/components/back-button/index.js +1 -1
  12. package/dist/components/bottom-navigation/browser.js +2 -2
  13. package/dist/components/bottom-navigation/index.cjs +1 -1
  14. package/dist/components/bottom-navigation/index.js +2 -2
  15. package/dist/components/button/browser.js +1 -1
  16. package/dist/components/button/index.cjs +1 -1
  17. package/dist/components/button/index.js +1 -1
  18. package/dist/components/checkbox/Checkbox.d.ts +3 -0
  19. package/dist/components/checkbox/Checkbox.d.ts.map +1 -1
  20. package/dist/components/checkbox/browser.js +2 -186
  21. package/dist/components/checkbox/index.cjs +1 -1
  22. package/dist/components/checkbox/index.js +2 -186
  23. package/dist/components/chip/browser.js +1 -1
  24. package/dist/components/chip/index.cjs +1 -1
  25. package/dist/components/chip/index.js +1 -1
  26. package/dist/components/chunks/{back-button-By8eO_KR.js → back-button-C0ajSqKu.js} +2 -2
  27. package/dist/components/chunks/{back-button-BGzrOtpx.js → back-button-Dw4NF_vN.js} +1 -1
  28. package/dist/components/chunks/{button-B_yN18B-.js → button-B4BMYTk1.js} +1 -1
  29. package/dist/components/chunks/{button-JPTyQfRs.js → button-BTQHrE0x.js} +2 -2
  30. package/dist/components/chunks/caret-down-DbFlPN-2.js +1 -0
  31. package/dist/components/chunks/{caret-down-ZjQN2yKq.js → caret-down-pn6aBT-u.js} +1 -1
  32. package/dist/components/chunks/caret-right-B8gOXLh9.js +1 -0
  33. package/dist/components/chunks/{caret-right-BlRbsLlh.js → caret-right-DDGEbhEH.js} +1 -1
  34. package/dist/components/chunks/checkbox-BKU8fiY7.js +1 -0
  35. package/dist/components/chunks/checkbox-p-Fb5ojp.js +193 -0
  36. package/dist/components/chunks/{chip-BUaS7ks-.js → chip-B0kg_vr8.js} +1 -1
  37. package/dist/components/chunks/{chip-XuYPtZ3Z.js → chip-bcCOd6-h.js} +3 -3
  38. package/dist/components/chunks/{close-Cn8XLO1c.js → close-8VXvDCau.js} +1 -1
  39. package/dist/components/chunks/close-CWAmmMRg.js +1 -0
  40. package/dist/components/chunks/{confirm-action-86hDdUKT.js → confirm-action-BN2-jao1.js} +1 -1
  41. package/dist/components/chunks/{confirm-action-CX_FEzCR.js → confirm-action-Q-Y57Rp-.js} +2 -2
  42. package/dist/components/chunks/{date-picker-DugLh7jt.js → date-picker-CDEVgbw7.js} +1 -1
  43. package/dist/components/chunks/{date-picker-C3dSu8nK.js → date-picker-R2gbHZCP.js} +5 -5
  44. package/dist/components/chunks/{icon-CWOP4Com.js → icon-B9P0jyS2.js} +6 -6
  45. package/dist/components/chunks/icon-CIAsmizQ.js +1 -0
  46. package/dist/components/chunks/icon-Cia9x_J2.js +1 -0
  47. package/dist/components/chunks/{icon-hyFz3uhh.js → icon-DAB2KLeo.js} +217 -207
  48. package/dist/components/chunks/{input-BI4nrOaG.js → input-BXC4lMG_.js} +1 -1
  49. package/dist/components/chunks/{input-B-njkq5j.js → input-B_q63xQu.js} +3 -3
  50. package/dist/components/chunks/{modal-ux6cqTde.js → modal-BlF1riUK.js} +1 -1
  51. package/dist/components/chunks/{modal-BEv3P1P0.js → modal-DDnUbaov.js} +3 -3
  52. package/dist/components/chunks/popover-CWWKb7L1.js +1 -0
  53. package/dist/components/chunks/{popover-D5-jzS7p.js → popover-DPNBidSz.js} +16 -3
  54. package/dist/components/chunks/search-CGQa7dR2.js +1 -0
  55. package/dist/components/chunks/{search-BwjKBnv9.js → search-COAeeXxO.js} +1 -1
  56. package/dist/components/chunks/{select-DYbwUtkq.js → select-CHImyDWO.js} +1 -1
  57. package/dist/components/chunks/{select-B1T9k1wp.js → select-CnN6eiFK.js} +3 -3
  58. package/dist/components/chunks/{table-slcPmVWy.js → table-B_S4xwx3.js} +1 -1
  59. package/dist/components/chunks/{table-B_g7lNzN.js → table-C6ufpGLx.js} +1 -1
  60. package/dist/components/chunks/{time-picker-hQaUyeFc.js → time-picker-CijVykQ3.js} +1 -1
  61. package/dist/components/chunks/{time-picker-BrwJJy_s.js → time-picker-NksIqyuD.js} +3 -3
  62. package/dist/components/chunks/{warning-DKCaTYO6.js → warning-CVnTPaMj.js} +1 -1
  63. package/dist/components/chunks/{warning-DAYbxh3S.js → warning-vve-cXPr.js} +1 -1
  64. package/dist/components/confirm-action/browser.js +1 -1
  65. package/dist/components/confirm-action/index.cjs +1 -1
  66. package/dist/components/confirm-action/index.js +1 -1
  67. package/dist/components/date-picker/browser.js +1 -1
  68. package/dist/components/date-picker/index.cjs +1 -1
  69. package/dist/components/date-picker/index.js +1 -1
  70. package/dist/components/datetime-picker/browser.js +3 -3
  71. package/dist/components/datetime-picker/index.cjs +1 -1
  72. package/dist/components/datetime-picker/index.js +3 -3
  73. package/dist/components/dropzone/browser.js +4 -4
  74. package/dist/components/dropzone/index.cjs +1 -1
  75. package/dist/components/dropzone/index.js +4 -4
  76. package/dist/components/icon/browser.js +1 -1
  77. package/dist/components/icon/icons/code.d.ts +3 -0
  78. package/dist/components/icon/icons/code.d.ts.map +1 -0
  79. package/dist/components/icon/icons/index.d.ts +1 -0
  80. package/dist/components/icon/icons/index.d.ts.map +1 -1
  81. package/dist/components/icon/index.cjs +1 -1
  82. package/dist/components/icon/index.js +1 -1
  83. package/dist/components/input/browser.js +1 -1
  84. package/dist/components/input/index.cjs +1 -1
  85. package/dist/components/input/index.js +1 -1
  86. package/dist/components/link/browser.js +1 -1
  87. package/dist/components/link/index.cjs +1 -1
  88. package/dist/components/link/index.js +1 -1
  89. package/dist/components/modal/browser.js +1 -1
  90. package/dist/components/modal/index.cjs +1 -1
  91. package/dist/components/modal/index.js +1 -1
  92. package/dist/components/navigation/browser.js +4 -4
  93. package/dist/components/navigation/index.cjs +1 -1
  94. package/dist/components/navigation/index.js +4 -4
  95. package/dist/components/off-canvas/browser.js +3 -3
  96. package/dist/components/off-canvas/index.cjs +1 -1
  97. package/dist/components/off-canvas/index.js +3 -3
  98. package/dist/components/page/browser.js +4 -4
  99. package/dist/components/page/index.cjs +1 -1
  100. package/dist/components/page/index.js +4 -4
  101. package/dist/components/popover/Popover.d.ts +9 -0
  102. package/dist/components/popover/Popover.d.ts.map +1 -1
  103. package/dist/components/popover/browser.js +1 -1
  104. package/dist/components/popover/index.cjs +1 -1
  105. package/dist/components/popover/index.js +1 -1
  106. package/dist/components/resource-table/ResourceTable.d.ts +25 -2
  107. package/dist/components/resource-table/ResourceTable.d.ts.map +1 -1
  108. package/dist/components/resource-table/browser.js +134 -53
  109. package/dist/components/resource-table/index.cjs +2 -2
  110. package/dist/components/resource-table/index.js +134 -53
  111. package/dist/components/resource-table/utility-aliases.d.ts +0 -2
  112. package/dist/components/resource-table/utility-aliases.d.ts.map +1 -1
  113. package/dist/components/scroll-fade/browser.js +1 -1
  114. package/dist/components/scroll-fade/index.cjs +1 -1
  115. package/dist/components/scroll-fade/index.js +1 -1
  116. package/dist/components/search/browser.js +7 -7
  117. package/dist/components/search/index.cjs +1 -1
  118. package/dist/components/search/index.js +7 -7
  119. package/dist/components/select/browser.js +1 -1
  120. package/dist/components/select/index.cjs +1 -1
  121. package/dist/components/select/index.js +1 -1
  122. package/dist/components/side-navigation/browser.js +6 -6
  123. package/dist/components/side-navigation/index.cjs +1 -1
  124. package/dist/components/side-navigation/index.js +6 -6
  125. package/dist/components/sortable/browser.js +1 -1
  126. package/dist/components/sortable/index.cjs +1 -1
  127. package/dist/components/sortable/index.js +1 -1
  128. package/dist/components/stack/browser.js +1 -1
  129. package/dist/components/stack/index.cjs +1 -1
  130. package/dist/components/stack/index.js +1 -1
  131. package/dist/components/switch/browser.js +2 -2
  132. package/dist/components/switch/index.cjs +1 -1
  133. package/dist/components/switch/index.js +2 -2
  134. package/dist/components/table/browser.js +1 -1
  135. package/dist/components/table/index.cjs +1 -1
  136. package/dist/components/table/index.js +1 -1
  137. package/dist/components/tabs/browser.js +1 -1
  138. package/dist/components/tabs/index.cjs +1 -1
  139. package/dist/components/tabs/index.js +1 -1
  140. package/dist/components/tags/browser.js +4 -4
  141. package/dist/components/tags/index.cjs +1 -1
  142. package/dist/components/tags/index.js +4 -4
  143. package/dist/components/time-picker/browser.js +1 -1
  144. package/dist/components/time-picker/index.cjs +1 -1
  145. package/dist/components/time-picker/index.js +1 -1
  146. package/dist/components/tree/browser.js +5 -5
  147. package/dist/components/tree/index.cjs +1 -1
  148. package/dist/components/tree/index.js +5 -5
  149. package/dist/confirm-action.css +1 -1
  150. package/dist/icons/code.svg +3 -0
  151. package/dist/index.cjs +11 -11
  152. package/dist/index.css +9 -9
  153. package/dist/index.js +536 -427
  154. package/dist/modal.css +1 -1
  155. package/dist/navigation-search.json +7 -0
  156. package/dist/navigation.css +1 -1
  157. package/dist/popover.css +1 -1
  158. package/dist/resource-table.css +1 -1
  159. package/package.json +1 -1
  160. package/dist/components/chunks/caret-down-BFHFcMyL.js +0 -1
  161. package/dist/components/chunks/caret-right--YnEL-Ny.js +0 -1
  162. package/dist/components/chunks/close-DSrpkGHJ.js +0 -1
  163. package/dist/components/chunks/icon-D6C1XGp2.js +0 -1
  164. package/dist/components/chunks/icon-l34kRIZg.js +0 -1
  165. package/dist/components/chunks/popover-DFxM40QK.js +0 -1
  166. package/dist/components/chunks/search-q3dkl4-X.js +0 -1
  167. /package/dist/components/chunks/{ScrollFade-DvzPIk2A.js → ScrollFade-Cg9fVO0V.js} +0 -0
  168. /package/dist/components/chunks/{ScrollFade-BMs09zZN.js → ScrollFade-Dfq2B1Hm.js} +0 -0
  169. /package/dist/components/chunks/{link-DVKhDl3O.js → link-B_fNmwOk.js} +0 -0
  170. /package/dist/components/chunks/{link-ACOyvLkd.js → link-BxTQfAW9.js} +0 -0
  171. /package/dist/components/chunks/{sortable-BSw58wy_.js → sortable-Bql13n3L.js} +0 -0
  172. /package/dist/components/chunks/{sortable-D3et5wXB.js → sortable-DdT2ptc5.js} +0 -0
  173. /package/dist/components/chunks/{stack-DEIdHS0n.js → stack-CK2o4-As.js} +0 -0
  174. /package/dist/components/chunks/{stack-CzcHNnl8.js → stack-CKUu8IVZ.js} +0 -0
@@ -13,189 +13,5 @@ const __mintLoadStyle = (key, url) => {
13
13
  __mintLoadStyle('theme', '../../theme.css')
14
14
  __mintLoadStyle('icon', '../../icon.css')
15
15
  __mintLoadStyle('checkbox', '../../checkbox.css')
16
- import { a as e } from "../chunks/icon-hyFz3uhh.js";
17
- import { t } from "../chunks/register-element-BFYmIynH.js";
18
- import "../chunks/icon-l34kRIZg.js";
19
- e({
20
- name: "check",
21
- viewBox: "0 0 24 24",
22
- path: "M5 13l4 4L19 7",
23
- strokeLinecap: "round",
24
- strokeLinejoin: "round",
25
- strokeWidth: "3.2"
26
- });
27
- //#endregion
28
- //#region src/components/checkbox/Checkbox.js
29
- var n = class extends HTMLElement {
30
- static get observedAttributes() {
31
- return [
32
- "checked",
33
- "disabled",
34
- "label",
35
- "info",
36
- "id",
37
- "name",
38
- "value",
39
- "loading"
40
- ];
41
- }
42
- constructor() {
43
- super(), this._checkbox = null, this._checked = !1, this._clickHandler = null;
44
- }
45
- connectedCallback() {
46
- let e = this.getAttribute("checked");
47
- this._checked = e !== null && e !== "false", this.render();
48
- }
49
- disconnectedCallback() {
50
- this.removeEventListeners();
51
- }
52
- attributeChangedCallback(e, t, n) {
53
- e === "checked" && (this._checked = n !== null && n !== "false", this._checkbox && (this._checkbox.checked = this._checked)), t !== n && (this.render(), e === "checked" && this._checkbox && this.updateVisualState());
54
- }
55
- get checked() {
56
- return this._checked;
57
- }
58
- set checked(e) {
59
- e ? this.setAttribute("checked", "") : this.removeAttribute("checked"), this._checked = !!e, this._checkbox && (this._checkbox.checked = this._checked), this.updateVisualState();
60
- }
61
- isDisabled() {
62
- return this.hasAttribute("disabled") || this.getAttribute("loading") === "true";
63
- }
64
- getLabel() {
65
- return this.getAttribute("label") || "";
66
- }
67
- getInfo() {
68
- return this.getAttribute("info") || "";
69
- }
70
- getId() {
71
- return this.getAttribute("id") || "";
72
- }
73
- getName() {
74
- return this.getAttribute("name") || "";
75
- }
76
- getValue() {
77
- return this.getAttribute("value") || "";
78
- }
79
- getCheckboxClasses() {
80
- return "mint-checkbox-control";
81
- }
82
- render() {
83
- let e = this.getAttribute("loading") === "true";
84
- this.toggleAttribute("aria-busy", e);
85
- let t = this.getLabel(), n = this.getInfo(), r = this.isDisabled(), i = this.querySelector(".mint-checkbox-wrapper");
86
- i || (i = document.createElement("div"), i.className = "mint-checkbox-wrapper", this.insertBefore(i, this.firstChild)), this._checkbox ? this._checkbox.parentElement !== i && i.appendChild(this._checkbox) : (this._checkbox = document.createElement("input"), this._checkbox.type = "checkbox", i.appendChild(this._checkbox), this.setupEventListeners()), this._checkbox.className = "mint-input-overlay", this._checkbox.style.cssText = "position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; z-index: 10; pointer-events: auto; margin: 0; padding: 0;", this._checkbox.checked = this._checked, this._checkbox.disabled = r, this._changeHandler || this.setupEventListeners();
87
- let a = this.getId();
88
- a ? this._checkbox.id = a : this._checkbox.removeAttribute("id");
89
- let o = this.getName();
90
- o ? this._checkbox.name = o : this._checkbox.removeAttribute("name");
91
- let s = this.getValue();
92
- s ? this._checkbox.value = s : this._checkbox.removeAttribute("value"), t ? this._checkbox.setAttribute("aria-label", t) : this._checkbox.removeAttribute("aria-label"), i.className = `mint-checkbox-wrapper ${this.getCheckboxClasses()}`, i.style.pointerEvents = "none", this._checkbox.style.pointerEvents = "auto";
93
- let c = i.querySelector("mint-icon");
94
- c || (c = document.createElement("mint-icon"), c.setAttribute("name", "check"), c.className = "mint-checkbox-check", c.style.transition = "opacity 200ms ease-out, transform 200ms ease-out", c.style.zIndex = "1", i.appendChild(c)), this.updateVisualState();
95
- let l = this.querySelector(".mint-checkbox-label-container");
96
- if (t || n) {
97
- l || (l = document.createElement("div"), l.className = "mint-checkbox-label-container", this.appendChild(l));
98
- let e = l.querySelector(".mint-checkbox-label");
99
- t ? (e || (e = document.createElement("span"), e.className = "mint-checkbox-label", l.insertBefore(e, l.firstChild)), e.textContent = t, r ? e.style.opacity = "0.5" : e.style.opacity = "") : e && e.remove();
100
- let i = l.querySelector(".mint-checkbox-info");
101
- if (n ? (i || (i = document.createElement("span"), i.className = "mint-checkbox-info", l.appendChild(i)), i.textContent = n, r ? i.style.opacity = "0.5" : i.style.opacity = "") : i && i.remove(), r) l.style.cursor = "default", l._clickHandler && (l.removeEventListener("click", l._clickHandler), l._clickHandler = null);
102
- else {
103
- l.style.cursor = "pointer";
104
- let e = l._clickHandler;
105
- e && l.removeEventListener("click", e), l._clickHandler = (e) => {
106
- this._checkbox && (e.target === this._checkbox || this._checkbox.contains(e.target) || e.composedPath().includes(this._checkbox)) || this.toggle();
107
- }, l.addEventListener("click", l._clickHandler);
108
- }
109
- } else l && l.remove();
110
- let u = this.querySelector(":scope > .mint-checkbox-loading-skeleton");
111
- if (e) {
112
- if (!u) {
113
- u = document.createElement("div"), u.className = "mint-checkbox-loading-skeleton", u.setAttribute("aria-hidden", "true"), Object.assign(u.style, {
114
- position: "absolute",
115
- inset: "0",
116
- display: "flex",
117
- alignItems: "center",
118
- gap: "0.5rem",
119
- pointerEvents: "none",
120
- zIndex: "20"
121
- });
122
- let e = document.createElement("span");
123
- if (Object.assign(e.style, {
124
- display: "block",
125
- width: "1.25rem",
126
- height: "1.25rem",
127
- flex: "none",
128
- borderRadius: "0.25rem",
129
- background: "var(--mint-color-surface-control, #e8eee9)",
130
- animation: "mint-checkbox-skeleton-pulse 1.4s ease-in-out infinite"
131
- }), u.appendChild(e), t) {
132
- let e = document.createElement("span");
133
- Object.assign(e.style, {
134
- display: "block",
135
- width: "6rem",
136
- height: "1rem",
137
- borderRadius: "0.35rem",
138
- background: "var(--mint-color-surface-control, #e8eee9)",
139
- animation: "mint-checkbox-skeleton-pulse 1.4s ease-in-out infinite"
140
- }), u.appendChild(e);
141
- }
142
- this.appendChild(u);
143
- }
144
- this.style.position = "relative", u.style.display = "flex", i.style.visibility = "hidden", l && (l.style.visibility = "hidden");
145
- } else u && (u.style.display = "none"), i.style.visibility = "", l && (l.style.visibility = "");
146
- }
147
- setupEventListeners() {
148
- this.removeEventListeners(), this._checkbox && (this._changeHandler = (e) => {
149
- e.stopPropagation(), this._checked = this._checkbox.checked, this._checked ? this.hasAttribute("checked") || this.setAttribute("checked", "") : this.hasAttribute("checked") && this.removeAttribute("checked"), this.updateVisualState();
150
- let t = new CustomEvent("change", {
151
- detail: {
152
- checked: this._checked,
153
- value: this.getValue()
154
- },
155
- bubbles: !0,
156
- cancelable: !0
157
- });
158
- this.dispatchEvent(t);
159
- }, this._checkbox.addEventListener("change", this._changeHandler), this._mousedownHandler = (e) => {
160
- e.stopPropagation();
161
- let t = this.querySelector(".mint-checkbox-wrapper");
162
- t && !this.isDisabled() && (t.classList.add("mint-checkbox-active"), this._checked ? (t.style.backgroundColor = "var(--mint-color-primary)", t.style.boxShadow = "inset 0 2px 4px rgba(0, 0, 0, 0.3)") : (t.style.backgroundColor = "var(--mint-color-surface-hover)", t.style.boxShadow = "inset 0 2px 4px rgba(0, 0, 0, 0.1)"));
163
- }, this._mouseupHandler = (e) => {
164
- e.stopPropagation();
165
- let t = this.querySelector(".mint-checkbox-wrapper");
166
- t && (t.classList.remove("mint-checkbox-active"), t.style.backgroundColor = "", t.style.boxShadow = "");
167
- }, this._mouseleaveHandler = (e) => {
168
- let t = this.querySelector(".mint-checkbox-wrapper");
169
- t && (t.classList.remove("mint-checkbox-active"), t.style.backgroundColor = "", t.style.boxShadow = "");
170
- }, this._checkbox.addEventListener("mousedown", this._mousedownHandler), this._checkbox.addEventListener("mouseup", this._mouseupHandler), this._checkbox.addEventListener("mouseleave", this._mouseleaveHandler), this._touchstartHandler = (e) => {
171
- e.stopPropagation();
172
- let t = this.querySelector(".mint-checkbox-wrapper");
173
- t && !this.isDisabled() && (t.classList.add("mint-checkbox-active"), this._checked ? (t.style.backgroundColor = "var(--mint-color-primary)", t.style.boxShadow = "inset 0 2px 4px rgba(0, 0, 0, 0.3)") : (t.style.backgroundColor = "var(--mint-color-surface-hover)", t.style.boxShadow = "inset 0 2px 4px rgba(0, 0, 0, 0.1)"));
174
- }, this._touchendHandler = (e) => {
175
- e.stopPropagation();
176
- let t = this.querySelector(".mint-checkbox-wrapper");
177
- t && (t.classList.remove("mint-checkbox-active"), t.style.backgroundColor = "", t.style.boxShadow = "");
178
- }, this._checkbox.addEventListener("touchstart", this._touchstartHandler), this._checkbox.addEventListener("touchend", this._touchendHandler));
179
- }
180
- removeEventListeners() {
181
- this._checkbox && (this._changeHandler &&= (this._checkbox.removeEventListener("change", this._changeHandler), null), this._mousedownHandler &&= (this._checkbox.removeEventListener("mousedown", this._mousedownHandler), null), this._mouseupHandler &&= (this._checkbox.removeEventListener("mouseup", this._mouseupHandler), null), this._mouseleaveHandler &&= (this._checkbox.removeEventListener("mouseleave", this._mouseleaveHandler), null), this._touchstartHandler &&= (this._checkbox.removeEventListener("touchstart", this._touchstartHandler), null), this._touchendHandler &&= (this._checkbox.removeEventListener("touchend", this._touchendHandler), null));
182
- }
183
- updateVisualState() {
184
- let e = this.querySelector(".mint-checkbox-wrapper"), t = e?.querySelector("mint-icon");
185
- t && (t.style.opacity = this._checked ? "1" : "0", t.style.transform = this._checked ? "scale(1)" : "scale(0.8)"), e && (e.className = `mint-checkbox-wrapper ${this.getCheckboxClasses()}`, e.classList.contains("mint-checkbox-active") || (e.style.backgroundColor = "", e.style.boxShadow = ""));
186
- }
187
- toggle() {
188
- if (this._checkbox && !this.isDisabled()) {
189
- this._checkbox.checked = !this._checked, this._checked = this._checkbox.checked, this._checked ? this.hasAttribute("checked") || this.setAttribute("checked", "") : this.hasAttribute("checked") && this.removeAttribute("checked"), this.updateVisualState();
190
- let e = new CustomEvent("change", {
191
- detail: { checked: this._checked },
192
- bubbles: !0,
193
- cancelable: !0
194
- });
195
- this.dispatchEvent(e);
196
- }
197
- }
198
- };
199
- typeof customElements < "u" && !customElements.get("mint-checkbox") && t("mint-checkbox", n);
200
- //#endregion
201
- export { n as default };
16
+ import { t as e } from "../chunks/checkbox-p-Fb5ojp.js";
17
+ export { e as default };
@@ -1 +1 @@
1
- const e=require(`../chunks/icon-CWOP4Com.js`),t=require(`../chunks/register-element-tCL_F1YI.js`);require(`../chunks/icon-D6C1XGp2.js`),e.a({name:`check`,viewBox:`0 0 24 24`,path:`M5 13l4 4L19 7`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`3.2`});var n=class extends HTMLElement{static get observedAttributes(){return[`checked`,`disabled`,`label`,`info`,`id`,`name`,`value`,`loading`]}constructor(){super(),this._checkbox=null,this._checked=!1,this._clickHandler=null}connectedCallback(){let e=this.getAttribute(`checked`);this._checked=e!==null&&e!==`false`,this.render()}disconnectedCallback(){this.removeEventListeners()}attributeChangedCallback(e,t,n){e===`checked`&&(this._checked=n!==null&&n!==`false`,this._checkbox&&(this._checkbox.checked=this._checked)),t!==n&&(this.render(),e===`checked`&&this._checkbox&&this.updateVisualState())}get checked(){return this._checked}set checked(e){e?this.setAttribute(`checked`,``):this.removeAttribute(`checked`),this._checked=!!e,this._checkbox&&(this._checkbox.checked=this._checked),this.updateVisualState()}isDisabled(){return this.hasAttribute(`disabled`)||this.getAttribute(`loading`)===`true`}getLabel(){return this.getAttribute(`label`)||``}getInfo(){return this.getAttribute(`info`)||``}getId(){return this.getAttribute(`id`)||``}getName(){return this.getAttribute(`name`)||``}getValue(){return this.getAttribute(`value`)||``}getCheckboxClasses(){return`mint-checkbox-control`}render(){let e=this.getAttribute(`loading`)===`true`;this.toggleAttribute(`aria-busy`,e);let t=this.getLabel(),n=this.getInfo(),r=this.isDisabled(),i=this.querySelector(`.mint-checkbox-wrapper`);i||(i=document.createElement(`div`),i.className=`mint-checkbox-wrapper`,this.insertBefore(i,this.firstChild)),this._checkbox?this._checkbox.parentElement!==i&&i.appendChild(this._checkbox):(this._checkbox=document.createElement(`input`),this._checkbox.type=`checkbox`,i.appendChild(this._checkbox),this.setupEventListeners()),this._checkbox.className=`mint-input-overlay`,this._checkbox.style.cssText=`position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; z-index: 10; pointer-events: auto; margin: 0; padding: 0;`,this._checkbox.checked=this._checked,this._checkbox.disabled=r,this._changeHandler||this.setupEventListeners();let a=this.getId();a?this._checkbox.id=a:this._checkbox.removeAttribute(`id`);let o=this.getName();o?this._checkbox.name=o:this._checkbox.removeAttribute(`name`);let s=this.getValue();s?this._checkbox.value=s:this._checkbox.removeAttribute(`value`),t?this._checkbox.setAttribute(`aria-label`,t):this._checkbox.removeAttribute(`aria-label`),i.className=`mint-checkbox-wrapper ${this.getCheckboxClasses()}`,i.style.pointerEvents=`none`,this._checkbox.style.pointerEvents=`auto`;let c=i.querySelector(`mint-icon`);c||(c=document.createElement(`mint-icon`),c.setAttribute(`name`,`check`),c.className=`mint-checkbox-check`,c.style.transition=`opacity 200ms ease-out, transform 200ms ease-out`,c.style.zIndex=`1`,i.appendChild(c)),this.updateVisualState();let l=this.querySelector(`.mint-checkbox-label-container`);if(t||n){l||(l=document.createElement(`div`),l.className=`mint-checkbox-label-container`,this.appendChild(l));let e=l.querySelector(`.mint-checkbox-label`);t?(e||(e=document.createElement(`span`),e.className=`mint-checkbox-label`,l.insertBefore(e,l.firstChild)),e.textContent=t,r?e.style.opacity=`0.5`:e.style.opacity=``):e&&e.remove();let i=l.querySelector(`.mint-checkbox-info`);if(n?(i||(i=document.createElement(`span`),i.className=`mint-checkbox-info`,l.appendChild(i)),i.textContent=n,r?i.style.opacity=`0.5`:i.style.opacity=``):i&&i.remove(),r)l.style.cursor=`default`,l._clickHandler&&(l.removeEventListener(`click`,l._clickHandler),l._clickHandler=null);else{l.style.cursor=`pointer`;let e=l._clickHandler;e&&l.removeEventListener(`click`,e),l._clickHandler=e=>{this._checkbox&&(e.target===this._checkbox||this._checkbox.contains(e.target)||e.composedPath().includes(this._checkbox))||this.toggle()},l.addEventListener(`click`,l._clickHandler)}}else l&&l.remove();let u=this.querySelector(`:scope > .mint-checkbox-loading-skeleton`);if(e){if(!u){u=document.createElement(`div`),u.className=`mint-checkbox-loading-skeleton`,u.setAttribute(`aria-hidden`,`true`),Object.assign(u.style,{position:`absolute`,inset:`0`,display:`flex`,alignItems:`center`,gap:`0.5rem`,pointerEvents:`none`,zIndex:`20`});let e=document.createElement(`span`);if(Object.assign(e.style,{display:`block`,width:`1.25rem`,height:`1.25rem`,flex:`none`,borderRadius:`0.25rem`,background:`var(--mint-color-surface-control, #e8eee9)`,animation:`mint-checkbox-skeleton-pulse 1.4s ease-in-out infinite`}),u.appendChild(e),t){let e=document.createElement(`span`);Object.assign(e.style,{display:`block`,width:`6rem`,height:`1rem`,borderRadius:`0.35rem`,background:`var(--mint-color-surface-control, #e8eee9)`,animation:`mint-checkbox-skeleton-pulse 1.4s ease-in-out infinite`}),u.appendChild(e)}this.appendChild(u)}this.style.position=`relative`,u.style.display=`flex`,i.style.visibility=`hidden`,l&&(l.style.visibility=`hidden`)}else u&&(u.style.display=`none`),i.style.visibility=``,l&&(l.style.visibility=``)}setupEventListeners(){this.removeEventListeners(),this._checkbox&&(this._changeHandler=e=>{e.stopPropagation(),this._checked=this._checkbox.checked,this._checked?this.hasAttribute(`checked`)||this.setAttribute(`checked`,``):this.hasAttribute(`checked`)&&this.removeAttribute(`checked`),this.updateVisualState();let t=new CustomEvent(`change`,{detail:{checked:this._checked,value:this.getValue()},bubbles:!0,cancelable:!0});this.dispatchEvent(t)},this._checkbox.addEventListener(`change`,this._changeHandler),this._mousedownHandler=e=>{e.stopPropagation();let t=this.querySelector(`.mint-checkbox-wrapper`);t&&!this.isDisabled()&&(t.classList.add(`mint-checkbox-active`),this._checked?(t.style.backgroundColor=`var(--mint-color-primary)`,t.style.boxShadow=`inset 0 2px 4px rgba(0, 0, 0, 0.3)`):(t.style.backgroundColor=`var(--mint-color-surface-hover)`,t.style.boxShadow=`inset 0 2px 4px rgba(0, 0, 0, 0.1)`))},this._mouseupHandler=e=>{e.stopPropagation();let t=this.querySelector(`.mint-checkbox-wrapper`);t&&(t.classList.remove(`mint-checkbox-active`),t.style.backgroundColor=``,t.style.boxShadow=``)},this._mouseleaveHandler=e=>{let t=this.querySelector(`.mint-checkbox-wrapper`);t&&(t.classList.remove(`mint-checkbox-active`),t.style.backgroundColor=``,t.style.boxShadow=``)},this._checkbox.addEventListener(`mousedown`,this._mousedownHandler),this._checkbox.addEventListener(`mouseup`,this._mouseupHandler),this._checkbox.addEventListener(`mouseleave`,this._mouseleaveHandler),this._touchstartHandler=e=>{e.stopPropagation();let t=this.querySelector(`.mint-checkbox-wrapper`);t&&!this.isDisabled()&&(t.classList.add(`mint-checkbox-active`),this._checked?(t.style.backgroundColor=`var(--mint-color-primary)`,t.style.boxShadow=`inset 0 2px 4px rgba(0, 0, 0, 0.3)`):(t.style.backgroundColor=`var(--mint-color-surface-hover)`,t.style.boxShadow=`inset 0 2px 4px rgba(0, 0, 0, 0.1)`))},this._touchendHandler=e=>{e.stopPropagation();let t=this.querySelector(`.mint-checkbox-wrapper`);t&&(t.classList.remove(`mint-checkbox-active`),t.style.backgroundColor=``,t.style.boxShadow=``)},this._checkbox.addEventListener(`touchstart`,this._touchstartHandler),this._checkbox.addEventListener(`touchend`,this._touchendHandler))}removeEventListeners(){this._checkbox&&(this._changeHandler&&=(this._checkbox.removeEventListener(`change`,this._changeHandler),null),this._mousedownHandler&&=(this._checkbox.removeEventListener(`mousedown`,this._mousedownHandler),null),this._mouseupHandler&&=(this._checkbox.removeEventListener(`mouseup`,this._mouseupHandler),null),this._mouseleaveHandler&&=(this._checkbox.removeEventListener(`mouseleave`,this._mouseleaveHandler),null),this._touchstartHandler&&=(this._checkbox.removeEventListener(`touchstart`,this._touchstartHandler),null),this._touchendHandler&&=(this._checkbox.removeEventListener(`touchend`,this._touchendHandler),null))}updateVisualState(){let e=this.querySelector(`.mint-checkbox-wrapper`),t=e?.querySelector(`mint-icon`);t&&(t.style.opacity=this._checked?`1`:`0`,t.style.transform=this._checked?`scale(1)`:`scale(0.8)`),e&&(e.className=`mint-checkbox-wrapper ${this.getCheckboxClasses()}`,e.classList.contains(`mint-checkbox-active`)||(e.style.backgroundColor=``,e.style.boxShadow=``))}toggle(){if(this._checkbox&&!this.isDisabled()){this._checkbox.checked=!this._checked,this._checked=this._checkbox.checked,this._checked?this.hasAttribute(`checked`)||this.setAttribute(`checked`,``):this.hasAttribute(`checked`)&&this.removeAttribute(`checked`),this.updateVisualState();let e=new CustomEvent(`change`,{detail:{checked:this._checked},bubbles:!0,cancelable:!0});this.dispatchEvent(e)}}};typeof customElements<`u`&&!customElements.get(`mint-checkbox`)&&t.t(`mint-checkbox`,n),module.exports=n;
1
+ const e=require(`../chunks/checkbox-BKU8fiY7.js`);module.exports=e.t;
@@ -1,189 +1,5 @@
1
1
  import '../../theme.css'
2
2
  import '../../icon.css'
3
3
  import '../../checkbox.css'
4
- import { a as e } from "../chunks/icon-hyFz3uhh.js";
5
- import { t } from "../chunks/register-element-BFYmIynH.js";
6
- import "../chunks/icon-l34kRIZg.js";
7
- e({
8
- name: "check",
9
- viewBox: "0 0 24 24",
10
- path: "M5 13l4 4L19 7",
11
- strokeLinecap: "round",
12
- strokeLinejoin: "round",
13
- strokeWidth: "3.2"
14
- });
15
- //#endregion
16
- //#region src/components/checkbox/Checkbox.js
17
- var n = class extends HTMLElement {
18
- static get observedAttributes() {
19
- return [
20
- "checked",
21
- "disabled",
22
- "label",
23
- "info",
24
- "id",
25
- "name",
26
- "value",
27
- "loading"
28
- ];
29
- }
30
- constructor() {
31
- super(), this._checkbox = null, this._checked = !1, this._clickHandler = null;
32
- }
33
- connectedCallback() {
34
- let e = this.getAttribute("checked");
35
- this._checked = e !== null && e !== "false", this.render();
36
- }
37
- disconnectedCallback() {
38
- this.removeEventListeners();
39
- }
40
- attributeChangedCallback(e, t, n) {
41
- e === "checked" && (this._checked = n !== null && n !== "false", this._checkbox && (this._checkbox.checked = this._checked)), t !== n && (this.render(), e === "checked" && this._checkbox && this.updateVisualState());
42
- }
43
- get checked() {
44
- return this._checked;
45
- }
46
- set checked(e) {
47
- e ? this.setAttribute("checked", "") : this.removeAttribute("checked"), this._checked = !!e, this._checkbox && (this._checkbox.checked = this._checked), this.updateVisualState();
48
- }
49
- isDisabled() {
50
- return this.hasAttribute("disabled") || this.getAttribute("loading") === "true";
51
- }
52
- getLabel() {
53
- return this.getAttribute("label") || "";
54
- }
55
- getInfo() {
56
- return this.getAttribute("info") || "";
57
- }
58
- getId() {
59
- return this.getAttribute("id") || "";
60
- }
61
- getName() {
62
- return this.getAttribute("name") || "";
63
- }
64
- getValue() {
65
- return this.getAttribute("value") || "";
66
- }
67
- getCheckboxClasses() {
68
- return "mint-checkbox-control";
69
- }
70
- render() {
71
- let e = this.getAttribute("loading") === "true";
72
- this.toggleAttribute("aria-busy", e);
73
- let t = this.getLabel(), n = this.getInfo(), r = this.isDisabled(), i = this.querySelector(".mint-checkbox-wrapper");
74
- i || (i = document.createElement("div"), i.className = "mint-checkbox-wrapper", this.insertBefore(i, this.firstChild)), this._checkbox ? this._checkbox.parentElement !== i && i.appendChild(this._checkbox) : (this._checkbox = document.createElement("input"), this._checkbox.type = "checkbox", i.appendChild(this._checkbox), this.setupEventListeners()), this._checkbox.className = "mint-input-overlay", this._checkbox.style.cssText = "position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; z-index: 10; pointer-events: auto; margin: 0; padding: 0;", this._checkbox.checked = this._checked, this._checkbox.disabled = r, this._changeHandler || this.setupEventListeners();
75
- let a = this.getId();
76
- a ? this._checkbox.id = a : this._checkbox.removeAttribute("id");
77
- let o = this.getName();
78
- o ? this._checkbox.name = o : this._checkbox.removeAttribute("name");
79
- let s = this.getValue();
80
- s ? this._checkbox.value = s : this._checkbox.removeAttribute("value"), t ? this._checkbox.setAttribute("aria-label", t) : this._checkbox.removeAttribute("aria-label"), i.className = `mint-checkbox-wrapper ${this.getCheckboxClasses()}`, i.style.pointerEvents = "none", this._checkbox.style.pointerEvents = "auto";
81
- let c = i.querySelector("mint-icon");
82
- c || (c = document.createElement("mint-icon"), c.setAttribute("name", "check"), c.className = "mint-checkbox-check", c.style.transition = "opacity 200ms ease-out, transform 200ms ease-out", c.style.zIndex = "1", i.appendChild(c)), this.updateVisualState();
83
- let l = this.querySelector(".mint-checkbox-label-container");
84
- if (t || n) {
85
- l || (l = document.createElement("div"), l.className = "mint-checkbox-label-container", this.appendChild(l));
86
- let e = l.querySelector(".mint-checkbox-label");
87
- t ? (e || (e = document.createElement("span"), e.className = "mint-checkbox-label", l.insertBefore(e, l.firstChild)), e.textContent = t, r ? e.style.opacity = "0.5" : e.style.opacity = "") : e && e.remove();
88
- let i = l.querySelector(".mint-checkbox-info");
89
- if (n ? (i || (i = document.createElement("span"), i.className = "mint-checkbox-info", l.appendChild(i)), i.textContent = n, r ? i.style.opacity = "0.5" : i.style.opacity = "") : i && i.remove(), r) l.style.cursor = "default", l._clickHandler && (l.removeEventListener("click", l._clickHandler), l._clickHandler = null);
90
- else {
91
- l.style.cursor = "pointer";
92
- let e = l._clickHandler;
93
- e && l.removeEventListener("click", e), l._clickHandler = (e) => {
94
- this._checkbox && (e.target === this._checkbox || this._checkbox.contains(e.target) || e.composedPath().includes(this._checkbox)) || this.toggle();
95
- }, l.addEventListener("click", l._clickHandler);
96
- }
97
- } else l && l.remove();
98
- let u = this.querySelector(":scope > .mint-checkbox-loading-skeleton");
99
- if (e) {
100
- if (!u) {
101
- u = document.createElement("div"), u.className = "mint-checkbox-loading-skeleton", u.setAttribute("aria-hidden", "true"), Object.assign(u.style, {
102
- position: "absolute",
103
- inset: "0",
104
- display: "flex",
105
- alignItems: "center",
106
- gap: "0.5rem",
107
- pointerEvents: "none",
108
- zIndex: "20"
109
- });
110
- let e = document.createElement("span");
111
- if (Object.assign(e.style, {
112
- display: "block",
113
- width: "1.25rem",
114
- height: "1.25rem",
115
- flex: "none",
116
- borderRadius: "0.25rem",
117
- background: "var(--mint-color-surface-control, #e8eee9)",
118
- animation: "mint-checkbox-skeleton-pulse 1.4s ease-in-out infinite"
119
- }), u.appendChild(e), t) {
120
- let e = document.createElement("span");
121
- Object.assign(e.style, {
122
- display: "block",
123
- width: "6rem",
124
- height: "1rem",
125
- borderRadius: "0.35rem",
126
- background: "var(--mint-color-surface-control, #e8eee9)",
127
- animation: "mint-checkbox-skeleton-pulse 1.4s ease-in-out infinite"
128
- }), u.appendChild(e);
129
- }
130
- this.appendChild(u);
131
- }
132
- this.style.position = "relative", u.style.display = "flex", i.style.visibility = "hidden", l && (l.style.visibility = "hidden");
133
- } else u && (u.style.display = "none"), i.style.visibility = "", l && (l.style.visibility = "");
134
- }
135
- setupEventListeners() {
136
- this.removeEventListeners(), this._checkbox && (this._changeHandler = (e) => {
137
- e.stopPropagation(), this._checked = this._checkbox.checked, this._checked ? this.hasAttribute("checked") || this.setAttribute("checked", "") : this.hasAttribute("checked") && this.removeAttribute("checked"), this.updateVisualState();
138
- let t = new CustomEvent("change", {
139
- detail: {
140
- checked: this._checked,
141
- value: this.getValue()
142
- },
143
- bubbles: !0,
144
- cancelable: !0
145
- });
146
- this.dispatchEvent(t);
147
- }, this._checkbox.addEventListener("change", this._changeHandler), this._mousedownHandler = (e) => {
148
- e.stopPropagation();
149
- let t = this.querySelector(".mint-checkbox-wrapper");
150
- t && !this.isDisabled() && (t.classList.add("mint-checkbox-active"), this._checked ? (t.style.backgroundColor = "var(--mint-color-primary)", t.style.boxShadow = "inset 0 2px 4px rgba(0, 0, 0, 0.3)") : (t.style.backgroundColor = "var(--mint-color-surface-hover)", t.style.boxShadow = "inset 0 2px 4px rgba(0, 0, 0, 0.1)"));
151
- }, this._mouseupHandler = (e) => {
152
- e.stopPropagation();
153
- let t = this.querySelector(".mint-checkbox-wrapper");
154
- t && (t.classList.remove("mint-checkbox-active"), t.style.backgroundColor = "", t.style.boxShadow = "");
155
- }, this._mouseleaveHandler = (e) => {
156
- let t = this.querySelector(".mint-checkbox-wrapper");
157
- t && (t.classList.remove("mint-checkbox-active"), t.style.backgroundColor = "", t.style.boxShadow = "");
158
- }, this._checkbox.addEventListener("mousedown", this._mousedownHandler), this._checkbox.addEventListener("mouseup", this._mouseupHandler), this._checkbox.addEventListener("mouseleave", this._mouseleaveHandler), this._touchstartHandler = (e) => {
159
- e.stopPropagation();
160
- let t = this.querySelector(".mint-checkbox-wrapper");
161
- t && !this.isDisabled() && (t.classList.add("mint-checkbox-active"), this._checked ? (t.style.backgroundColor = "var(--mint-color-primary)", t.style.boxShadow = "inset 0 2px 4px rgba(0, 0, 0, 0.3)") : (t.style.backgroundColor = "var(--mint-color-surface-hover)", t.style.boxShadow = "inset 0 2px 4px rgba(0, 0, 0, 0.1)"));
162
- }, this._touchendHandler = (e) => {
163
- e.stopPropagation();
164
- let t = this.querySelector(".mint-checkbox-wrapper");
165
- t && (t.classList.remove("mint-checkbox-active"), t.style.backgroundColor = "", t.style.boxShadow = "");
166
- }, this._checkbox.addEventListener("touchstart", this._touchstartHandler), this._checkbox.addEventListener("touchend", this._touchendHandler));
167
- }
168
- removeEventListeners() {
169
- this._checkbox && (this._changeHandler &&= (this._checkbox.removeEventListener("change", this._changeHandler), null), this._mousedownHandler &&= (this._checkbox.removeEventListener("mousedown", this._mousedownHandler), null), this._mouseupHandler &&= (this._checkbox.removeEventListener("mouseup", this._mouseupHandler), null), this._mouseleaveHandler &&= (this._checkbox.removeEventListener("mouseleave", this._mouseleaveHandler), null), this._touchstartHandler &&= (this._checkbox.removeEventListener("touchstart", this._touchstartHandler), null), this._touchendHandler &&= (this._checkbox.removeEventListener("touchend", this._touchendHandler), null));
170
- }
171
- updateVisualState() {
172
- let e = this.querySelector(".mint-checkbox-wrapper"), t = e?.querySelector("mint-icon");
173
- t && (t.style.opacity = this._checked ? "1" : "0", t.style.transform = this._checked ? "scale(1)" : "scale(0.8)"), e && (e.className = `mint-checkbox-wrapper ${this.getCheckboxClasses()}`, e.classList.contains("mint-checkbox-active") || (e.style.backgroundColor = "", e.style.boxShadow = ""));
174
- }
175
- toggle() {
176
- if (this._checkbox && !this.isDisabled()) {
177
- this._checkbox.checked = !this._checked, this._checked = this._checkbox.checked, this._checked ? this.hasAttribute("checked") || this.setAttribute("checked", "") : this.hasAttribute("checked") && this.removeAttribute("checked"), this.updateVisualState();
178
- let e = new CustomEvent("change", {
179
- detail: { checked: this._checked },
180
- bubbles: !0,
181
- cancelable: !0
182
- });
183
- this.dispatchEvent(e);
184
- }
185
- }
186
- };
187
- typeof customElements < "u" && !customElements.get("mint-checkbox") && t("mint-checkbox", n);
188
- //#endregion
189
- export { n as default };
4
+ import { t as e } from "../chunks/checkbox-p-Fb5ojp.js";
5
+ export { e as default };
@@ -13,5 +13,5 @@ const __mintLoadStyle = (key, url) => {
13
13
  __mintLoadStyle('theme', '../../theme.css')
14
14
  __mintLoadStyle('icon', '../../icon.css')
15
15
  __mintLoadStyle('chip', '../../chip.css')
16
- import { t as e } from "../chunks/chip-XuYPtZ3Z.js";
16
+ import { t as e } from "../chunks/chip-bcCOd6-h.js";
17
17
  export { e as default };
@@ -1 +1 @@
1
- const e=require(`../chunks/chip-BUaS7ks-.js`);module.exports=e.t;
1
+ const e=require(`../chunks/chip-B0kg_vr8.js`);module.exports=e.t;
@@ -1,5 +1,5 @@
1
1
  import '../../theme.css'
2
2
  import '../../icon.css'
3
3
  import '../../chip.css'
4
- import { t as e } from "../chunks/chip-XuYPtZ3Z.js";
4
+ import { t as e } from "../chunks/chip-bcCOd6-h.js";
5
5
  export { e as default };
@@ -1,6 +1,6 @@
1
- import { a as e } from "./icon-hyFz3uhh.js";
1
+ import { a as e } from "./icon-DAB2KLeo.js";
2
2
  import { t } from "./register-element-BFYmIynH.js";
3
- import "./icon-l34kRIZg.js";
3
+ import "./icon-CIAsmizQ.js";
4
4
  /* empty css */
5
5
  import "./spinner-B2sml0AG.js";
6
6
  e({
@@ -1 +1 @@
1
- const e=require(`./icon-CWOP4Com.js`),t=require(`./register-element-tCL_F1YI.js`);require(`./icon-D6C1XGp2.js`),/* empty css */require(`./spinner-CUcCgLKS.js`),e.a({name:`arrow-left`,viewBox:`0 0 24 24`,path:`M19 12H5m7-7l-7 7 7 7`,strokeLinecap:`round`,strokeLinejoin:`round`});var n=class extends HTMLElement{static get observedAttributes(){return[`variant`,`tone`,`disabled`,`loading`,`button-type`,`type`,`full-width`,`icon-position`,`icon`]}constructor(){super(),this._button=null,this._clickHandler=null,this._isHandlingClick=!1}connectedCallback(){this.render(),this._button&&this.setupEventListeners()}disconnectedCallback(){this.removeEventListeners()}attributeChangedCallback(e,t,n){t!==n&&this.render()}getVariant(){return this.getAttribute(`variant`)||`solid`}getTone(){return this.getAttribute(`tone`)||`neutral`}isDisabled(){return this.hasAttribute(`disabled`)}isLoading(){return this.hasAttribute(`loading`)}getType(){return(this.getAttribute(`type`)||this.getAttribute(`button-type`)||`default`)===`submit`?`submit`:`button`}isFullWidth(){return this.hasAttribute(`full-width`)}getIconPosition(){return this.getAttribute(`icon-position`)||`left`}getIcon(){return this.getAttribute(`icon`)||``}isIconOnly(){if(!(this.getIcon()||this._button?.querySelector(`[slot="icon"], .mint-button-icon, mint-icon`)))return!1;let e=this._button?.querySelector(`.mint-button-content`);if(e&&e.textContent.trim())return!1;if(this._button){for(let e=this._button.firstChild;e;e=e.nextSibling)if(e.nodeType===Node.TEXT_NODE&&e.textContent.trim()||e.nodeType===Node.ELEMENT_NODE&&e.tagName!==`MINT-ICON`&&e.tagName!==`MINT-SPINNER`&&!e.querySelector?.(`mint-spinner`)&&!e.hasAttribute?.(`slot`)&&e.className!==`mint-button-icon`&&!(e.className===`mr-2`&&e.querySelector(`mint-spinner`))&&e.textContent.trim())return!1}return!0}getButtonClasses(){return[`mint-button-core`,`mint-button-`+this.getVariant(),`mint-button-tone-`+this.getTone(),this.isIconOnly()?`mint-button-icon-only`:``,this.isFullWidth()?`mint-button-full-width`:``].filter(Boolean).join(` `)}render(){let e=this.isDisabled()||this.isLoading(),t=this.getType();if(!this._button){for(this._button=document.createElement(`button`);this.firstChild;)this._button.appendChild(this.firstChild);this.appendChild(this._button),this.setupEventListeners()}this._button.type=t,this._button.disabled=e;let n=this._button.querySelector(`mint-spinner`);if(this.isLoading())if(n)n.setAttribute(`data-button-variant`,this.getVariant()),n.setAttribute(`data-button-tone`,this.getTone()),n.render();else{let e=document.createElement(`span`);e.className=`mint-button-spinner-wrap`;let t=document.createElement(`mint-spinner`);t.setAttribute(`size`,`default`),t.setAttribute(`data-button-variant`,this.getVariant()),t.setAttribute(`data-button-tone`,this.getTone()),t.style.width=`1em`,t.style.height=`1em`,e.appendChild(t),this._button.insertBefore(e,this._button.firstChild)}else n&&n.parentElement?.remove();for(;this.firstChild&&this.firstChild!==this._button;)this._button.appendChild(this.firstChild);let r=this.getIcon(),i=this._button.querySelector(`[slot="icon"], .mint-button-icon, mint-icon`);r?(i&&i.tagName!==`MINT-ICON`&&(i.remove(),i=null),!i||i.tagName!==`MINT-ICON`?(i=document.createElement(`mint-icon`),i.setAttribute(`name`,r),i.className=`mint-button-icon`):i.setAttribute(`name`,r)):i&&i.tagName===`MINT-ICON`&&(i.remove(),i=null),i||=this._button.querySelector(`[slot="icon"], .mint-button-icon`);let a=this.getIconPosition(),o=this._button.querySelector(`.mint-button-content`);if(o){let e=i&&i.tagName===`MINT-ICON`;if(i&&!i.parentElement){let t=this._button.querySelector(`mint-spinner`)?.parentElement;e||a===`left`?t?t.insertAdjacentElement(`afterend`,i):this._button.insertBefore(i,o):o.insertAdjacentElement(`afterend`,i)}else if(i&&(e||a===`left`)&&i.nextSibling!==o){i.remove();let e=this._button.querySelector(`mint-spinner`)?.parentElement;e?e.insertAdjacentElement(`afterend`,i):this._button.insertBefore(i,o)}else i&&!e&&a===`right`&&i.previousSibling!==o&&(i.remove(),o.insertAdjacentElement(`afterend`,i))}else{let e=[];for(let t=this._button.firstChild;t;t=t.nextSibling)t.tagName!==`MINT-SPINNER`&&!t.querySelector?.(`mint-spinner`)&&t!==i&&!t.hasAttribute?.(`slot`)&&!(t.className===`mr-2`&&t.querySelector(`mint-spinner`))&&e.push(t);if(e.length>0){o=document.createElement(`span`),o.className=`mint-button-content`,e.forEach(e=>{o.appendChild(e)});let t=this._button.querySelector(`mint-spinner`)?.parentElement;i&&a===`left`?t?(t.insertAdjacentElement(`afterend`,i),i.insertAdjacentElement(`afterend`,o)):(this._button.insertBefore(i,this._button.firstChild),i.insertAdjacentElement(`afterend`,o)):i&&a===`right`?t?(t.insertAdjacentElement(`afterend`,o),o.insertAdjacentElement(`afterend`,i)):(this._button.insertBefore(o,this._button.firstChild),o.insertAdjacentElement(`afterend`,i)):t?t.insertAdjacentElement(`afterend`,o):this._button.insertBefore(o,this._button.firstChild)}else if(i&&i.tagName===`MINT-ICON`&&!i.parentElement){let e=this._button.querySelector(`mint-spinner`)?.parentElement;e?e.insertAdjacentElement(`afterend`,i):this._button.insertBefore(i,this._button.firstChild)}}let s=this._button.querySelector(`.mint-button-spinner-wrap`);if(i&&(i.style.display=this.isLoading()?`none`:``,this.isLoading()&&s)){s.setAttribute(`data-position`,a);let e=window.getComputedStyle(i),t=e.width,n=e.height;if(t!==`auto`&&t!==`0px`){s.style.width=t,s.style.flexBasis=t;let e=s.querySelector(`mint-spinner`);e&&(e.style.width=t)}if(n!==`auto`&&n!==`0px`){s.style.height=n;let e=s.querySelector(`mint-spinner`);e&&(e.style.height=n)}i.parentElement===this._button&&i.insertAdjacentElement(`beforebegin`,s)}let c=this.isIconOnly();this.isLoading()&&s&&(s.setAttribute(`data-position`,a),c?s.setAttribute(`data-icon-only`,`true`):s.removeAttribute(`data-icon-only`)),i&&(i.classList.contains(`mint-button-icon`)||i.classList.add(`mint-button-icon`),i.classList.remove(`mint-icon-leading`,`mint-icon-trailing`),c?i.tagName===`MINT-ICON`?(i.style.width=`1rem`,i.style.height=`1rem`,i.style.maxWidth=`1rem`,i.style.maxHeight=`1rem`,i.style.flexShrink=`0`):(i.style.maxWidth=`1rem`,i.style.maxHeight=`1rem`,i.style.flexShrink=`0`,i.tagName===`svg`&&(i.style.width=`1rem`,i.style.height=`1rem`)):a===`left`?i.classList.add(`mint-icon-leading`):i.classList.add(`mint-icon-trailing`));let l=this.getButtonClasses();this._button.className=l}setupEventListeners(){this._button&&!this._clickHandler&&(this._clickHandler=this.handleClick.bind(this),this._button.addEventListener(`click`,this._clickHandler,!0),this._button.addEventListener(`mousedown`,this._handleMouseDown),this._button.addEventListener(`mouseup`,this._handleMouseUp),this._button.addEventListener(`mouseleave`,this._handleMouseLeave),this._button.addEventListener(`touchstart`,this._handleTouchStart),this._button.addEventListener(`touchend`,this._handleTouchEnd),this._button.addEventListener(`touchcancel`,this._handleTouchCancel))}removeEventListeners(){this._button&&(this._clickHandler&&=(this._button.removeEventListener(`click`,this._clickHandler,!0),null),this._button.removeEventListener(`mousedown`,this._handleMouseDown),this._button.removeEventListener(`mouseup`,this._handleMouseUp),this._button.removeEventListener(`mouseleave`,this._handleMouseLeave),this._button.removeEventListener(`touchstart`,this._handleTouchStart),this._button.removeEventListener(`touchend`,this._handleTouchEnd),this._button.removeEventListener(`touchcancel`,this._handleTouchCancel))}_handleMouseDown=()=>{this._button&&!this.isDisabled()&&!this.isLoading()&&this._button.classList.add(`mint-button-active`)};_handleMouseUp=()=>{this._button&&this._button.classList.remove(`mint-button-active`)};_handleMouseLeave=()=>{this._button&&this._button.classList.remove(`mint-button-active`)};_handleTouchStart=()=>{this._button&&!this.isDisabled()&&!this.isLoading()&&this._button.classList.add(`mint-button-active`)};_handleTouchEnd=()=>{this._button&&this._button.classList.remove(`mint-button-active`)};_handleTouchCancel=()=>{this._button&&this._button.classList.remove(`mint-button-active`)};handleClick(e){if(this.isDisabled()||this.isLoading()){e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation();return}if(e.stopPropagation(),e.stopImmediatePropagation(),this._isHandlingClick){e.preventDefault();return}this._isHandlingClick=!0,e.preventDefault(),this.dispatchEvent(new CustomEvent(`click`,{detail:{originalEvent:e},bubbles:!0,cancelable:!0,composed:!0})),requestAnimationFrame(()=>{this._isHandlingClick=!1})}};typeof customElements<`u`&&!customElements.get(`mint-button`)&&t.t(`mint-button`,n);var r=class extends HTMLElement{static get observedAttributes(){return[`href`,`fallback-href`]}constructor(){super(),this._historyDepth=0,this._maxBackAttempts=10,this._backAttempts=0}connectedCallback(){this.render(),this._setupHistoryTracking()}attributeChangedCallback(e,t,n){t!==n&&this.render()}_setupHistoryTracking(){window.addEventListener(`popstate`,()=>{this._backAttempts=0}),this._historyDepth=window.history.length}getFallbackHref(){return this.getAttribute(`fallback-href`)||this.getAttribute(`href`)||`/`}handleClick(e){if(e.preventDefault(),e.stopPropagation(),window.history.length>1&&this._backAttempts<this._maxBackAttempts&&this._backAttempts===0){this._backAttempts++;let e=window.location.href,t=Date.now();window.history.back(),setTimeout(()=>{Date.now()-t,window.location.href===e?this._navigateToFallback():setTimeout(()=>{this._backAttempts=0},500)},200)}else this._navigateToFallback()}_navigateToFallback(){let e=this.getFallbackHref();if(this._backAttempts=0,e.startsWith(`/`)&&!e.startsWith(`//`))try{window.history.pushState({},``,e),window.dispatchEvent(new PopStateEvent(`popstate`));return}catch{}window.location.href=e}render(){this._button||(this._button=document.createElement(`mint-button`),this._button.setAttribute(`variant`,`solid`),this._button.setAttribute(`tone`,`neutral`),this._button.setAttribute(`icon`,`arrow-left`),this._button.setAttribute(`aria-label`,this.getAttribute(`aria-label`)||`Go back`),this._button.addEventListener(`click`,e=>this.handleClick(e)),this.appendChild(this._button))}};typeof customElements<`u`&&!customElements.get(`mint-back-button`)&&t.t(`mint-back-button`,r),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return r}});
1
+ const e=require(`./icon-B9P0jyS2.js`),t=require(`./register-element-tCL_F1YI.js`);require(`./icon-Cia9x_J2.js`),/* empty css */require(`./spinner-CUcCgLKS.js`),e.a({name:`arrow-left`,viewBox:`0 0 24 24`,path:`M19 12H5m7-7l-7 7 7 7`,strokeLinecap:`round`,strokeLinejoin:`round`});var n=class extends HTMLElement{static get observedAttributes(){return[`variant`,`tone`,`disabled`,`loading`,`button-type`,`type`,`full-width`,`icon-position`,`icon`]}constructor(){super(),this._button=null,this._clickHandler=null,this._isHandlingClick=!1}connectedCallback(){this.render(),this._button&&this.setupEventListeners()}disconnectedCallback(){this.removeEventListeners()}attributeChangedCallback(e,t,n){t!==n&&this.render()}getVariant(){return this.getAttribute(`variant`)||`solid`}getTone(){return this.getAttribute(`tone`)||`neutral`}isDisabled(){return this.hasAttribute(`disabled`)}isLoading(){return this.hasAttribute(`loading`)}getType(){return(this.getAttribute(`type`)||this.getAttribute(`button-type`)||`default`)===`submit`?`submit`:`button`}isFullWidth(){return this.hasAttribute(`full-width`)}getIconPosition(){return this.getAttribute(`icon-position`)||`left`}getIcon(){return this.getAttribute(`icon`)||``}isIconOnly(){if(!(this.getIcon()||this._button?.querySelector(`[slot="icon"], .mint-button-icon, mint-icon`)))return!1;let e=this._button?.querySelector(`.mint-button-content`);if(e&&e.textContent.trim())return!1;if(this._button){for(let e=this._button.firstChild;e;e=e.nextSibling)if(e.nodeType===Node.TEXT_NODE&&e.textContent.trim()||e.nodeType===Node.ELEMENT_NODE&&e.tagName!==`MINT-ICON`&&e.tagName!==`MINT-SPINNER`&&!e.querySelector?.(`mint-spinner`)&&!e.hasAttribute?.(`slot`)&&e.className!==`mint-button-icon`&&!(e.className===`mr-2`&&e.querySelector(`mint-spinner`))&&e.textContent.trim())return!1}return!0}getButtonClasses(){return[`mint-button-core`,`mint-button-`+this.getVariant(),`mint-button-tone-`+this.getTone(),this.isIconOnly()?`mint-button-icon-only`:``,this.isFullWidth()?`mint-button-full-width`:``].filter(Boolean).join(` `)}render(){let e=this.isDisabled()||this.isLoading(),t=this.getType();if(!this._button){for(this._button=document.createElement(`button`);this.firstChild;)this._button.appendChild(this.firstChild);this.appendChild(this._button),this.setupEventListeners()}this._button.type=t,this._button.disabled=e;let n=this._button.querySelector(`mint-spinner`);if(this.isLoading())if(n)n.setAttribute(`data-button-variant`,this.getVariant()),n.setAttribute(`data-button-tone`,this.getTone()),n.render();else{let e=document.createElement(`span`);e.className=`mint-button-spinner-wrap`;let t=document.createElement(`mint-spinner`);t.setAttribute(`size`,`default`),t.setAttribute(`data-button-variant`,this.getVariant()),t.setAttribute(`data-button-tone`,this.getTone()),t.style.width=`1em`,t.style.height=`1em`,e.appendChild(t),this._button.insertBefore(e,this._button.firstChild)}else n&&n.parentElement?.remove();for(;this.firstChild&&this.firstChild!==this._button;)this._button.appendChild(this.firstChild);let r=this.getIcon(),i=this._button.querySelector(`[slot="icon"], .mint-button-icon, mint-icon`);r?(i&&i.tagName!==`MINT-ICON`&&(i.remove(),i=null),!i||i.tagName!==`MINT-ICON`?(i=document.createElement(`mint-icon`),i.setAttribute(`name`,r),i.className=`mint-button-icon`):i.setAttribute(`name`,r)):i&&i.tagName===`MINT-ICON`&&(i.remove(),i=null),i||=this._button.querySelector(`[slot="icon"], .mint-button-icon`);let a=this.getIconPosition(),o=this._button.querySelector(`.mint-button-content`);if(o){let e=i&&i.tagName===`MINT-ICON`;if(i&&!i.parentElement){let t=this._button.querySelector(`mint-spinner`)?.parentElement;e||a===`left`?t?t.insertAdjacentElement(`afterend`,i):this._button.insertBefore(i,o):o.insertAdjacentElement(`afterend`,i)}else if(i&&(e||a===`left`)&&i.nextSibling!==o){i.remove();let e=this._button.querySelector(`mint-spinner`)?.parentElement;e?e.insertAdjacentElement(`afterend`,i):this._button.insertBefore(i,o)}else i&&!e&&a===`right`&&i.previousSibling!==o&&(i.remove(),o.insertAdjacentElement(`afterend`,i))}else{let e=[];for(let t=this._button.firstChild;t;t=t.nextSibling)t.tagName!==`MINT-SPINNER`&&!t.querySelector?.(`mint-spinner`)&&t!==i&&!t.hasAttribute?.(`slot`)&&!(t.className===`mr-2`&&t.querySelector(`mint-spinner`))&&e.push(t);if(e.length>0){o=document.createElement(`span`),o.className=`mint-button-content`,e.forEach(e=>{o.appendChild(e)});let t=this._button.querySelector(`mint-spinner`)?.parentElement;i&&a===`left`?t?(t.insertAdjacentElement(`afterend`,i),i.insertAdjacentElement(`afterend`,o)):(this._button.insertBefore(i,this._button.firstChild),i.insertAdjacentElement(`afterend`,o)):i&&a===`right`?t?(t.insertAdjacentElement(`afterend`,o),o.insertAdjacentElement(`afterend`,i)):(this._button.insertBefore(o,this._button.firstChild),o.insertAdjacentElement(`afterend`,i)):t?t.insertAdjacentElement(`afterend`,o):this._button.insertBefore(o,this._button.firstChild)}else if(i&&i.tagName===`MINT-ICON`&&!i.parentElement){let e=this._button.querySelector(`mint-spinner`)?.parentElement;e?e.insertAdjacentElement(`afterend`,i):this._button.insertBefore(i,this._button.firstChild)}}let s=this._button.querySelector(`.mint-button-spinner-wrap`);if(i&&(i.style.display=this.isLoading()?`none`:``,this.isLoading()&&s)){s.setAttribute(`data-position`,a);let e=window.getComputedStyle(i),t=e.width,n=e.height;if(t!==`auto`&&t!==`0px`){s.style.width=t,s.style.flexBasis=t;let e=s.querySelector(`mint-spinner`);e&&(e.style.width=t)}if(n!==`auto`&&n!==`0px`){s.style.height=n;let e=s.querySelector(`mint-spinner`);e&&(e.style.height=n)}i.parentElement===this._button&&i.insertAdjacentElement(`beforebegin`,s)}let c=this.isIconOnly();this.isLoading()&&s&&(s.setAttribute(`data-position`,a),c?s.setAttribute(`data-icon-only`,`true`):s.removeAttribute(`data-icon-only`)),i&&(i.classList.contains(`mint-button-icon`)||i.classList.add(`mint-button-icon`),i.classList.remove(`mint-icon-leading`,`mint-icon-trailing`),c?i.tagName===`MINT-ICON`?(i.style.width=`1rem`,i.style.height=`1rem`,i.style.maxWidth=`1rem`,i.style.maxHeight=`1rem`,i.style.flexShrink=`0`):(i.style.maxWidth=`1rem`,i.style.maxHeight=`1rem`,i.style.flexShrink=`0`,i.tagName===`svg`&&(i.style.width=`1rem`,i.style.height=`1rem`)):a===`left`?i.classList.add(`mint-icon-leading`):i.classList.add(`mint-icon-trailing`));let l=this.getButtonClasses();this._button.className=l}setupEventListeners(){this._button&&!this._clickHandler&&(this._clickHandler=this.handleClick.bind(this),this._button.addEventListener(`click`,this._clickHandler,!0),this._button.addEventListener(`mousedown`,this._handleMouseDown),this._button.addEventListener(`mouseup`,this._handleMouseUp),this._button.addEventListener(`mouseleave`,this._handleMouseLeave),this._button.addEventListener(`touchstart`,this._handleTouchStart),this._button.addEventListener(`touchend`,this._handleTouchEnd),this._button.addEventListener(`touchcancel`,this._handleTouchCancel))}removeEventListeners(){this._button&&(this._clickHandler&&=(this._button.removeEventListener(`click`,this._clickHandler,!0),null),this._button.removeEventListener(`mousedown`,this._handleMouseDown),this._button.removeEventListener(`mouseup`,this._handleMouseUp),this._button.removeEventListener(`mouseleave`,this._handleMouseLeave),this._button.removeEventListener(`touchstart`,this._handleTouchStart),this._button.removeEventListener(`touchend`,this._handleTouchEnd),this._button.removeEventListener(`touchcancel`,this._handleTouchCancel))}_handleMouseDown=()=>{this._button&&!this.isDisabled()&&!this.isLoading()&&this._button.classList.add(`mint-button-active`)};_handleMouseUp=()=>{this._button&&this._button.classList.remove(`mint-button-active`)};_handleMouseLeave=()=>{this._button&&this._button.classList.remove(`mint-button-active`)};_handleTouchStart=()=>{this._button&&!this.isDisabled()&&!this.isLoading()&&this._button.classList.add(`mint-button-active`)};_handleTouchEnd=()=>{this._button&&this._button.classList.remove(`mint-button-active`)};_handleTouchCancel=()=>{this._button&&this._button.classList.remove(`mint-button-active`)};handleClick(e){if(this.isDisabled()||this.isLoading()){e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation();return}if(e.stopPropagation(),e.stopImmediatePropagation(),this._isHandlingClick){e.preventDefault();return}this._isHandlingClick=!0,e.preventDefault(),this.dispatchEvent(new CustomEvent(`click`,{detail:{originalEvent:e},bubbles:!0,cancelable:!0,composed:!0})),requestAnimationFrame(()=>{this._isHandlingClick=!1})}};typeof customElements<`u`&&!customElements.get(`mint-button`)&&t.t(`mint-button`,n);var r=class extends HTMLElement{static get observedAttributes(){return[`href`,`fallback-href`]}constructor(){super(),this._historyDepth=0,this._maxBackAttempts=10,this._backAttempts=0}connectedCallback(){this.render(),this._setupHistoryTracking()}attributeChangedCallback(e,t,n){t!==n&&this.render()}_setupHistoryTracking(){window.addEventListener(`popstate`,()=>{this._backAttempts=0}),this._historyDepth=window.history.length}getFallbackHref(){return this.getAttribute(`fallback-href`)||this.getAttribute(`href`)||`/`}handleClick(e){if(e.preventDefault(),e.stopPropagation(),window.history.length>1&&this._backAttempts<this._maxBackAttempts&&this._backAttempts===0){this._backAttempts++;let e=window.location.href,t=Date.now();window.history.back(),setTimeout(()=>{Date.now()-t,window.location.href===e?this._navigateToFallback():setTimeout(()=>{this._backAttempts=0},500)},200)}else this._navigateToFallback()}_navigateToFallback(){let e=this.getFallbackHref();if(this._backAttempts=0,e.startsWith(`/`)&&!e.startsWith(`//`))try{window.history.pushState({},``,e),window.dispatchEvent(new PopStateEvent(`popstate`));return}catch{}window.location.href=e}render(){this._button||(this._button=document.createElement(`mint-button`),this._button.setAttribute(`variant`,`solid`),this._button.setAttribute(`tone`,`neutral`),this._button.setAttribute(`icon`,`arrow-left`),this._button.setAttribute(`aria-label`,this.getAttribute(`aria-label`)||`Go back`),this._button.addEventListener(`click`,e=>this.handleClick(e)),this.appendChild(this._button))}};typeof customElements<`u`&&!customElements.get(`mint-back-button`)&&t.t(`mint-back-button`,r),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return r}});
@@ -1 +1 @@
1
- require(`./icon-CWOP4Com.js`);const e=require(`./register-element-tCL_F1YI.js`);require(`./icon-D6C1XGp2.js`),/* empty css */require(`./spinner-CUcCgLKS.js`);var t=class extends HTMLElement{static get observedAttributes(){return[`variant`,`tone`,`disabled`,`loading`,`button-type`,`type`,`full-width`,`icon-position`,`icon`,`active`,`align`,`aria-label`]}constructor(){super(),this._button=null,this._clickHandler=null,this._isHandlingClick=!1,this._mousePressed=!1,this._hostChildObserver=null,this._hostRenderFromObserverRaf=null,this._handleMouseDown=()=>{this._button&&!this.isDisabled()&&!this.isLoading()&&(this._button.classList.add(`mint-button-active`),this._mousePressed||(this._mousePressed=!0,document.addEventListener(`mouseup`,this._handleMouseUp),window.addEventListener(`blur`,this._handleMouseCancel)))},this._handleMouseUp=()=>{this._clearMousePressedState()},this._handleMouseCancel=()=>{this._clearMousePressedState()},this._handleTouchStart=()=>{this._button&&!this.isDisabled()&&!this.isLoading()&&this._button.classList.add(`mint-button-active`)},this._handleTouchEnd=()=>{this._button&&(this.isActive()||this._button.classList.remove(`mint-button-active`))},this._handleTouchCancel=()=>{this._button&&(this.isActive()||this._button.classList.remove(`mint-button-active`))}}_getGeneratedIcon(){return this._button?this._button.querySelector(`:scope > [data-generated-icon="true"]`):null}_getContentWrapperClass(e){return`mint-button-content`}connectedCallback(){this.render(),this._button&&this.setupEventListeners()}disconnectedCallback(){this._disconnectHostChildObserver(),this._hostRenderFromObserverRaf!==null&&(cancelAnimationFrame(this._hostRenderFromObserverRaf),this._hostRenderFromObserverRaf=null),this.removeEventListeners(),this._clearMousePressedState()}attributeChangedCallback(e,t,n){t!==n&&this.render()}getVariant(){let e=this.getAttribute(`variant`);return e===`ghost`||e===`outline`?e:`solid`}getTone(){return this.getAttribute(`tone`)||`neutral`}isDisabled(){return this.getAttribute(`disabled`)===`true`}isLoading(){return this.getAttribute(`loading`)===`true`}getType(){let e=this.getAttribute(`type`),t=this.getAttribute(`button-type`);return(e||t||`default`)===`submit`?`submit`:`button`}isFullWidth(){return this.getAttribute(`full-width`)===`true`}isActive(){return this.getAttribute(`active`)===`true`}get active(){return this.isActive()}set active(e){e?this.setAttribute(`active`,`true`):this.removeAttribute(`active`)}getIconPosition(){return this.getAttribute(`icon-position`)||`left`}getIcon(){return this.getAttribute(`icon`)||``}getAlignment(){let e=this.getAttribute(`align`);return e===`left`||e===`center`||e===`right`?e:`center`}isIconOnly(){if(!(this.getIcon()||this._getGeneratedIcon()||this._button?.querySelector(`mint-icon`)))return!1;let e=this._button?.querySelector(`.mint-button-content`);if(e&&e.textContent?.trim())return!1;if(this._button)for(let e=this._button.firstChild;e;e=e.nextSibling){if(e.nodeType===Node.TEXT_NODE&&e.textContent?.trim())return!1;if(e.nodeType===Node.ELEMENT_NODE){let t=e;if(t.tagName!==`MINT-ICON`&&t.tagName!==`MINT-SPINNER`&&!t.querySelector(`mint-spinner`)&&!t.hasAttribute(`slot`)&&t.className!==`mint-button-icon`&&!(t.classList.contains(`mint-button-spinner-wrap`)&&t.querySelector(`mint-spinner`))&&t.textContent?.trim())return!1}}return!0}getActiveStateClasses(){let e=`${this.getVariant()}-${this.getTone()}`;return{"solid-action":[`!bg-neutral-900`,`dark:!bg-neutral-700`,`hover:!bg-neutral-900`,`dark:hover:!bg-neutral-700`,`!border-t-neutral-900`,`!border-l-neutral-900`,`!border-r-neutral-600`,`!border-b-neutral-600`,`dark:!border-t-neutral-700`,`dark:!border-l-neutral-700`,`dark:!border-r-neutral-500`,`dark:!border-b-neutral-500`],"solid-neutral":[`!bg-gray-100`,`dark:!bg-mint-hover`,`hover:!bg-gray-100`,`dark:hover:!bg-mint-hover`,`!border-t-gray-400`,`!border-l-gray-400`,`!border-r-gray-200`,`!border-b-gray-200`,`dark:!border-t-gray-950`,`dark:!border-l-gray-950`,`dark:!border-r-mint-divider`,`dark:!border-b-mint-divider`],"solid-info":[`!bg-blue-900`,`dark:!bg-blue-700`,`hover:!bg-blue-900`,`dark:hover:!bg-blue-700`,`!border-t-blue-900`,`!border-l-blue-900`,`!border-r-blue-600`,`!border-b-blue-600`,`dark:!border-t-blue-700`,`dark:!border-l-blue-700`,`dark:!border-r-blue-500`,`dark:!border-b-blue-500`],"solid-warning":[`!bg-amber-900`,`dark:!bg-amber-700`,`hover:!bg-amber-900`,`dark:hover:!bg-amber-700`,`!border-t-amber-900`,`!border-l-amber-900`,`!border-r-amber-600`,`!border-b-amber-600`,`dark:!border-t-amber-700`,`dark:!border-l-amber-700`,`dark:!border-r-amber-500`,`dark:!border-b-amber-500`],"solid-danger":[`!bg-red-900`,`dark:!bg-red-700`,`hover:!bg-red-900`,`dark:hover:!bg-red-700`,`!border-t-red-900`,`!border-l-red-900`,`!border-r-red-600`,`!border-b-red-600`,`dark:!border-t-red-700`,`dark:!border-l-red-700`,`dark:!border-r-red-500`,`dark:!border-b-red-500`],"ghost-action":[`!bg-gray-100`,`!shadow-[inset_0_2px_4px_rgba(0,0,0,0.1)]`,`dark:!bg-mint-hover`,`hover:!bg-gray-100`,`dark:hover:!bg-mint-hover`,`hover:!shadow-[inset_0_2px_4px_rgba(0,0,0,0.1)]`],"ghost-neutral":[`!bg-gray-50`,`!shadow-[inset_0_2px_4px_rgba(0,0,0,0.1)]`,`dark:!bg-mint-hover`,`!text-gray-900`,`dark:!text-white`,`hover:!bg-gray-50`,`dark:hover:!bg-mint-hover`,`hover:!shadow-[inset_0_2px_4px_rgba(0,0,0,0.1)]`,`hover:!text-gray-900`,`dark:hover:!text-white`],"ghost-info":[`!bg-gray-100`,`!shadow-[inset_0_2px_4px_rgba(0,0,0,0.1)]`,`dark:!bg-mint-hover`,`hover:!bg-gray-100`,`dark:hover:!bg-mint-hover`,`hover:!shadow-[inset_0_2px_4px_rgba(0,0,0,0.1)]`],"ghost-warning":[`!bg-gray-100`,`!shadow-[inset_0_2px_4px_rgba(0,0,0,0.1)]`,`dark:!bg-mint-hover`,`hover:!bg-gray-100`,`dark:hover:!bg-mint-hover`,`hover:!shadow-[inset_0_2px_4px_rgba(0,0,0,0.1)]`],"ghost-danger":[`!bg-gray-100`,`!shadow-[inset_0_2px_4px_rgba(0,0,0,0.1)]`,`dark:!bg-mint-hover`,`hover:!bg-gray-100`,`dark:hover:!bg-mint-hover`,`hover:!shadow-[inset_0_2px_4px_rgba(0,0,0,0.1)]`]}[e]||[]}_disconnectHostChildObserver(){this._hostChildObserver?.disconnect()}_connectHostChildObserver(){this.isConnected&&(this._hostChildObserver||=new MutationObserver(e=>{this._onLightDomMutation(e)}),this._hostChildObserver.disconnect(),this._hostChildObserver.observe(this,{childList:!0,subtree:!0,characterData:!0}))}_onLightDomMutation(e){if(this.isConnected){if(this._button&&!this._button.isConnected){this._button=null,this._scheduleRenderFromHostObserver();return}for(let t of e){let e=t.target;if(!(this._button&&(e===this._button||this._button.contains(e)))){this._scheduleRenderFromHostObserver();return}}}}_scheduleRenderFromHostObserver(){this._hostRenderFromObserverRaf===null&&(this._hostRenderFromObserverRaf=requestAnimationFrame(()=>{this._hostRenderFromObserverRaf=null,this.isConnected&&this.render()}))}getButtonClasses(){let e=[`mint-button-core`,`mint-button-${this.getVariant()}`,`mint-button-tone-${this.getTone()}`];return this.isIconOnly()&&e.push(`mint-button-icon-only`),this.isFullWidth()&&e.push(`mint-button-full-width`),e.join(` `)}render(){this._disconnectHostChildObserver(),this._button&&!this._button.isConnected&&(this._button=null);try{let e=this.isLoading(),t=this.isDisabled()||e,n=this.getType();if(!this._button){let e=this.firstElementChild;if(e instanceof HTMLButtonElement)this._button=e;else{for(this._button=document.createElement(`button`);this.firstChild;)this._button.appendChild(this.firstChild);this.appendChild(this._button)}this.setupEventListeners()}this._button.type=n,this._button.disabled=t,this._button.setAttribute(`aria-busy`,String(e));let r=this._button.querySelector(`mint-spinner`);if(e)if(r)r.setAttribute(`data-button-variant`,this.getVariant()),r.setAttribute(`data-button-tone`,this.getTone()),`render`in r&&typeof r.render==`function`&&r.render();else{let e=document.createElement(`span`);e.className=`mint-button-spinner-wrap`;let t=document.createElement(`mint-spinner`);t.setAttribute(`size`,`default`),t.setAttribute(`data-button-variant`,this.getVariant()),t.setAttribute(`data-button-tone`,this.getTone()),t.style.width=`1em`,t.style.height=`1em`,e.appendChild(t),this._button.insertBefore(e,this._button.firstChild)}else r&&r.parentElement?.remove();for(;this.firstChild&&this.firstChild!==this._button;)this._button.appendChild(this.firstChild);let i=this.getIcon(),a=this._getGeneratedIcon();i?(a||(a=document.createElement(`mint-icon`),a.setAttribute(`data-generated-icon`,`true`),a.className=`mint-button-icon`),a.setAttribute(`name`,i)):a&&a.tagName===`MINT-ICON`&&(a.remove(),a=null);let o=this.getIconPosition(),s=this._button.querySelector(`.mint-button-content`);if(s){s.className=this._getContentWrapperClass(s);let e=a&&a.tagName===`MINT-ICON`;if(a&&!a.parentElement){let t=this._button.querySelector(`mint-spinner`)?.parentElement;e||o===`left`?t?t.insertAdjacentElement(`afterend`,a):this._button.insertBefore(a,s):s.insertAdjacentElement(`afterend`,a)}else if(a&&(e||o===`left`)&&a.nextSibling!==s){a.remove();let e=this._button.querySelector(`mint-spinner`)?.parentElement;e?e.insertAdjacentElement(`afterend`,a):this._button.insertBefore(a,s)}else a&&!e&&o===`right`&&a.previousSibling!==s&&(a.remove(),s.insertAdjacentElement(`afterend`,a))}else{let e=[];for(let t=this._button.firstChild;t;t=t.nextSibling){if(t.nodeType!==Node.ELEMENT_NODE){e.push(t);continue}let n=t;n.tagName!==`MINT-SPINNER`&&!n.querySelector(`mint-spinner`)&&t!==a&&!n.hasAttribute(`slot`)&&!(n.classList.contains(`mint-button-spinner-wrap`)&&n.querySelector(`mint-spinner`))&&e.push(t)}if(e.length>0){s=document.createElement(`span`),s.className=this._getContentWrapperClass(s),e.forEach(e=>{s.appendChild(e)}),s.className=this._getContentWrapperClass(s);let t=this._button.querySelector(`mint-spinner`)?.parentElement;a&&o===`left`?t?(t.insertAdjacentElement(`afterend`,a),a.insertAdjacentElement(`afterend`,s)):(this._button.insertBefore(a,this._button.firstChild),a.insertAdjacentElement(`afterend`,s)):a&&o===`right`?t?(t.insertAdjacentElement(`afterend`,s),s.insertAdjacentElement(`afterend`,a)):(this._button.insertBefore(s,this._button.firstChild),s.insertAdjacentElement(`afterend`,a)):t?t.insertAdjacentElement(`afterend`,s):this._button.insertBefore(s,this._button.firstChild)}else if(a&&a.tagName===`MINT-ICON`&&!a.parentElement){let e=this._button.querySelector(`mint-spinner`)?.parentElement;e?e.insertAdjacentElement(`afterend`,a):this._button.insertBefore(a,this._button.firstChild)}}let c=this.isIconOnly();a&&(a.classList.contains(`mint-button-icon`)||a.classList.add(`mint-button-icon`),e?a.style.display=`none`:a.style.display=``,a.setAttribute(`data-position`,o),a.toggleAttribute(`data-icon-only`,c),c&&(a.tagName===`MINT-ICON`?(a.style.width=`1em`,a.style.height=`1em`,a.style.maxWidth=`1em`,a.style.maxHeight=`1em`,a.style.flexShrink=`0`):(a.style.maxWidth=`1em`,a.style.maxHeight=`1em`,a.style.flexShrink=`0`,a.tagName===`svg`&&(a.style.width=`1em`,a.style.height=`1em`))));let l=this._button.querySelector(`.mint-button-spinner-wrap`),u=a??this._button.querySelector(`:scope > .mint-button-icon, :scope > [slot="icon"]`);if(e&&l&&u){l.setAttribute(`data-position`,o);let e=window.getComputedStyle(u),t=e.width,n=e.height;if(t!==`auto`&&t!==`0px`){l.style.width=t,l.style.flexBasis=t;let e=l.querySelector(`mint-spinner`);e&&(e.style.width=t)}if(n!==`auto`&&n!==`0px`){l.style.height=n;let e=l.querySelector(`mint-spinner`);e&&(e.style.height=n)}u.parentElement===this._button&&u.insertAdjacentElement(`beforebegin`,l)}if(e){let e=this._button.querySelector(`mint-spinner`)?.parentElement;e&&(e.setAttribute(`data-position`,o),c?e.setAttribute(`data-icon-only`,`true`):e.removeAttribute(`data-icon-only`))}let d=this.getButtonClasses();this._button.className=d;let f=this.getAttribute(`aria-label`)?.trim();if(f)this._button.setAttribute(`aria-label`,f);else if(this.isIconOnly()){let e=this.getIcon().split(`-`).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `);this._button.setAttribute(`aria-label`,e||`Action`)}else this._button.removeAttribute(`aria-label`);this.hasAttribute(`active`)?this._button.setAttribute(`aria-pressed`,String(this.isActive())):this._button.removeAttribute(`aria-pressed`),this.setAttribute(`data-variant`,this.getVariant()),this.setAttribute(`data-tone`,this.getTone()),this._button.setAttribute(`data-variant`,this.getVariant()),this._button.setAttribute(`data-align`,this.getAlignment()),this._button.toggleAttribute(`data-icon-only`,c),e?this._button.setAttribute(`data-loading`,`true`):this._button.removeAttribute(`data-loading`),this.isActive()?this._button.classList.add(`mint-button-active`):this._button.classList.remove(`mint-button-active`)}finally{this._connectHostChildObserver()}}setupEventListeners(){this._button&&!this._clickHandler&&(this._clickHandler=this.handleClick.bind(this),this._clickHandler&&this._button.addEventListener(`click`,this._clickHandler,!0),this._button.addEventListener(`mousedown`,this._handleMouseDown),this._button.addEventListener(`touchstart`,this._handleTouchStart),this._button.addEventListener(`touchend`,this._handleTouchEnd),this._button.addEventListener(`touchcancel`,this._handleTouchCancel))}removeEventListeners(){this._button&&(this._clickHandler&&=(this._button.removeEventListener(`click`,this._clickHandler,!0),null),this._button.removeEventListener(`mousedown`,this._handleMouseDown),this._button.removeEventListener(`touchstart`,this._handleTouchStart),this._button.removeEventListener(`touchend`,this._handleTouchEnd),this._button.removeEventListener(`touchcancel`,this._handleTouchCancel))}_clearMousePressedState(){this._mousePressed&&(this._mousePressed=!1,document.removeEventListener(`mouseup`,this._handleMouseUp),window.removeEventListener(`blur`,this._handleMouseCancel)),this._button&&(this.isActive()||this._button.classList.remove(`mint-button-active`))}handleClick(e){if(this.isDisabled()||this.isLoading()){e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation();return}if(this.getType()===`submit`){this.dispatchEvent(new CustomEvent(`click`,{detail:{originalEvent:e},bubbles:!0,cancelable:!0,composed:!0}));return}if(e.stopPropagation(),e.stopImmediatePropagation(),this._isHandlingClick){e.preventDefault();return}this._isHandlingClick=!0,e.preventDefault(),this.dispatchEvent(new CustomEvent(`click`,{detail:{originalEvent:e},bubbles:!0,cancelable:!0,composed:!0})),requestAnimationFrame(()=>{this._isHandlingClick=!1})}};customElements.get(`mint-button`)||e.t(`mint-button`,t),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return t}});
1
+ require(`./icon-B9P0jyS2.js`);const e=require(`./register-element-tCL_F1YI.js`);require(`./icon-Cia9x_J2.js`),/* empty css */require(`./spinner-CUcCgLKS.js`);var t=class extends HTMLElement{static get observedAttributes(){return[`variant`,`tone`,`disabled`,`loading`,`button-type`,`type`,`full-width`,`icon-position`,`icon`,`active`,`align`,`aria-label`]}constructor(){super(),this._button=null,this._clickHandler=null,this._isHandlingClick=!1,this._mousePressed=!1,this._hostChildObserver=null,this._hostRenderFromObserverRaf=null,this._handleMouseDown=()=>{this._button&&!this.isDisabled()&&!this.isLoading()&&(this._button.classList.add(`mint-button-active`),this._mousePressed||(this._mousePressed=!0,document.addEventListener(`mouseup`,this._handleMouseUp),window.addEventListener(`blur`,this._handleMouseCancel)))},this._handleMouseUp=()=>{this._clearMousePressedState()},this._handleMouseCancel=()=>{this._clearMousePressedState()},this._handleTouchStart=()=>{this._button&&!this.isDisabled()&&!this.isLoading()&&this._button.classList.add(`mint-button-active`)},this._handleTouchEnd=()=>{this._button&&(this.isActive()||this._button.classList.remove(`mint-button-active`))},this._handleTouchCancel=()=>{this._button&&(this.isActive()||this._button.classList.remove(`mint-button-active`))}}_getGeneratedIcon(){return this._button?this._button.querySelector(`:scope > [data-generated-icon="true"]`):null}_getContentWrapperClass(e){return`mint-button-content`}connectedCallback(){this.render(),this._button&&this.setupEventListeners()}disconnectedCallback(){this._disconnectHostChildObserver(),this._hostRenderFromObserverRaf!==null&&(cancelAnimationFrame(this._hostRenderFromObserverRaf),this._hostRenderFromObserverRaf=null),this.removeEventListeners(),this._clearMousePressedState()}attributeChangedCallback(e,t,n){t!==n&&this.render()}getVariant(){let e=this.getAttribute(`variant`);return e===`ghost`||e===`outline`?e:`solid`}getTone(){return this.getAttribute(`tone`)||`neutral`}isDisabled(){return this.getAttribute(`disabled`)===`true`}isLoading(){return this.getAttribute(`loading`)===`true`}getType(){let e=this.getAttribute(`type`),t=this.getAttribute(`button-type`);return(e||t||`default`)===`submit`?`submit`:`button`}isFullWidth(){return this.getAttribute(`full-width`)===`true`}isActive(){return this.getAttribute(`active`)===`true`}get active(){return this.isActive()}set active(e){e?this.setAttribute(`active`,`true`):this.removeAttribute(`active`)}getIconPosition(){return this.getAttribute(`icon-position`)||`left`}getIcon(){return this.getAttribute(`icon`)||``}getAlignment(){let e=this.getAttribute(`align`);return e===`left`||e===`center`||e===`right`?e:`center`}isIconOnly(){if(!(this.getIcon()||this._getGeneratedIcon()||this._button?.querySelector(`mint-icon`)))return!1;let e=this._button?.querySelector(`.mint-button-content`);if(e&&e.textContent?.trim())return!1;if(this._button)for(let e=this._button.firstChild;e;e=e.nextSibling){if(e.nodeType===Node.TEXT_NODE&&e.textContent?.trim())return!1;if(e.nodeType===Node.ELEMENT_NODE){let t=e;if(t.tagName!==`MINT-ICON`&&t.tagName!==`MINT-SPINNER`&&!t.querySelector(`mint-spinner`)&&!t.hasAttribute(`slot`)&&t.className!==`mint-button-icon`&&!(t.classList.contains(`mint-button-spinner-wrap`)&&t.querySelector(`mint-spinner`))&&t.textContent?.trim())return!1}}return!0}getActiveStateClasses(){let e=`${this.getVariant()}-${this.getTone()}`;return{"solid-action":[`!bg-neutral-900`,`dark:!bg-neutral-700`,`hover:!bg-neutral-900`,`dark:hover:!bg-neutral-700`,`!border-t-neutral-900`,`!border-l-neutral-900`,`!border-r-neutral-600`,`!border-b-neutral-600`,`dark:!border-t-neutral-700`,`dark:!border-l-neutral-700`,`dark:!border-r-neutral-500`,`dark:!border-b-neutral-500`],"solid-neutral":[`!bg-gray-100`,`dark:!bg-mint-hover`,`hover:!bg-gray-100`,`dark:hover:!bg-mint-hover`,`!border-t-gray-400`,`!border-l-gray-400`,`!border-r-gray-200`,`!border-b-gray-200`,`dark:!border-t-gray-950`,`dark:!border-l-gray-950`,`dark:!border-r-mint-divider`,`dark:!border-b-mint-divider`],"solid-info":[`!bg-blue-900`,`dark:!bg-blue-700`,`hover:!bg-blue-900`,`dark:hover:!bg-blue-700`,`!border-t-blue-900`,`!border-l-blue-900`,`!border-r-blue-600`,`!border-b-blue-600`,`dark:!border-t-blue-700`,`dark:!border-l-blue-700`,`dark:!border-r-blue-500`,`dark:!border-b-blue-500`],"solid-warning":[`!bg-amber-900`,`dark:!bg-amber-700`,`hover:!bg-amber-900`,`dark:hover:!bg-amber-700`,`!border-t-amber-900`,`!border-l-amber-900`,`!border-r-amber-600`,`!border-b-amber-600`,`dark:!border-t-amber-700`,`dark:!border-l-amber-700`,`dark:!border-r-amber-500`,`dark:!border-b-amber-500`],"solid-danger":[`!bg-red-900`,`dark:!bg-red-700`,`hover:!bg-red-900`,`dark:hover:!bg-red-700`,`!border-t-red-900`,`!border-l-red-900`,`!border-r-red-600`,`!border-b-red-600`,`dark:!border-t-red-700`,`dark:!border-l-red-700`,`dark:!border-r-red-500`,`dark:!border-b-red-500`],"ghost-action":[`!bg-gray-100`,`!shadow-[inset_0_2px_4px_rgba(0,0,0,0.1)]`,`dark:!bg-mint-hover`,`hover:!bg-gray-100`,`dark:hover:!bg-mint-hover`,`hover:!shadow-[inset_0_2px_4px_rgba(0,0,0,0.1)]`],"ghost-neutral":[`!bg-gray-50`,`!shadow-[inset_0_2px_4px_rgba(0,0,0,0.1)]`,`dark:!bg-mint-hover`,`!text-gray-900`,`dark:!text-white`,`hover:!bg-gray-50`,`dark:hover:!bg-mint-hover`,`hover:!shadow-[inset_0_2px_4px_rgba(0,0,0,0.1)]`,`hover:!text-gray-900`,`dark:hover:!text-white`],"ghost-info":[`!bg-gray-100`,`!shadow-[inset_0_2px_4px_rgba(0,0,0,0.1)]`,`dark:!bg-mint-hover`,`hover:!bg-gray-100`,`dark:hover:!bg-mint-hover`,`hover:!shadow-[inset_0_2px_4px_rgba(0,0,0,0.1)]`],"ghost-warning":[`!bg-gray-100`,`!shadow-[inset_0_2px_4px_rgba(0,0,0,0.1)]`,`dark:!bg-mint-hover`,`hover:!bg-gray-100`,`dark:hover:!bg-mint-hover`,`hover:!shadow-[inset_0_2px_4px_rgba(0,0,0,0.1)]`],"ghost-danger":[`!bg-gray-100`,`!shadow-[inset_0_2px_4px_rgba(0,0,0,0.1)]`,`dark:!bg-mint-hover`,`hover:!bg-gray-100`,`dark:hover:!bg-mint-hover`,`hover:!shadow-[inset_0_2px_4px_rgba(0,0,0,0.1)]`]}[e]||[]}_disconnectHostChildObserver(){this._hostChildObserver?.disconnect()}_connectHostChildObserver(){this.isConnected&&(this._hostChildObserver||=new MutationObserver(e=>{this._onLightDomMutation(e)}),this._hostChildObserver.disconnect(),this._hostChildObserver.observe(this,{childList:!0,subtree:!0,characterData:!0}))}_onLightDomMutation(e){if(this.isConnected){if(this._button&&!this._button.isConnected){this._button=null,this._scheduleRenderFromHostObserver();return}for(let t of e){let e=t.target;if(!(this._button&&(e===this._button||this._button.contains(e)))){this._scheduleRenderFromHostObserver();return}}}}_scheduleRenderFromHostObserver(){this._hostRenderFromObserverRaf===null&&(this._hostRenderFromObserverRaf=requestAnimationFrame(()=>{this._hostRenderFromObserverRaf=null,this.isConnected&&this.render()}))}getButtonClasses(){let e=[`mint-button-core`,`mint-button-${this.getVariant()}`,`mint-button-tone-${this.getTone()}`];return this.isIconOnly()&&e.push(`mint-button-icon-only`),this.isFullWidth()&&e.push(`mint-button-full-width`),e.join(` `)}render(){this._disconnectHostChildObserver(),this._button&&!this._button.isConnected&&(this._button=null);try{let e=this.isLoading(),t=this.isDisabled()||e,n=this.getType();if(!this._button){let e=this.firstElementChild;if(e instanceof HTMLButtonElement)this._button=e;else{for(this._button=document.createElement(`button`);this.firstChild;)this._button.appendChild(this.firstChild);this.appendChild(this._button)}this.setupEventListeners()}this._button.type=n,this._button.disabled=t,this._button.setAttribute(`aria-busy`,String(e));let r=this._button.querySelector(`mint-spinner`);if(e)if(r)r.setAttribute(`data-button-variant`,this.getVariant()),r.setAttribute(`data-button-tone`,this.getTone()),`render`in r&&typeof r.render==`function`&&r.render();else{let e=document.createElement(`span`);e.className=`mint-button-spinner-wrap`;let t=document.createElement(`mint-spinner`);t.setAttribute(`size`,`default`),t.setAttribute(`data-button-variant`,this.getVariant()),t.setAttribute(`data-button-tone`,this.getTone()),t.style.width=`1em`,t.style.height=`1em`,e.appendChild(t),this._button.insertBefore(e,this._button.firstChild)}else r&&r.parentElement?.remove();for(;this.firstChild&&this.firstChild!==this._button;)this._button.appendChild(this.firstChild);let i=this.getIcon(),a=this._getGeneratedIcon();i?(a||(a=document.createElement(`mint-icon`),a.setAttribute(`data-generated-icon`,`true`),a.className=`mint-button-icon`),a.setAttribute(`name`,i)):a&&a.tagName===`MINT-ICON`&&(a.remove(),a=null);let o=this.getIconPosition(),s=this._button.querySelector(`.mint-button-content`);if(s){s.className=this._getContentWrapperClass(s);let e=a&&a.tagName===`MINT-ICON`;if(a&&!a.parentElement){let t=this._button.querySelector(`mint-spinner`)?.parentElement;e||o===`left`?t?t.insertAdjacentElement(`afterend`,a):this._button.insertBefore(a,s):s.insertAdjacentElement(`afterend`,a)}else if(a&&(e||o===`left`)&&a.nextSibling!==s){a.remove();let e=this._button.querySelector(`mint-spinner`)?.parentElement;e?e.insertAdjacentElement(`afterend`,a):this._button.insertBefore(a,s)}else a&&!e&&o===`right`&&a.previousSibling!==s&&(a.remove(),s.insertAdjacentElement(`afterend`,a))}else{let e=[];for(let t=this._button.firstChild;t;t=t.nextSibling){if(t.nodeType!==Node.ELEMENT_NODE){e.push(t);continue}let n=t;n.tagName!==`MINT-SPINNER`&&!n.querySelector(`mint-spinner`)&&t!==a&&!n.hasAttribute(`slot`)&&!(n.classList.contains(`mint-button-spinner-wrap`)&&n.querySelector(`mint-spinner`))&&e.push(t)}if(e.length>0){s=document.createElement(`span`),s.className=this._getContentWrapperClass(s),e.forEach(e=>{s.appendChild(e)}),s.className=this._getContentWrapperClass(s);let t=this._button.querySelector(`mint-spinner`)?.parentElement;a&&o===`left`?t?(t.insertAdjacentElement(`afterend`,a),a.insertAdjacentElement(`afterend`,s)):(this._button.insertBefore(a,this._button.firstChild),a.insertAdjacentElement(`afterend`,s)):a&&o===`right`?t?(t.insertAdjacentElement(`afterend`,s),s.insertAdjacentElement(`afterend`,a)):(this._button.insertBefore(s,this._button.firstChild),s.insertAdjacentElement(`afterend`,a)):t?t.insertAdjacentElement(`afterend`,s):this._button.insertBefore(s,this._button.firstChild)}else if(a&&a.tagName===`MINT-ICON`&&!a.parentElement){let e=this._button.querySelector(`mint-spinner`)?.parentElement;e?e.insertAdjacentElement(`afterend`,a):this._button.insertBefore(a,this._button.firstChild)}}let c=this.isIconOnly();a&&(a.classList.contains(`mint-button-icon`)||a.classList.add(`mint-button-icon`),e?a.style.display=`none`:a.style.display=``,a.setAttribute(`data-position`,o),a.toggleAttribute(`data-icon-only`,c),c&&(a.tagName===`MINT-ICON`?(a.style.width=`1em`,a.style.height=`1em`,a.style.maxWidth=`1em`,a.style.maxHeight=`1em`,a.style.flexShrink=`0`):(a.style.maxWidth=`1em`,a.style.maxHeight=`1em`,a.style.flexShrink=`0`,a.tagName===`svg`&&(a.style.width=`1em`,a.style.height=`1em`))));let l=this._button.querySelector(`.mint-button-spinner-wrap`),u=a??this._button.querySelector(`:scope > .mint-button-icon, :scope > [slot="icon"]`);if(e&&l&&u){l.setAttribute(`data-position`,o);let e=window.getComputedStyle(u),t=e.width,n=e.height;if(t!==`auto`&&t!==`0px`){l.style.width=t,l.style.flexBasis=t;let e=l.querySelector(`mint-spinner`);e&&(e.style.width=t)}if(n!==`auto`&&n!==`0px`){l.style.height=n;let e=l.querySelector(`mint-spinner`);e&&(e.style.height=n)}u.parentElement===this._button&&u.insertAdjacentElement(`beforebegin`,l)}if(e){let e=this._button.querySelector(`mint-spinner`)?.parentElement;e&&(e.setAttribute(`data-position`,o),c?e.setAttribute(`data-icon-only`,`true`):e.removeAttribute(`data-icon-only`))}let d=this.getButtonClasses();this._button.className=d;let f=this.getAttribute(`aria-label`)?.trim();if(f)this._button.setAttribute(`aria-label`,f);else if(this.isIconOnly()){let e=this.getIcon().split(`-`).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `);this._button.setAttribute(`aria-label`,e||`Action`)}else this._button.removeAttribute(`aria-label`);this.hasAttribute(`active`)?this._button.setAttribute(`aria-pressed`,String(this.isActive())):this._button.removeAttribute(`aria-pressed`),this.setAttribute(`data-variant`,this.getVariant()),this.setAttribute(`data-tone`,this.getTone()),this._button.setAttribute(`data-variant`,this.getVariant()),this._button.setAttribute(`data-align`,this.getAlignment()),this._button.toggleAttribute(`data-icon-only`,c),e?this._button.setAttribute(`data-loading`,`true`):this._button.removeAttribute(`data-loading`),this.isActive()?this._button.classList.add(`mint-button-active`):this._button.classList.remove(`mint-button-active`)}finally{this._connectHostChildObserver()}}setupEventListeners(){this._button&&!this._clickHandler&&(this._clickHandler=this.handleClick.bind(this),this._clickHandler&&this._button.addEventListener(`click`,this._clickHandler,!0),this._button.addEventListener(`mousedown`,this._handleMouseDown),this._button.addEventListener(`touchstart`,this._handleTouchStart),this._button.addEventListener(`touchend`,this._handleTouchEnd),this._button.addEventListener(`touchcancel`,this._handleTouchCancel))}removeEventListeners(){this._button&&(this._clickHandler&&=(this._button.removeEventListener(`click`,this._clickHandler,!0),null),this._button.removeEventListener(`mousedown`,this._handleMouseDown),this._button.removeEventListener(`touchstart`,this._handleTouchStart),this._button.removeEventListener(`touchend`,this._handleTouchEnd),this._button.removeEventListener(`touchcancel`,this._handleTouchCancel))}_clearMousePressedState(){this._mousePressed&&(this._mousePressed=!1,document.removeEventListener(`mouseup`,this._handleMouseUp),window.removeEventListener(`blur`,this._handleMouseCancel)),this._button&&(this.isActive()||this._button.classList.remove(`mint-button-active`))}handleClick(e){if(this.isDisabled()||this.isLoading()){e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation();return}if(this.getType()===`submit`){this.dispatchEvent(new CustomEvent(`click`,{detail:{originalEvent:e},bubbles:!0,cancelable:!0,composed:!0}));return}if(e.stopPropagation(),e.stopImmediatePropagation(),this._isHandlingClick){e.preventDefault();return}this._isHandlingClick=!0,e.preventDefault(),this.dispatchEvent(new CustomEvent(`click`,{detail:{originalEvent:e},bubbles:!0,cancelable:!0,composed:!0})),requestAnimationFrame(()=>{this._isHandlingClick=!1})}};customElements.get(`mint-button`)||e.t(`mint-button`,t),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return t}});
@@ -1,6 +1,6 @@
1
- import "./icon-hyFz3uhh.js";
1
+ import "./icon-DAB2KLeo.js";
2
2
  import { t as e } from "./register-element-BFYmIynH.js";
3
- import "./icon-l34kRIZg.js";
3
+ import "./icon-CIAsmizQ.js";
4
4
  /* empty css */
5
5
  import "./spinner-B2sml0AG.js";
6
6
  //#region src/components/button/Button.ts
@@ -0,0 +1 @@
1
+ require(`./icon-B9P0jyS2.js`).a({name:`caret-down`,viewBox:`0 0 24 24`,path:`M19 9l-7 7-7-7`,strokeLinecap:`round`,strokeLinejoin:`round`});
@@ -1,4 +1,4 @@
1
- import { a as e } from "./icon-hyFz3uhh.js";
1
+ import { a as e } from "./icon-DAB2KLeo.js";
2
2
  e({
3
3
  name: "caret-down",
4
4
  viewBox: "0 0 24 24",
@@ -0,0 +1 @@
1
+ require(`./icon-B9P0jyS2.js`).a({name:`caret-right`,viewBox:`0 0 24 24`,path:`M9 5l7 7-7 7`,strokeLinecap:`round`,strokeLinejoin:`round`});
@@ -1,4 +1,4 @@
1
- import { a as e } from "./icon-hyFz3uhh.js";
1
+ import { a as e } from "./icon-DAB2KLeo.js";
2
2
  e({
3
3
  name: "caret-right",
4
4
  viewBox: "0 0 24 24",
@@ -0,0 +1 @@
1
+ const e=require(`./icon-B9P0jyS2.js`),t=require(`./register-element-tCL_F1YI.js`);require(`./icon-Cia9x_J2.js`),e.a({name:`check`,viewBox:`0 0 24 24`,path:`M5 13l4 4L19 7`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`3.2`});var n=class extends HTMLElement{static get observedAttributes(){return[`checked`,`indeterminate`,`disabled`,`label`,`info`,`id`,`name`,`value`,`loading`]}constructor(){super(),this._checkbox=null,this._checked=!1,this._indeterminate=!1,this._clickHandler=null}connectedCallback(){let e=this.getAttribute(`checked`);this._checked=e!==null&&e!==`false`,this._indeterminate=this.hasAttribute(`indeterminate`)&&this.getAttribute(`indeterminate`)!==`false`,this.render()}disconnectedCallback(){this.removeEventListeners()}attributeChangedCallback(e,t,n){e===`checked`&&(this._checked=n!==null&&n!==`false`,this._checkbox&&(this._checkbox.checked=this._checked)),e===`indeterminate`&&(this._indeterminate=n!==null&&n!==`false`,this._checkbox&&(this._checkbox.indeterminate=this._indeterminate)),t!==n&&(this.render(),e===`checked`&&this._checkbox&&this.updateVisualState(),e===`indeterminate`&&this.updateVisualState())}get checked(){return this._checked}set checked(e){e?this.setAttribute(`checked`,``):this.removeAttribute(`checked`),this._checked=!!e,this._checkbox&&(this._checkbox.checked=this._checked),this.updateVisualState()}get indeterminate(){return this._indeterminate}set indeterminate(e){this._indeterminate=!!e,this._indeterminate?this.setAttribute(`indeterminate`,`true`):this.removeAttribute(`indeterminate`),this._checkbox&&(this._checkbox.indeterminate=this._indeterminate),this.updateVisualState()}isDisabled(){return this.hasAttribute(`disabled`)||this.getAttribute(`loading`)===`true`}getLabel(){return this.getAttribute(`label`)||``}getInfo(){return this.getAttribute(`info`)||``}getId(){return this.getAttribute(`id`)||``}getName(){return this.getAttribute(`name`)||``}getValue(){return this.getAttribute(`value`)||``}getCheckboxClasses(){return`mint-checkbox-control`}render(){let e=this.getAttribute(`loading`)===`true`;this.toggleAttribute(`aria-busy`,e);let t=this.getLabel(),n=this.getInfo(),r=this.isDisabled(),i=this.querySelector(`.mint-checkbox-wrapper`);i||(i=document.createElement(`div`),i.className=`mint-checkbox-wrapper`,this.insertBefore(i,this.firstChild)),this._checkbox?this._checkbox.parentElement!==i&&i.appendChild(this._checkbox):(this._checkbox=document.createElement(`input`),this._checkbox.type=`checkbox`,i.appendChild(this._checkbox),this.setupEventListeners()),this._checkbox.className=`mint-input-overlay`,this._checkbox.style.cssText=`position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; z-index: 10; pointer-events: auto; margin: 0; padding: 0;`,this._checkbox.checked=this._checked,this._checkbox.indeterminate=this._indeterminate,this._checkbox.disabled=r,this._changeHandler||this.setupEventListeners();let a=this.getId();a?this._checkbox.id=a:this._checkbox.removeAttribute(`id`);let o=this.getName();o?this._checkbox.name=o:this._checkbox.removeAttribute(`name`);let s=this.getValue();s?this._checkbox.value=s:this._checkbox.removeAttribute(`value`),t?this._checkbox.setAttribute(`aria-label`,t):this._checkbox.removeAttribute(`aria-label`),i.className=`mint-checkbox-wrapper ${this.getCheckboxClasses()}`,i.style.pointerEvents=`none`,this._checkbox.style.pointerEvents=`auto`;let c=i.querySelector(`mint-icon`);c||(c=document.createElement(`mint-icon`),c.setAttribute(`name`,`check`),c.className=`mint-checkbox-check`,c.style.position=`absolute`,c.style.inset=`auto`,c.style.top=`50%`,c.style.left=`50%`,c.style.width=`0.875rem`,c.style.height=`0.875rem`,c.style.margin=`0`,c.style.transition=`opacity 200ms ease-out, transform 200ms ease-out`,c.style.zIndex=`1`,i.appendChild(c)),this.updateVisualState();let l=this.querySelector(`.mint-checkbox-label-container`);if(t||n){l||(l=document.createElement(`div`),l.className=`mint-checkbox-label-container`,this.appendChild(l));let e=l.querySelector(`.mint-checkbox-label`);t?(e||(e=document.createElement(`span`),e.className=`mint-checkbox-label`,l.insertBefore(e,l.firstChild)),e.textContent=t,r?e.style.opacity=`0.5`:e.style.opacity=``):e&&e.remove();let i=l.querySelector(`.mint-checkbox-info`);if(n?(i||(i=document.createElement(`span`),i.className=`mint-checkbox-info`,l.appendChild(i)),i.textContent=n,r?i.style.opacity=`0.5`:i.style.opacity=``):i&&i.remove(),r)l.style.cursor=`default`,l._clickHandler&&(l.removeEventListener(`click`,l._clickHandler),l._clickHandler=null);else{l.style.cursor=`pointer`;let e=l._clickHandler;e&&l.removeEventListener(`click`,e),l._clickHandler=e=>{this._checkbox&&(e.target===this._checkbox||this._checkbox.contains(e.target)||e.composedPath().includes(this._checkbox))||this.toggle()},l.addEventListener(`click`,l._clickHandler)}}else l&&l.remove();let u=this.querySelector(`:scope > .mint-checkbox-loading-skeleton`);if(e){if(!u){u=document.createElement(`div`),u.className=`mint-checkbox-loading-skeleton`,u.setAttribute(`aria-hidden`,`true`),Object.assign(u.style,{position:`absolute`,inset:`0`,display:`flex`,alignItems:`center`,gap:`0.5rem`,pointerEvents:`none`,zIndex:`20`});let e=document.createElement(`span`);if(Object.assign(e.style,{display:`block`,width:`1.25rem`,height:`1.25rem`,flex:`none`,borderRadius:`0.25rem`,background:`var(--mint-color-surface-control, #e8eee9)`,animation:`mint-checkbox-skeleton-pulse 1.4s ease-in-out infinite`}),u.appendChild(e),t){let e=document.createElement(`span`);Object.assign(e.style,{display:`block`,width:`6rem`,height:`1rem`,borderRadius:`0.35rem`,background:`var(--mint-color-surface-control, #e8eee9)`,animation:`mint-checkbox-skeleton-pulse 1.4s ease-in-out infinite`}),u.appendChild(e)}this.appendChild(u)}this.style.position=`relative`,u.style.display=`flex`,i.style.visibility=`hidden`,l&&(l.style.visibility=`hidden`)}else u&&(u.style.display=`none`),i.style.visibility=``,l&&(l.style.visibility=``)}setupEventListeners(){this.removeEventListeners(),this._checkbox&&(this._changeHandler=e=>{e.stopPropagation(),this._checked=this._checkbox.checked,this._indeterminate=!1,this._checkbox.indeterminate=!1,this.removeAttribute(`indeterminate`),this._checked?this.hasAttribute(`checked`)||this.setAttribute(`checked`,``):this.hasAttribute(`checked`)&&this.removeAttribute(`checked`),this.updateVisualState();let t=new CustomEvent(`change`,{detail:{checked:this._checked,value:this.getValue()},bubbles:!0,cancelable:!0});this.dispatchEvent(t)},this._checkbox.addEventListener(`change`,this._changeHandler),this._mousedownHandler=e=>{e.stopPropagation();let t=this.querySelector(`.mint-checkbox-wrapper`);t&&!this.isDisabled()&&(t.classList.add(`mint-checkbox-active`),this._checked?(t.style.backgroundColor=`var(--mint-color-primary)`,t.style.boxShadow=`inset 0 2px 4px rgba(0, 0, 0, 0.3)`):(t.style.backgroundColor=`var(--mint-color-surface-hover)`,t.style.boxShadow=`inset 0 2px 4px rgba(0, 0, 0, 0.1)`))},this._mouseupHandler=e=>{e.stopPropagation();let t=this.querySelector(`.mint-checkbox-wrapper`);t&&(t.classList.remove(`mint-checkbox-active`),t.style.backgroundColor=``,t.style.boxShadow=``)},this._mouseleaveHandler=e=>{let t=this.querySelector(`.mint-checkbox-wrapper`);t&&(t.classList.remove(`mint-checkbox-active`),t.style.backgroundColor=``,t.style.boxShadow=``)},this._checkbox.addEventListener(`mousedown`,this._mousedownHandler),this._checkbox.addEventListener(`mouseup`,this._mouseupHandler),this._checkbox.addEventListener(`mouseleave`,this._mouseleaveHandler),this._touchstartHandler=e=>{e.stopPropagation();let t=this.querySelector(`.mint-checkbox-wrapper`);t&&!this.isDisabled()&&(t.classList.add(`mint-checkbox-active`),this._checked?(t.style.backgroundColor=`var(--mint-color-primary)`,t.style.boxShadow=`inset 0 2px 4px rgba(0, 0, 0, 0.3)`):(t.style.backgroundColor=`var(--mint-color-surface-hover)`,t.style.boxShadow=`inset 0 2px 4px rgba(0, 0, 0, 0.1)`))},this._touchendHandler=e=>{e.stopPropagation();let t=this.querySelector(`.mint-checkbox-wrapper`);t&&(t.classList.remove(`mint-checkbox-active`),t.style.backgroundColor=``,t.style.boxShadow=``)},this._checkbox.addEventListener(`touchstart`,this._touchstartHandler),this._checkbox.addEventListener(`touchend`,this._touchendHandler))}removeEventListeners(){this._checkbox&&(this._changeHandler&&=(this._checkbox.removeEventListener(`change`,this._changeHandler),null),this._mousedownHandler&&=(this._checkbox.removeEventListener(`mousedown`,this._mousedownHandler),null),this._mouseupHandler&&=(this._checkbox.removeEventListener(`mouseup`,this._mouseupHandler),null),this._mouseleaveHandler&&=(this._checkbox.removeEventListener(`mouseleave`,this._mouseleaveHandler),null),this._touchstartHandler&&=(this._checkbox.removeEventListener(`touchstart`,this._touchstartHandler),null),this._touchendHandler&&=(this._checkbox.removeEventListener(`touchend`,this._touchendHandler),null))}updateVisualState(){let e=this.querySelector(`.mint-checkbox-wrapper`),t=e?.querySelector(`mint-icon`);t&&(t.style.opacity=this._checked&&!this._indeterminate?`1`:`0`,t.style.transform=this._checked&&!this._indeterminate?`translate(-50%, -50%)`:`translate(-50%, -50%) scale(0.8)`),e&&(e.className=`mint-checkbox-wrapper ${this.getCheckboxClasses()}`,e.toggleAttribute(`data-indeterminate`,this._indeterminate),e.classList.contains(`mint-checkbox-active`)||(e.style.backgroundColor=``,e.style.boxShadow=``))}toggle(){if(this._checkbox&&!this.isDisabled()){this._checkbox.checked=!this._checked,this._indeterminate=!1,this._checkbox.indeterminate=!1,this.removeAttribute(`indeterminate`),this._checked=this._checkbox.checked,this._checked?this.hasAttribute(`checked`)||this.setAttribute(`checked`,``):this.hasAttribute(`checked`)&&this.removeAttribute(`checked`),this.updateVisualState();let e=new CustomEvent(`change`,{detail:{checked:this._checked},bubbles:!0,cancelable:!0});this.dispatchEvent(e)}}};typeof customElements<`u`&&!customElements.get(`mint-checkbox`)&&t.t(`mint-checkbox`,n),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return n}});