@lukso/web-components 1.119.0 → 1.120.0
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/components/index.cjs +8 -7
- package/dist/components/index.js +8 -7
- package/dist/components/lukso-button/index.cjs +3 -3
- package/dist/components/lukso-button/index.js +3 -3
- package/dist/components/lukso-card/index.cjs +7 -7
- package/dist/components/lukso-card/index.js +7 -7
- package/dist/components/lukso-card/lukso-card.stories.d.ts.map +1 -1
- package/dist/components/lukso-checkbox/index.cjs +3 -3
- package/dist/components/lukso-checkbox/index.js +3 -3
- package/dist/components/lukso-color-picker/index.cjs +4 -4
- package/dist/components/lukso-color-picker/index.js +4 -4
- package/dist/components/lukso-dropdown/index.cjs +151 -12
- package/dist/components/lukso-dropdown/index.js +156 -8
- package/dist/components/lukso-dropdown-option/index.cjs +2 -2
- package/dist/components/lukso-dropdown-option/index.js +2 -2
- package/dist/components/lukso-footer/index.cjs +2 -2
- package/dist/components/lukso-footer/index.js +2 -2
- package/dist/components/lukso-icon/index.cjs +3 -3
- package/dist/components/lukso-icon/index.js +3 -3
- package/dist/components/lukso-image/index.cjs +4 -4
- package/dist/components/lukso-image/index.js +4 -4
- package/dist/components/lukso-input/index.cjs +4 -4
- package/dist/components/lukso-input/index.js +4 -4
- package/dist/components/lukso-modal/index.cjs +2 -2
- package/dist/components/lukso-modal/index.js +2 -2
- package/dist/components/lukso-navbar/index.cjs +5 -5
- package/dist/components/lukso-navbar/index.js +5 -5
- package/dist/components/lukso-pagination/index.cjs +4 -4
- package/dist/components/lukso-pagination/index.js +4 -4
- package/dist/components/lukso-profile/index.cjs +5 -5
- package/dist/components/lukso-profile/index.js +5 -5
- package/dist/components/lukso-progress/index.cjs +3 -3
- package/dist/components/lukso-progress/index.js +3 -3
- package/dist/components/lukso-sanitize/index.cjs +2 -2
- package/dist/components/lukso-sanitize/index.js +2 -2
- package/dist/components/lukso-search/index.cjs +8 -7
- package/dist/components/lukso-search/index.js +8 -7
- package/dist/components/lukso-select/index.cjs +76 -75
- package/dist/components/lukso-select/index.js +76 -75
- package/dist/components/lukso-share/index.cjs +24 -27
- package/dist/components/lukso-share/index.js +24 -27
- package/dist/components/lukso-switch/index.cjs +120 -38
- package/dist/components/lukso-switch/index.d.ts +12 -4
- package/dist/components/lukso-switch/index.d.ts.map +1 -1
- package/dist/components/lukso-switch/index.js +120 -38
- package/dist/components/lukso-switch/lukso-switch.stories.d.ts +8 -0
- package/dist/components/lukso-switch/lukso-switch.stories.d.ts.map +1 -1
- package/dist/components/lukso-tag/index.cjs +32 -35
- package/dist/components/lukso-tag/index.js +32 -35
- package/dist/components/lukso-terms/index.cjs +7 -10
- package/dist/components/lukso-terms/index.js +7 -10
- package/dist/components/lukso-test/index.cjs +13 -16
- package/dist/components/lukso-test/index.js +13 -16
- package/dist/components/lukso-textarea/index.cjs +83 -86
- package/dist/components/lukso-textarea/index.js +83 -86
- package/dist/components/lukso-tooltip/index.cjs +35 -38
- package/dist/components/lukso-tooltip/index.js +35 -38
- package/dist/components/lukso-username/index.cjs +50 -53
- package/dist/components/lukso-username/index.js +50 -53
- package/dist/components/lukso-wizard/index.cjs +42 -45
- package/dist/components/lukso-wizard/index.js +42 -45
- package/dist/{index-ff8d75cd.js → index-0fc204c6.js} +2 -2
- package/dist/{index-67915f32.cjs → index-2c4a91c9.cjs} +2 -2
- package/dist/{index-7bb28a79.js → index-81a8cb3d.js} +1 -1
- package/dist/{index-3926da18.cjs → index-b1f10728.cjs} +1 -1
- package/dist/index-c074fb48.js +37 -0
- package/dist/index-f785b4c0.cjs +46 -0
- package/dist/index.cjs +8 -7
- package/dist/index.js +8 -7
- package/dist/{property-bf2eee83.cjs → property-0715f936.cjs} +1 -1
- package/dist/{property-eaa52bd9.js → property-db140eda.js} +1 -1
- package/dist/shared/tailwind-element/index.cjs +1 -1
- package/dist/shared/tailwind-element/index.js +1 -1
- package/dist/{state-1fc9a224.js → state-13f19dcc.js} +1 -1
- package/dist/{state-375dfffc.cjs → state-908940e8.cjs} +1 -1
- package/dist/{style-map-8e54f508.cjs → style-map-074a8e8b.cjs} +1 -1
- package/dist/{style-map-5aef4b6f.js → style-map-3fe95282.js} +1 -1
- package/dist/uniq-id-ce2d165c.js +6 -0
- package/dist/uniq-id-f0b18085.cjs +8 -0
- package/package.json +1 -1
- package/dist/index-104cf124.cjs +0 -161
- package/dist/index-12775596.js +0 -159
- package/dist/index-68c61387.cjs +0 -48
- package/dist/index-92dc158d.js +0 -39
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { T as TailwindStyledElement, x, E } from '../../index-
|
|
2
|
-
import { n, t } from '../../property-
|
|
3
|
-
import { r } from '../../state-
|
|
1
|
+
import { T as TailwindStyledElement, x, E } from '../../index-c074fb48.js';
|
|
2
|
+
import { n, t } from '../../property-db140eda.js';
|
|
3
|
+
import { r } from '../../state-13f19dcc.js';
|
|
4
4
|
import { c as ce } from '../../index-d14b6a34.js';
|
|
5
|
-
import { m as makeBlockie } from '../../index-
|
|
5
|
+
import { m as makeBlockie } from '../../index-0fc204c6.js';
|
|
6
6
|
import '../lukso-icon/index.js';
|
|
7
7
|
import '../lukso-username/index.js';
|
|
8
|
-
import
|
|
8
|
+
import '../lukso-dropdown/index.js';
|
|
9
9
|
import '../lukso-dropdown-option/index.js';
|
|
10
|
+
import { u as uniqId } from '../../uniq-id-ce2d165c.js';
|
|
10
11
|
import '../lukso-image/index.js';
|
|
11
|
-
import '../../style-map-
|
|
12
|
+
import '../../style-map-3fe95282.js';
|
|
12
13
|
import '../../directive-2bb7789e.js';
|
|
13
|
-
import '../../index-
|
|
14
|
+
import '../../index-81a8cb3d.js';
|
|
14
15
|
import '../../tailwind-config.js';
|
|
15
16
|
import '../../cn-90c03edf.js';
|
|
16
17
|
|
|
@@ -28,84 +29,84 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
28
29
|
return result;
|
|
29
30
|
};
|
|
30
31
|
let LuksoSelect = class extends TailwindStyledElement(style) {
|
|
32
|
+
value = "";
|
|
33
|
+
placeholder = "";
|
|
34
|
+
label = "";
|
|
35
|
+
id = "";
|
|
36
|
+
description = "";
|
|
37
|
+
error = "";
|
|
38
|
+
isFullWidth = false;
|
|
39
|
+
isReadonly = false;
|
|
40
|
+
isDisabled = false;
|
|
41
|
+
borderless = false;
|
|
42
|
+
options = "";
|
|
43
|
+
selected = void 0;
|
|
44
|
+
isOpen = false;
|
|
45
|
+
openTop = false;
|
|
46
|
+
isLargeIcon = false;
|
|
47
|
+
isRight = false;
|
|
48
|
+
size = "medium";
|
|
49
|
+
showSelectionCounter = false;
|
|
50
|
+
optionsParsed = [];
|
|
51
|
+
valueParsed = void 0;
|
|
31
52
|
constructor() {
|
|
32
53
|
super();
|
|
33
|
-
this.
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
this.isFullWidth = false;
|
|
40
|
-
this.isReadonly = false;
|
|
41
|
-
this.isDisabled = false;
|
|
42
|
-
this.borderless = false;
|
|
43
|
-
this.options = "";
|
|
44
|
-
this.selected = void 0;
|
|
45
|
-
this.isOpen = false;
|
|
46
|
-
this.openTop = false;
|
|
47
|
-
this.isLargeIcon = false;
|
|
48
|
-
this.isRight = false;
|
|
49
|
-
this.size = "medium";
|
|
50
|
-
this.showSelectionCounter = false;
|
|
51
|
-
this.optionsParsed = [];
|
|
52
|
-
this.valueParsed = void 0;
|
|
53
|
-
this.inputStyles = ce({
|
|
54
|
-
base: `bg-neutral-100
|
|
54
|
+
if (!this.id) {
|
|
55
|
+
this.id = uniqId();
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
inputStyles = ce({
|
|
59
|
+
base: `bg-neutral-100
|
|
55
60
|
border border-solid placeholder:text-neutral-70 select-none whitespace-nowrap
|
|
56
61
|
outline-none transition transition-all duration-150 appearance-none
|
|
57
62
|
text-neutral-20 cursor-pointer border-neutral-90 group-hover:border-neutral-35
|
|
58
63
|
flex items-center`,
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
}
|
|
64
|
+
variants: {
|
|
65
|
+
isFullWidth: {
|
|
66
|
+
true: "w-full"
|
|
67
|
+
},
|
|
68
|
+
isDisabled: {
|
|
69
|
+
true: "cursor-not-allowed text-neutral-60 group-hover:border-neutral-90"
|
|
70
|
+
},
|
|
71
|
+
hasError: {
|
|
72
|
+
true: "border-red-85 group-hover:border-red-65"
|
|
73
|
+
},
|
|
74
|
+
borderless: {
|
|
75
|
+
true: "border-0"
|
|
76
|
+
},
|
|
77
|
+
size: {
|
|
78
|
+
small: "h-[28px] px-3 py-2 pr-8 paragraph-inter-12-regular rounded-8",
|
|
79
|
+
medium: "h-[48px] px-4 py-3 pr-11 paragraph-inter-14-regular rounded-12"
|
|
76
80
|
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
counterStyles = ce({
|
|
84
|
+
base: "border border-neutral-20",
|
|
85
|
+
variants: {
|
|
86
|
+
isDisabled: {
|
|
87
|
+
true: "opacity-60 cursor-not-allowed"
|
|
88
|
+
},
|
|
89
|
+
size: {
|
|
90
|
+
small: "paragraph-inter-10-semi-bold rounded-4 py-[1px] px-[5px] ml-1.5",
|
|
91
|
+
medium: "paragraph-inter-14-semi-bold rounded-8 py-[2px] px-[10px] ml-3"
|
|
88
92
|
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
iconStyles = ce({
|
|
96
|
+
base: "absolute right-0 transition cursor-pointer",
|
|
97
|
+
variants: {
|
|
98
|
+
isDisabled: {
|
|
99
|
+
true: "opacity-60 cursor-not-allowed"
|
|
100
|
+
},
|
|
101
|
+
isOpen: {
|
|
102
|
+
true: "rotate-180"
|
|
103
|
+
},
|
|
104
|
+
size: {
|
|
105
|
+
small: "mr-2",
|
|
106
|
+
medium: "mr-3"
|
|
103
107
|
}
|
|
104
|
-
});
|
|
105
|
-
if (!this.id) {
|
|
106
|
-
this.id = uniqId();
|
|
107
108
|
}
|
|
108
|
-
}
|
|
109
|
+
});
|
|
109
110
|
connectedCallback() {
|
|
110
111
|
super.connectedCallback();
|
|
111
112
|
window.addEventListener("click", this.handleOutsideDropdownClick.bind(this));
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
|
-
const shared_tailwindElement_index = require('../../index-
|
|
6
|
-
const property = require('../../property-
|
|
5
|
+
const shared_tailwindElement_index = require('../../index-f785b4c0.cjs');
|
|
6
|
+
const property = require('../../property-0715f936.cjs');
|
|
7
7
|
|
|
8
8
|
const style = ":host {\n display: inline-flex\n}";
|
|
9
9
|
|
|
@@ -19,31 +19,28 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
19
19
|
return result;
|
|
20
20
|
};
|
|
21
21
|
exports.LuksoShare = class LuksoShare extends shared_tailwindElement_index.TailwindStyledElement(style) {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
github: "https://github.com/lukso-network"
|
|
45
|
-
};
|
|
46
|
-
}
|
|
22
|
+
customStyle = "";
|
|
23
|
+
providers = "";
|
|
24
|
+
defaultProviders = [
|
|
25
|
+
"twitter",
|
|
26
|
+
"instagram",
|
|
27
|
+
"linkedin",
|
|
28
|
+
"telegram",
|
|
29
|
+
"discord",
|
|
30
|
+
"reddit",
|
|
31
|
+
"medium",
|
|
32
|
+
"github"
|
|
33
|
+
];
|
|
34
|
+
defaultProviderLinks = {
|
|
35
|
+
twitter: "https://twitter.com/ERC725Account",
|
|
36
|
+
instagram: "https://www.instagram.com/lukso",
|
|
37
|
+
linkedin: "https://linkedin.com/company/lukso",
|
|
38
|
+
telegram: "https://t.me/LUKSO_News",
|
|
39
|
+
discord: "https://discord.gg/lukso",
|
|
40
|
+
reddit: "https://www.reddit.com/r/lukso",
|
|
41
|
+
medium: "https://medium.com/lukso",
|
|
42
|
+
github: "https://github.com/lukso-network"
|
|
43
|
+
};
|
|
47
44
|
linkTemplate(name, url) {
|
|
48
45
|
return shared_tailwindElement_index.x`<a
|
|
49
46
|
href=${url}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { T as TailwindStyledElement, x } from '../../index-
|
|
2
|
-
import { n, t } from '../../property-
|
|
1
|
+
import { T as TailwindStyledElement, x } from '../../index-c074fb48.js';
|
|
2
|
+
import { n, t } from '../../property-db140eda.js';
|
|
3
3
|
|
|
4
4
|
const style = ":host {\n display: inline-flex\n}";
|
|
5
5
|
|
|
@@ -15,31 +15,28 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
15
15
|
return result;
|
|
16
16
|
};
|
|
17
17
|
let LuksoShare = class extends TailwindStyledElement(style) {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
github: "https://github.com/lukso-network"
|
|
41
|
-
};
|
|
42
|
-
}
|
|
18
|
+
customStyle = "";
|
|
19
|
+
providers = "";
|
|
20
|
+
defaultProviders = [
|
|
21
|
+
"twitter",
|
|
22
|
+
"instagram",
|
|
23
|
+
"linkedin",
|
|
24
|
+
"telegram",
|
|
25
|
+
"discord",
|
|
26
|
+
"reddit",
|
|
27
|
+
"medium",
|
|
28
|
+
"github"
|
|
29
|
+
];
|
|
30
|
+
defaultProviderLinks = {
|
|
31
|
+
twitter: "https://twitter.com/ERC725Account",
|
|
32
|
+
instagram: "https://www.instagram.com/lukso",
|
|
33
|
+
linkedin: "https://linkedin.com/company/lukso",
|
|
34
|
+
telegram: "https://t.me/LUKSO_News",
|
|
35
|
+
discord: "https://discord.gg/lukso",
|
|
36
|
+
reddit: "https://www.reddit.com/r/lukso",
|
|
37
|
+
medium: "https://medium.com/lukso",
|
|
38
|
+
github: "https://github.com/lukso-network"
|
|
39
|
+
};
|
|
43
40
|
linkTemplate(name, url) {
|
|
44
41
|
return x`<a
|
|
45
42
|
href=${url}
|
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
|
-
const shared_tailwindElement_index = require('../../index-
|
|
6
|
-
const property = require('../../property-
|
|
7
|
-
const styleMap = require('../../style-map-
|
|
8
|
-
const index = require('../../index-
|
|
5
|
+
const shared_tailwindElement_index = require('../../index-f785b4c0.cjs');
|
|
6
|
+
const property = require('../../property-0715f936.cjs');
|
|
7
|
+
const styleMap = require('../../style-map-074a8e8b.cjs');
|
|
8
|
+
const index = require('../../index-2b104ecb.cjs');
|
|
9
|
+
const uniqId = require('../../uniq-id-f0b18085.cjs');
|
|
9
10
|
require('../../directive-8278ab14.cjs');
|
|
10
11
|
|
|
11
12
|
var __defProp = Object.defineProperty;
|
|
@@ -19,18 +20,18 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
19
20
|
__defProp(target, key, result);
|
|
20
21
|
return result;
|
|
21
22
|
};
|
|
23
|
+
const DEFAULT_COLOR = "green-54";
|
|
22
24
|
exports.LuksoSwitch = class LuksoSwitch extends shared_tailwindElement_index.TailwindElement {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
25
|
+
color = DEFAULT_COLOR;
|
|
26
|
+
id = "";
|
|
27
|
+
name = "switch";
|
|
28
|
+
label = "";
|
|
29
|
+
description = "";
|
|
30
|
+
error = "";
|
|
31
|
+
isChecked = false;
|
|
32
|
+
isDisabled = false;
|
|
31
33
|
async handleChange(event) {
|
|
32
34
|
const target = event.target;
|
|
33
|
-
this.isChecked = target.checked;
|
|
34
35
|
await this.updateComplete;
|
|
35
36
|
const changeEvent = new CustomEvent("on-change", {
|
|
36
37
|
detail: {
|
|
@@ -42,41 +43,122 @@ exports.LuksoSwitch = class LuksoSwitch extends shared_tailwindElement_index.Tai
|
|
|
42
43
|
});
|
|
43
44
|
this.dispatchEvent(changeEvent);
|
|
44
45
|
}
|
|
45
|
-
|
|
46
|
+
constructor() {
|
|
47
|
+
super();
|
|
48
|
+
if (!this.id) {
|
|
49
|
+
this.id = `switch-${uniqId.uniqId()}`;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
styles = index.ce({
|
|
53
|
+
slots: {
|
|
54
|
+
label: "transition duration-300 ease-in block h-6 overflow-hidden rounded-full relative inline-block w-10",
|
|
55
|
+
input: "absolute block w-6 h-6 rounded-full bg-white border-2 appearance-none transition duration-300 ease-in"
|
|
56
|
+
},
|
|
57
|
+
variants: {
|
|
58
|
+
isChecked: {
|
|
59
|
+
true: {
|
|
60
|
+
input: "translate-x-4"
|
|
61
|
+
},
|
|
62
|
+
false: {
|
|
63
|
+
label: "bg-neutral-90",
|
|
64
|
+
input: "border-neutral-90"
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
isDisabled: {
|
|
68
|
+
true: {
|
|
69
|
+
label: "opacity-70 cursor-not-allowed",
|
|
70
|
+
input: "cursor-not-allowed"
|
|
71
|
+
},
|
|
72
|
+
false: {
|
|
73
|
+
label: "cursor-pointer",
|
|
74
|
+
input: "cursor-pointer"
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
hasError: {
|
|
78
|
+
true: {
|
|
79
|
+
label: "!bg-red-65",
|
|
80
|
+
input: "!border-red-65"
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
labelTemplate() {
|
|
46
86
|
return shared_tailwindElement_index.x`
|
|
47
|
-
<
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
[this.defaultLabelStyles]: true
|
|
51
|
-
})}
|
|
52
|
-
style=${styleMap.o({
|
|
53
|
-
backgroundColor: `var(--${this.isChecked ? this.color : "neutral-90"})`,
|
|
54
|
-
opacity: this.isDisabled ? 0.7 : 1,
|
|
55
|
-
cursor: this.isDisabled ? "not-allowed" : "pointer"
|
|
56
|
-
})}
|
|
87
|
+
<div
|
|
88
|
+
class="heading-inter-14-bold text-neutral-20 pb-2 block"
|
|
89
|
+
>${this.label}</label
|
|
57
90
|
>
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
91
|
+
`;
|
|
92
|
+
}
|
|
93
|
+
descriptionTemplate() {
|
|
94
|
+
return shared_tailwindElement_index.x`
|
|
95
|
+
<div class="paragraph-inter-12-regular text-neutral-20 pb-2">
|
|
96
|
+
${this.description ?? shared_tailwindElement_index.E}
|
|
97
|
+
</div>
|
|
98
|
+
`;
|
|
99
|
+
}
|
|
100
|
+
errorTemplate() {
|
|
101
|
+
return shared_tailwindElement_index.x`<div class="paragraph-inter-12-regular text-red-65 pt-2">
|
|
102
|
+
${this.error}
|
|
103
|
+
</div>`;
|
|
104
|
+
}
|
|
105
|
+
render() {
|
|
106
|
+
const { label, input } = this.styles({
|
|
107
|
+
isChecked: this.isChecked,
|
|
108
|
+
isDisabled: this.isDisabled,
|
|
109
|
+
hasError: this.error !== ""
|
|
110
|
+
});
|
|
111
|
+
if (!this.color) {
|
|
112
|
+
this.color = DEFAULT_COLOR;
|
|
113
|
+
}
|
|
114
|
+
return shared_tailwindElement_index.x`
|
|
115
|
+
<label for=${this.id} class="w-[inherit]">
|
|
116
|
+
${this.label ? this.labelTemplate() : shared_tailwindElement_index.E}
|
|
117
|
+
${this.description ? this.descriptionTemplate() : shared_tailwindElement_index.E}
|
|
118
|
+
<div class="flex">
|
|
119
|
+
<div
|
|
120
|
+
class=${label()}
|
|
121
|
+
style=${styleMap.o({
|
|
122
|
+
backgroundColor: `var(--${this.isChecked ? this.color : "neutral-90"})`
|
|
66
123
|
})}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
124
|
+
>
|
|
125
|
+
<input
|
|
126
|
+
type="checkbox"
|
|
127
|
+
id=${this.id}
|
|
128
|
+
name=${this.name}
|
|
129
|
+
?checked=${this.isChecked}
|
|
130
|
+
?disabled=${this.isDisabled}
|
|
131
|
+
class=${input()}
|
|
132
|
+
style=${styleMap.o({
|
|
133
|
+
borderColor: `var(--${this.isChecked ? this.color : "neutral-90"})`
|
|
70
134
|
})}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
135
|
+
@change=${this.handleChange}
|
|
136
|
+
/>
|
|
137
|
+
</label>
|
|
138
|
+
</div>
|
|
139
|
+
${this.error ? this.errorTemplate() : shared_tailwindElement_index.E}
|
|
140
|
+
</div>
|
|
74
141
|
`;
|
|
75
142
|
}
|
|
76
143
|
};
|
|
77
144
|
__decorateClass([
|
|
78
145
|
property.n({ type: String })
|
|
79
146
|
], exports.LuksoSwitch.prototype, "color", 2);
|
|
147
|
+
__decorateClass([
|
|
148
|
+
property.n({ type: String })
|
|
149
|
+
], exports.LuksoSwitch.prototype, "id", 2);
|
|
150
|
+
__decorateClass([
|
|
151
|
+
property.n({ type: String })
|
|
152
|
+
], exports.LuksoSwitch.prototype, "name", 2);
|
|
153
|
+
__decorateClass([
|
|
154
|
+
property.n({ type: String })
|
|
155
|
+
], exports.LuksoSwitch.prototype, "label", 2);
|
|
156
|
+
__decorateClass([
|
|
157
|
+
property.n({ type: String })
|
|
158
|
+
], exports.LuksoSwitch.prototype, "description", 2);
|
|
159
|
+
__decorateClass([
|
|
160
|
+
property.n({ type: String })
|
|
161
|
+
], exports.LuksoSwitch.prototype, "error", 2);
|
|
80
162
|
__decorateClass([
|
|
81
163
|
property.n({ type: Boolean, attribute: "is-checked" })
|
|
82
164
|
], exports.LuksoSwitch.prototype, "isChecked", 2);
|
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
import { TailwindElement } from '../../shared/tailwind-element';
|
|
2
2
|
export declare class LuksoSwitch extends TailwindElement {
|
|
3
3
|
color: string;
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
label: string;
|
|
7
|
+
description: string;
|
|
8
|
+
error: string;
|
|
9
|
+
isChecked: boolean;
|
|
10
|
+
isDisabled: boolean;
|
|
6
11
|
private handleChange;
|
|
7
|
-
|
|
8
|
-
private
|
|
12
|
+
constructor();
|
|
13
|
+
private styles;
|
|
14
|
+
labelTemplate(): import("lit-html").TemplateResult<1>;
|
|
15
|
+
descriptionTemplate(): import("lit-html").TemplateResult<1>;
|
|
16
|
+
errorTemplate(): import("lit-html").TemplateResult<1>;
|
|
9
17
|
render(): import("lit-html").TemplateResult<1>;
|
|
10
18
|
}
|
|
11
19
|
declare global {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/lukso-switch/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/lukso-switch/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAI3D,qBACa,WAAY,SAAQ,eAAe;IAE9C,KAAK,SAAgB;IAGrB,EAAE,SAAK;IAGP,IAAI,SAAW;IAGf,KAAK,SAAK;IAGV,WAAW,SAAK;IAGhB,KAAK,SAAK;IAGV,SAAS,UAAQ;IAMjB,UAAU,UAAQ;YAEJ,YAAY;;IAsB1B,OAAO,CAAC,MAAM,CAkCZ;IAEF,aAAa;IASb,mBAAmB;IAQnB,aAAa;IAMb,MAAM;CA4CP;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,cAAc,EAAE,WAAW,CAAA;KAC5B;CACF"}
|