@lukso/web-components 1.172.13 → 1.172.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/cn-LM_JlZIN.js +36 -0
- package/dist/chunks/cn-zamUNFMe.js +39 -0
- package/dist/chunks/directive-CY66atYi.js +22 -0
- package/dist/chunks/directive-DUHAbymA.js +15 -0
- package/dist/chunks/index-BNt_JinF.js +212 -0
- package/dist/chunks/{index-DG4rMUh3.js → index-BOEPqh0N.js} +1 -1
- package/dist/chunks/{index-F8ll4iy2.js → index-C5S-_QDF.js} +1 -1
- package/dist/chunks/{index-B_H2eYG_.js → index-CA6SrfZ-.js} +9 -8
- package/dist/chunks/{index-CZGvLdJ0.js → index-CqZm8OfY.js} +1 -2
- package/dist/chunks/index-Cy2_2lFt.js +214 -0
- package/dist/chunks/{index-Dn2DJhID.js → index-Ds-r8fCt.js} +77 -74
- package/dist/chunks/{index-C5YyB6ug.js → index-DvLZWpq9.js} +2 -3
- package/dist/chunks/{index-D_5wz2k1.js → index-UVrFZqIM.js} +79 -76
- package/dist/chunks/{index-BHAtoIlu.js → index-cakeic-M.js} +9 -8
- package/dist/chunks/{style-map-B7XFhSOK.js → style-map-AEeBQfPb.js} +2 -3
- package/dist/chunks/{style-map-BPljJihp.js → style-map-auscxO0L.js} +1 -2
- package/dist/components/index.cjs +4 -5
- package/dist/components/index.js +4 -5
- package/dist/components/lukso-alert/index.cjs +16 -15
- package/dist/components/lukso-alert/index.js +16 -15
- package/dist/components/lukso-button/index.cjs +42 -40
- package/dist/components/lukso-button/index.js +39 -37
- package/dist/components/lukso-card/index.cjs +66 -71
- package/dist/components/lukso-card/index.js +48 -53
- package/dist/components/lukso-checkbox/index.cjs +27 -26
- package/dist/components/lukso-checkbox/index.js +27 -26
- package/dist/components/lukso-collapse/index.cjs +27 -26
- package/dist/components/lukso-collapse/index.js +26 -25
- package/dist/components/lukso-color-picker/index.cjs +33 -31
- package/dist/components/lukso-color-picker/index.js +32 -30
- package/dist/components/lukso-dropdown/index.cjs +20 -19
- package/dist/components/lukso-dropdown/index.js +20 -19
- package/dist/components/lukso-dropdown-option/index.cjs +12 -11
- package/dist/components/lukso-dropdown-option/index.js +12 -11
- package/dist/components/lukso-footer/index.cjs +5 -4
- package/dist/components/lukso-footer/index.js +5 -4
- package/dist/components/lukso-form-description/index.cjs +7 -6
- package/dist/components/lukso-form-description/index.js +7 -6
- package/dist/components/lukso-form-error/index.cjs +7 -6
- package/dist/components/lukso-form-error/index.js +7 -6
- package/dist/components/lukso-form-label/index.cjs +8 -7
- package/dist/components/lukso-form-label/index.js +8 -7
- package/dist/components/lukso-icon/index.cjs +268 -267
- package/dist/components/lukso-icon/index.js +268 -267
- package/dist/components/lukso-image/index.cjs +12 -12
- package/dist/components/lukso-image/index.js +12 -12
- package/dist/components/lukso-input/index.cjs +49 -47
- package/dist/components/lukso-input/index.js +48 -46
- package/dist/components/lukso-markdown/index.cjs +13 -83
- package/dist/components/lukso-markdown/index.js +13 -83
- package/dist/components/lukso-markdown-editor/index.cjs +68 -67
- package/dist/components/lukso-markdown-editor/index.js +67 -66
- package/dist/components/lukso-modal/index.cjs +12 -11
- package/dist/components/lukso-modal/index.js +11 -10
- package/dist/components/lukso-navbar/index.cjs +30 -30
- package/dist/components/lukso-navbar/index.js +30 -30
- package/dist/components/lukso-pagination/index.cjs +16 -16
- package/dist/components/lukso-pagination/index.js +16 -16
- package/dist/components/lukso-profile/index.cjs +162 -11
- package/dist/components/lukso-profile/index.js +165 -5
- package/dist/components/lukso-progress/index.cjs +16 -13
- package/dist/components/lukso-progress/index.js +13 -10
- package/dist/components/lukso-qr-code/index.cjs +17 -34
- package/dist/components/lukso-qr-code/index.js +16 -33
- package/dist/components/lukso-radio/index.cjs +27 -25
- package/dist/components/lukso-radio/index.js +25 -23
- package/dist/components/lukso-radio-group/index.cjs +9 -9
- package/dist/components/lukso-radio-group/index.js +9 -9
- package/dist/components/lukso-sanitize/index.cjs +5 -4
- package/dist/components/lukso-sanitize/index.js +5 -4
- package/dist/components/lukso-search/index.cjs +11 -8
- package/dist/components/lukso-search/index.js +11 -8
- package/dist/components/lukso-select/index.cjs +47 -46
- package/dist/components/lukso-select/index.js +46 -45
- package/dist/components/lukso-share/index.cjs +7 -6
- package/dist/components/lukso-share/index.js +7 -6
- package/dist/components/lukso-switch/index.cjs +16 -15
- package/dist/components/lukso-switch/index.js +16 -15
- package/dist/components/lukso-tag/index.cjs +13 -12
- package/dist/components/lukso-tag/index.js +12 -11
- package/dist/components/lukso-terms/index.cjs +9 -8
- package/dist/components/lukso-terms/index.js +9 -8
- package/dist/components/lukso-textarea/index.cjs +36 -34
- package/dist/components/lukso-textarea/index.js +35 -33
- package/dist/components/lukso-tooltip/index.cjs +27 -3461
- package/dist/components/lukso-tooltip/index.js +27 -3461
- package/dist/components/lukso-username/index.cjs +11 -7
- package/dist/components/lukso-username/index.js +11 -7
- package/dist/components/lukso-wizard/index.cjs +13 -12
- package/dist/components/lukso-wizard/index.js +11 -10
- package/dist/index.cjs +6 -6
- package/dist/index.js +5 -5
- package/dist/shared/tailwind-element/index.cjs +15 -3
- package/dist/shared/tailwind-element/index.js +17 -1
- package/dist/vite.full.config.d.ts.map +1 -1
- package/package.json +7 -1
- package/dist/chunks/_commonjsHelpers-B85MJLTf.js +0 -5
- package/dist/chunks/_commonjsHelpers-CFO10eej.js +0 -7
- package/dist/chunks/axe-DJKac19y.js +0 -35093
- package/dist/chunks/axe-MHuN9KU0.js +0 -35097
- package/dist/chunks/base-Bn-zDNuZ.js +0 -93
- package/dist/chunks/base-Cl6v8-BZ.js +0 -8
- package/dist/chunks/base-KJhhKWYy.js +0 -91
- package/dist/chunks/base-NFGX42U4.js +0 -10
- package/dist/chunks/chunk-LQIOVPBE-CGhQ79Di.js +0 -370
- package/dist/chunks/chunk-LQIOVPBE-kQFZF_OS.js +0 -372
- package/dist/chunks/directive-BKuZRRPO.js +0 -8
- package/dist/chunks/directive-DT5Y-Nw0.js +0 -12
- package/dist/chunks/index-5X9ujrWL.js +0 -41
- package/dist/chunks/index-B9iart53.js +0 -2545
- package/dist/chunks/index-BAf8Hzhe.js +0 -611
- package/dist/chunks/index-BBFSnMaE.js +0 -1345
- package/dist/chunks/index-BDyLu6M0.js +0 -609
- package/dist/chunks/index-BxQ_0s_1.js +0 -50
- package/dist/chunks/index-CaJky2qL.js +0 -2547
- package/dist/chunks/index-glHBylgQ.js +0 -1347
- package/dist/chunks/isAddress-B1R_6-uN.js +0 -745
- package/dist/chunks/isAddress-BUdSrCaY.js +0 -743
- package/dist/chunks/property-D6IL6zax.js +0 -11
- package/dist/chunks/property-DfumgIL6.js +0 -9
- package/dist/chunks/query-CHb9Ft_d.js +0 -9
- package/dist/chunks/query-D3HF7Pde.js +0 -11
- package/dist/chunks/state-CFjY89m3.js +0 -11
- package/dist/chunks/state-CaelFSbE.js +0 -9
- package/dist/chunks/unsafe-html-BHBLEMoa.js +0 -10
- package/dist/chunks/unsafe-html-DiwkOQlV.js +0 -12
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { nothing, html } from 'lit';
|
|
2
|
+
import { property } from 'lit/decorators.js';
|
|
3
|
+
import { tv } from 'tailwind-variants';
|
|
4
4
|
import { s as safeCustomElement } from '../../chunks/safe-custom-element-qdGIR_v6.js';
|
|
5
|
+
import { TailwindStyledElement } from '../../shared/tailwind-element/index.js';
|
|
5
6
|
import '../lukso-icon/index.js';
|
|
6
|
-
import '../../chunks/index-
|
|
7
|
+
import '../../chunks/index-CA6SrfZ-.js';
|
|
7
8
|
|
|
8
9
|
const style = ":host {\n display: flex\n}";
|
|
9
10
|
|
|
@@ -24,7 +25,7 @@ let LuksoAlert = class extends TailwindStyledElement(style) {
|
|
|
24
25
|
this.hasIcon = false;
|
|
25
26
|
this.title = "";
|
|
26
27
|
this.description = "";
|
|
27
|
-
this.styles =
|
|
28
|
+
this.styles = tv({
|
|
28
29
|
base: "rounded-8 p-4 flex gap-3 items-center",
|
|
29
30
|
variants: {
|
|
30
31
|
variant: {
|
|
@@ -52,35 +53,35 @@ let LuksoAlert = class extends TailwindStyledElement(style) {
|
|
|
52
53
|
const styles = this.styles({
|
|
53
54
|
variant: this.variant
|
|
54
55
|
});
|
|
55
|
-
return
|
|
56
|
+
return html`
|
|
56
57
|
<div class=${styles}>
|
|
57
|
-
${this.hasIcon ?
|
|
58
|
+
${this.hasIcon ? html`<lukso-icon
|
|
58
59
|
pack="vuesax"
|
|
59
60
|
name="${this.icon.name}"
|
|
60
61
|
color="${this.icon.color}"
|
|
61
|
-
></lukso-icon>` :
|
|
62
|
+
></lukso-icon>` : nothing}
|
|
62
63
|
<div class="flex flex-col gap-1">
|
|
63
|
-
${this.title ?
|
|
64
|
-
${this.description ?
|
|
64
|
+
${this.title ? html`<div class="heading-inter-14-bold">${this.title}</div>` : nothing}
|
|
65
|
+
${this.description ? html`<lukso-sanitize
|
|
65
66
|
class="paragraph-inter-12-regular"
|
|
66
67
|
html-content="${this.description}"
|
|
67
|
-
></lukso-sanitize>` :
|
|
68
|
+
></lukso-sanitize>` : nothing}
|
|
68
69
|
</div>
|
|
69
70
|
</div>
|
|
70
71
|
`;
|
|
71
72
|
}
|
|
72
73
|
};
|
|
73
74
|
__decorateClass([
|
|
74
|
-
|
|
75
|
+
property({ type: String })
|
|
75
76
|
], LuksoAlert.prototype, "variant", 2);
|
|
76
77
|
__decorateClass([
|
|
77
|
-
|
|
78
|
+
property({ type: Boolean, attribute: "has-icon", reflect: true })
|
|
78
79
|
], LuksoAlert.prototype, "hasIcon", 2);
|
|
79
80
|
__decorateClass([
|
|
80
|
-
|
|
81
|
+
property({ type: String })
|
|
81
82
|
], LuksoAlert.prototype, "title", 2);
|
|
82
83
|
__decorateClass([
|
|
83
|
-
|
|
84
|
+
property({ type: String })
|
|
84
85
|
], LuksoAlert.prototype, "description", 2);
|
|
85
86
|
LuksoAlert = __decorateClass([
|
|
86
87
|
safeCustomElement("lukso-alert")
|
|
@@ -2,13 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
5
|
+
const lit = require('lit');
|
|
6
|
+
const decorators_js = require('lit/decorators.js');
|
|
7
|
+
const tailwindVariants = require('tailwind-variants');
|
|
8
|
+
const core = require('@lukso/core');
|
|
9
|
+
const shared_tailwindElement_index = require('../../shared/tailwind-element/index.cjs');
|
|
10
10
|
require('../../tailwind-config.cjs');
|
|
11
|
-
const
|
|
11
|
+
const cn = require('../../chunks/cn-zamUNFMe.js');
|
|
12
|
+
require('viem');
|
|
13
|
+
require('axe-core');
|
|
12
14
|
|
|
13
15
|
const style = ":host {\n\n display: inline-flex\n}\n\n:host([is-full-width]) {\n\n display: flex;\n\n width: 100%\n}";
|
|
14
16
|
|
|
@@ -22,7 +24,7 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
22
24
|
return result;
|
|
23
25
|
};
|
|
24
26
|
const LONG_PRESS_ANIMATION_DURATION_IN_MS = 2e3;
|
|
25
|
-
class LuksoButton extends
|
|
27
|
+
class LuksoButton extends core.withTheme(shared_tailwindElement_index.TailwindStyledElement(style)) {
|
|
26
28
|
constructor() {
|
|
27
29
|
super(...arguments);
|
|
28
30
|
this.variant = "primary";
|
|
@@ -45,7 +47,7 @@ class LuksoButton extends chunkLQIOVPBE.withTheme(shared_tailwindElement_index.T
|
|
|
45
47
|
this.isPressed = false;
|
|
46
48
|
this.noTransition = false;
|
|
47
49
|
this.timer = 0;
|
|
48
|
-
this.counterStyles =
|
|
50
|
+
this.counterStyles = tailwindVariants.tv({
|
|
49
51
|
base: "ml-2 border border-neutral-20 rounded-4 px-[2px] py-[1px] paragraph-inter-10-semi-bold text-neutral-20 bg-neutral-100",
|
|
50
52
|
variants: {
|
|
51
53
|
isActive: {
|
|
@@ -53,7 +55,7 @@ class LuksoButton extends chunkLQIOVPBE.withTheme(shared_tailwindElement_index.T
|
|
|
53
55
|
}
|
|
54
56
|
}
|
|
55
57
|
});
|
|
56
|
-
this.buttonStyles =
|
|
58
|
+
this.buttonStyles = tailwindVariants.tv({
|
|
57
59
|
base: `flex justify-center items-center relative text-center
|
|
58
60
|
border border-solid cursor-pointer transition
|
|
59
61
|
duration-250 active:scale-98 active:duration-25
|
|
@@ -160,7 +162,7 @@ class LuksoButton extends chunkLQIOVPBE.withTheme(shared_tailwindElement_index.T
|
|
|
160
162
|
}
|
|
161
163
|
]
|
|
162
164
|
});
|
|
163
|
-
this.loadingStyles =
|
|
165
|
+
this.loadingStyles = tailwindVariants.tv({
|
|
164
166
|
slots: {
|
|
165
167
|
icon: "animate-spin",
|
|
166
168
|
text: ""
|
|
@@ -214,19 +216,19 @@ class LuksoButton extends chunkLQIOVPBE.withTheme(shared_tailwindElement_index.T
|
|
|
214
216
|
const { icon, text } = this.loadingStyles({
|
|
215
217
|
size: this.size
|
|
216
218
|
});
|
|
217
|
-
return
|
|
219
|
+
return lit.html`<lukso-icon
|
|
218
220
|
name="spinner"
|
|
219
221
|
size=${this.size}
|
|
220
222
|
color=${this.variant === "secondary" || this.variant === "text" ? "neutral-20" : "neutral-100"}
|
|
221
223
|
class=${icon()}
|
|
222
224
|
></lukso-icon>
|
|
223
|
-
${this.loadingText ?
|
|
225
|
+
${this.loadingText ? lit.html`<span class=${text()}>${this.loadingText}</span>` : lit.nothing}`;
|
|
224
226
|
}
|
|
225
227
|
counterTemplate() {
|
|
226
228
|
const counterStyles = this.counterStyles({
|
|
227
229
|
isActive: this.isActive
|
|
228
230
|
});
|
|
229
|
-
return
|
|
231
|
+
return lit.html` <span class=${counterStyles}>${this.count}</span> `;
|
|
230
232
|
}
|
|
231
233
|
buttonTemplate() {
|
|
232
234
|
const buttonStyles = this.buttonStyles({
|
|
@@ -238,12 +240,12 @@ class LuksoButton extends chunkLQIOVPBE.withTheme(shared_tailwindElement_index.T
|
|
|
238
240
|
isActive: this.isActive,
|
|
239
241
|
isIcon: this.isIcon
|
|
240
242
|
});
|
|
241
|
-
return
|
|
243
|
+
return lit.html`
|
|
242
244
|
<button
|
|
243
245
|
data-testid="button"
|
|
244
246
|
?disabled=${this.disabled || this.isLoading}
|
|
245
247
|
type=${this.type}
|
|
246
|
-
class=${
|
|
248
|
+
class=${cn.cn(buttonStyles, this.customClass)}
|
|
247
249
|
aria-label=${this.label}
|
|
248
250
|
@mousedown=${this.handleMouseDown}
|
|
249
251
|
@touchstart=${this.handleMouseDown}
|
|
@@ -252,8 +254,8 @@ class LuksoButton extends chunkLQIOVPBE.withTheme(shared_tailwindElement_index.T
|
|
|
252
254
|
@mouseup=${this.handleMouseUp}
|
|
253
255
|
@mouseleave=${this.handleMouseUp}
|
|
254
256
|
>
|
|
255
|
-
${this.isLoading ? this.loadingTemplate() :
|
|
256
|
-
${this.count ? this.counterTemplate() :
|
|
257
|
+
${this.isLoading ? this.loadingTemplate() : lit.html`<slot></slot>`}
|
|
258
|
+
${this.count ? this.counterTemplate() : lit.nothing}
|
|
257
259
|
</button>
|
|
258
260
|
`;
|
|
259
261
|
}
|
|
@@ -266,10 +268,10 @@ class LuksoButton extends chunkLQIOVPBE.withTheme(shared_tailwindElement_index.T
|
|
|
266
268
|
isPressed: this.isPressed,
|
|
267
269
|
isIcon: this.isIcon
|
|
268
270
|
});
|
|
269
|
-
return
|
|
271
|
+
return lit.html`
|
|
270
272
|
<a
|
|
271
273
|
data-testid="link"
|
|
272
|
-
class=${
|
|
274
|
+
class=${cn.cn(buttonStyles, this.customClass)}
|
|
273
275
|
href=${this.href}
|
|
274
276
|
target=${this.target}
|
|
275
277
|
rel=${this.rel}
|
|
@@ -280,68 +282,68 @@ class LuksoButton extends chunkLQIOVPBE.withTheme(shared_tailwindElement_index.T
|
|
|
280
282
|
`;
|
|
281
283
|
}
|
|
282
284
|
render() {
|
|
283
|
-
return
|
|
285
|
+
return lit.html` ${this.isLink ? this.linkTemplate() : this.buttonTemplate()} `;
|
|
284
286
|
}
|
|
285
287
|
}
|
|
286
288
|
__decorateClass([
|
|
287
|
-
property
|
|
289
|
+
decorators_js.property({ type: String })
|
|
288
290
|
], LuksoButton.prototype, "variant");
|
|
289
291
|
__decorateClass([
|
|
290
|
-
property
|
|
292
|
+
decorators_js.property({ type: String })
|
|
291
293
|
], LuksoButton.prototype, "size");
|
|
292
294
|
__decorateClass([
|
|
293
|
-
property
|
|
295
|
+
decorators_js.property({ type: Boolean })
|
|
294
296
|
], LuksoButton.prototype, "disabled");
|
|
295
297
|
__decorateClass([
|
|
296
|
-
property
|
|
298
|
+
decorators_js.property({ type: Boolean, attribute: "is-full-width" })
|
|
297
299
|
], LuksoButton.prototype, "isFullWidth");
|
|
298
300
|
__decorateClass([
|
|
299
|
-
property
|
|
301
|
+
decorators_js.property({ type: Boolean, attribute: "is-long-press" })
|
|
300
302
|
], LuksoButton.prototype, "isLongPress");
|
|
301
303
|
__decorateClass([
|
|
302
|
-
property
|
|
304
|
+
decorators_js.property({ type: Boolean, attribute: "is-link" })
|
|
303
305
|
], LuksoButton.prototype, "isLink");
|
|
304
306
|
__decorateClass([
|
|
305
|
-
property
|
|
307
|
+
decorators_js.property({ type: Boolean, attribute: "is-loading" })
|
|
306
308
|
], LuksoButton.prototype, "isLoading");
|
|
307
309
|
__decorateClass([
|
|
308
|
-
property
|
|
310
|
+
decorators_js.property({ type: String })
|
|
309
311
|
], LuksoButton.prototype, "type");
|
|
310
312
|
__decorateClass([
|
|
311
|
-
property
|
|
313
|
+
decorators_js.property({ type: String })
|
|
312
314
|
], LuksoButton.prototype, "href");
|
|
313
315
|
__decorateClass([
|
|
314
|
-
property
|
|
316
|
+
decorators_js.property({ type: String })
|
|
315
317
|
], LuksoButton.prototype, "target");
|
|
316
318
|
__decorateClass([
|
|
317
|
-
property
|
|
319
|
+
decorators_js.property({ type: String })
|
|
318
320
|
], LuksoButton.prototype, "rel");
|
|
319
321
|
__decorateClass([
|
|
320
|
-
property
|
|
322
|
+
decorators_js.property({ type: String, attribute: "loading-text" })
|
|
321
323
|
], LuksoButton.prototype, "loadingText");
|
|
322
324
|
__decorateClass([
|
|
323
|
-
property
|
|
325
|
+
decorators_js.property({ type: String, attribute: "custom-class" })
|
|
324
326
|
], LuksoButton.prototype, "customClass");
|
|
325
327
|
__decorateClass([
|
|
326
|
-
property
|
|
328
|
+
decorators_js.property({ type: Boolean, attribute: "is-active" })
|
|
327
329
|
], LuksoButton.prototype, "isActive");
|
|
328
330
|
__decorateClass([
|
|
329
|
-
property
|
|
331
|
+
decorators_js.property({ type: Number })
|
|
330
332
|
], LuksoButton.prototype, "count");
|
|
331
333
|
__decorateClass([
|
|
332
|
-
property
|
|
334
|
+
decorators_js.property({ type: Boolean, attribute: "is-icon" })
|
|
333
335
|
], LuksoButton.prototype, "isIcon");
|
|
334
336
|
__decorateClass([
|
|
335
|
-
property
|
|
337
|
+
decorators_js.property({ type: String })
|
|
336
338
|
], LuksoButton.prototype, "label");
|
|
337
339
|
__decorateClass([
|
|
338
|
-
state
|
|
340
|
+
decorators_js.state()
|
|
339
341
|
], LuksoButton.prototype, "isPressed");
|
|
340
342
|
__decorateClass([
|
|
341
|
-
state
|
|
343
|
+
decorators_js.state()
|
|
342
344
|
], LuksoButton.prototype, "noTransition");
|
|
343
345
|
__decorateClass([
|
|
344
|
-
state
|
|
346
|
+
decorators_js.state()
|
|
345
347
|
], LuksoButton.prototype, "timer");
|
|
346
348
|
customElements.define("lukso-button", LuksoButton);
|
|
347
349
|
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { nothing, html } from 'lit';
|
|
2
|
+
import { property, state } from 'lit/decorators.js';
|
|
3
|
+
import { tv } from 'tailwind-variants';
|
|
4
|
+
import { withTheme } from '@lukso/core';
|
|
5
|
+
import { TailwindStyledElement } from '../../shared/tailwind-element/index.js';
|
|
6
6
|
import '../../tailwind-config.js';
|
|
7
|
-
import { c as cn } from '../../chunks/
|
|
7
|
+
import { c as cn } from '../../chunks/cn-LM_JlZIN.js';
|
|
8
|
+
import 'viem';
|
|
9
|
+
import 'axe-core';
|
|
8
10
|
|
|
9
11
|
const style = ":host {\n\n display: inline-flex\n}\n\n:host([is-full-width]) {\n\n display: flex;\n\n width: 100%\n}";
|
|
10
12
|
|
|
@@ -41,7 +43,7 @@ class LuksoButton extends withTheme(TailwindStyledElement(style)) {
|
|
|
41
43
|
this.isPressed = false;
|
|
42
44
|
this.noTransition = false;
|
|
43
45
|
this.timer = 0;
|
|
44
|
-
this.counterStyles =
|
|
46
|
+
this.counterStyles = tv({
|
|
45
47
|
base: "ml-2 border border-neutral-20 rounded-4 px-[2px] py-[1px] paragraph-inter-10-semi-bold text-neutral-20 bg-neutral-100",
|
|
46
48
|
variants: {
|
|
47
49
|
isActive: {
|
|
@@ -49,7 +51,7 @@ class LuksoButton extends withTheme(TailwindStyledElement(style)) {
|
|
|
49
51
|
}
|
|
50
52
|
}
|
|
51
53
|
});
|
|
52
|
-
this.buttonStyles =
|
|
54
|
+
this.buttonStyles = tv({
|
|
53
55
|
base: `flex justify-center items-center relative text-center
|
|
54
56
|
border border-solid cursor-pointer transition
|
|
55
57
|
duration-250 active:scale-98 active:duration-25
|
|
@@ -156,7 +158,7 @@ class LuksoButton extends withTheme(TailwindStyledElement(style)) {
|
|
|
156
158
|
}
|
|
157
159
|
]
|
|
158
160
|
});
|
|
159
|
-
this.loadingStyles =
|
|
161
|
+
this.loadingStyles = tv({
|
|
160
162
|
slots: {
|
|
161
163
|
icon: "animate-spin",
|
|
162
164
|
text: ""
|
|
@@ -210,19 +212,19 @@ class LuksoButton extends withTheme(TailwindStyledElement(style)) {
|
|
|
210
212
|
const { icon, text } = this.loadingStyles({
|
|
211
213
|
size: this.size
|
|
212
214
|
});
|
|
213
|
-
return
|
|
215
|
+
return html`<lukso-icon
|
|
214
216
|
name="spinner"
|
|
215
217
|
size=${this.size}
|
|
216
218
|
color=${this.variant === "secondary" || this.variant === "text" ? "neutral-20" : "neutral-100"}
|
|
217
219
|
class=${icon()}
|
|
218
220
|
></lukso-icon>
|
|
219
|
-
${this.loadingText ?
|
|
221
|
+
${this.loadingText ? html`<span class=${text()}>${this.loadingText}</span>` : nothing}`;
|
|
220
222
|
}
|
|
221
223
|
counterTemplate() {
|
|
222
224
|
const counterStyles = this.counterStyles({
|
|
223
225
|
isActive: this.isActive
|
|
224
226
|
});
|
|
225
|
-
return
|
|
227
|
+
return html` <span class=${counterStyles}>${this.count}</span> `;
|
|
226
228
|
}
|
|
227
229
|
buttonTemplate() {
|
|
228
230
|
const buttonStyles = this.buttonStyles({
|
|
@@ -234,7 +236,7 @@ class LuksoButton extends withTheme(TailwindStyledElement(style)) {
|
|
|
234
236
|
isActive: this.isActive,
|
|
235
237
|
isIcon: this.isIcon
|
|
236
238
|
});
|
|
237
|
-
return
|
|
239
|
+
return html`
|
|
238
240
|
<button
|
|
239
241
|
data-testid="button"
|
|
240
242
|
?disabled=${this.disabled || this.isLoading}
|
|
@@ -248,8 +250,8 @@ class LuksoButton extends withTheme(TailwindStyledElement(style)) {
|
|
|
248
250
|
@mouseup=${this.handleMouseUp}
|
|
249
251
|
@mouseleave=${this.handleMouseUp}
|
|
250
252
|
>
|
|
251
|
-
${this.isLoading ? this.loadingTemplate() :
|
|
252
|
-
${this.count ? this.counterTemplate() :
|
|
253
|
+
${this.isLoading ? this.loadingTemplate() : html`<slot></slot>`}
|
|
254
|
+
${this.count ? this.counterTemplate() : nothing}
|
|
253
255
|
</button>
|
|
254
256
|
`;
|
|
255
257
|
}
|
|
@@ -262,7 +264,7 @@ class LuksoButton extends withTheme(TailwindStyledElement(style)) {
|
|
|
262
264
|
isPressed: this.isPressed,
|
|
263
265
|
isIcon: this.isIcon
|
|
264
266
|
});
|
|
265
|
-
return
|
|
267
|
+
return html`
|
|
266
268
|
<a
|
|
267
269
|
data-testid="link"
|
|
268
270
|
class=${cn(buttonStyles, this.customClass)}
|
|
@@ -276,68 +278,68 @@ class LuksoButton extends withTheme(TailwindStyledElement(style)) {
|
|
|
276
278
|
`;
|
|
277
279
|
}
|
|
278
280
|
render() {
|
|
279
|
-
return
|
|
281
|
+
return html` ${this.isLink ? this.linkTemplate() : this.buttonTemplate()} `;
|
|
280
282
|
}
|
|
281
283
|
}
|
|
282
284
|
__decorateClass([
|
|
283
|
-
|
|
285
|
+
property({ type: String })
|
|
284
286
|
], LuksoButton.prototype, "variant");
|
|
285
287
|
__decorateClass([
|
|
286
|
-
|
|
288
|
+
property({ type: String })
|
|
287
289
|
], LuksoButton.prototype, "size");
|
|
288
290
|
__decorateClass([
|
|
289
|
-
|
|
291
|
+
property({ type: Boolean })
|
|
290
292
|
], LuksoButton.prototype, "disabled");
|
|
291
293
|
__decorateClass([
|
|
292
|
-
|
|
294
|
+
property({ type: Boolean, attribute: "is-full-width" })
|
|
293
295
|
], LuksoButton.prototype, "isFullWidth");
|
|
294
296
|
__decorateClass([
|
|
295
|
-
|
|
297
|
+
property({ type: Boolean, attribute: "is-long-press" })
|
|
296
298
|
], LuksoButton.prototype, "isLongPress");
|
|
297
299
|
__decorateClass([
|
|
298
|
-
|
|
300
|
+
property({ type: Boolean, attribute: "is-link" })
|
|
299
301
|
], LuksoButton.prototype, "isLink");
|
|
300
302
|
__decorateClass([
|
|
301
|
-
|
|
303
|
+
property({ type: Boolean, attribute: "is-loading" })
|
|
302
304
|
], LuksoButton.prototype, "isLoading");
|
|
303
305
|
__decorateClass([
|
|
304
|
-
|
|
306
|
+
property({ type: String })
|
|
305
307
|
], LuksoButton.prototype, "type");
|
|
306
308
|
__decorateClass([
|
|
307
|
-
|
|
309
|
+
property({ type: String })
|
|
308
310
|
], LuksoButton.prototype, "href");
|
|
309
311
|
__decorateClass([
|
|
310
|
-
|
|
312
|
+
property({ type: String })
|
|
311
313
|
], LuksoButton.prototype, "target");
|
|
312
314
|
__decorateClass([
|
|
313
|
-
|
|
315
|
+
property({ type: String })
|
|
314
316
|
], LuksoButton.prototype, "rel");
|
|
315
317
|
__decorateClass([
|
|
316
|
-
|
|
318
|
+
property({ type: String, attribute: "loading-text" })
|
|
317
319
|
], LuksoButton.prototype, "loadingText");
|
|
318
320
|
__decorateClass([
|
|
319
|
-
|
|
321
|
+
property({ type: String, attribute: "custom-class" })
|
|
320
322
|
], LuksoButton.prototype, "customClass");
|
|
321
323
|
__decorateClass([
|
|
322
|
-
|
|
324
|
+
property({ type: Boolean, attribute: "is-active" })
|
|
323
325
|
], LuksoButton.prototype, "isActive");
|
|
324
326
|
__decorateClass([
|
|
325
|
-
|
|
327
|
+
property({ type: Number })
|
|
326
328
|
], LuksoButton.prototype, "count");
|
|
327
329
|
__decorateClass([
|
|
328
|
-
|
|
330
|
+
property({ type: Boolean, attribute: "is-icon" })
|
|
329
331
|
], LuksoButton.prototype, "isIcon");
|
|
330
332
|
__decorateClass([
|
|
331
|
-
|
|
333
|
+
property({ type: String })
|
|
332
334
|
], LuksoButton.prototype, "label");
|
|
333
335
|
__decorateClass([
|
|
334
|
-
|
|
336
|
+
state()
|
|
335
337
|
], LuksoButton.prototype, "isPressed");
|
|
336
338
|
__decorateClass([
|
|
337
|
-
|
|
339
|
+
state()
|
|
338
340
|
], LuksoButton.prototype, "noTransition");
|
|
339
341
|
__decorateClass([
|
|
340
|
-
|
|
342
|
+
state()
|
|
341
343
|
], LuksoButton.prototype, "timer");
|
|
342
344
|
customElements.define("lukso-button", LuksoButton);
|
|
343
345
|
|