@lukso/web-components 1.31.1 → 1.32.1
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/README.md +4 -4
- package/dist/components/index.cjs +2 -2
- package/dist/components/index.js +2 -2
- package/dist/components/lukso-button/index.cjs +1 -1
- package/dist/components/lukso-button/index.js +1 -1
- package/dist/components/lukso-card/index.cjs +58 -3
- package/dist/components/lukso-card/index.d.ts +2 -1
- package/dist/components/lukso-card/index.js +58 -3
- package/dist/components/lukso-card/lukso-card.stories.d.ts +2 -0
- package/dist/components/lukso-card/lukso-card.stories.d.ts.map +1 -1
- package/dist/components/lukso-checkbox/index.cjs +38 -115
- package/dist/components/lukso-checkbox/index.d.ts +1 -12
- package/dist/components/lukso-checkbox/index.js +38 -115
- package/dist/components/lukso-checkbox/lukso-checkbox.stories.d.ts.map +1 -1
- package/dist/components/lukso-footer/index.cjs +1 -1
- package/dist/components/lukso-footer/index.js +1 -1
- package/dist/components/lukso-icon/index.cjs +2 -2
- package/dist/components/lukso-icon/index.js +2 -2
- package/dist/components/lukso-input/index.cjs +11 -5
- package/dist/components/lukso-input/index.d.ts +1 -0
- package/dist/components/lukso-input/index.js +11 -5
- package/dist/components/lukso-input/lukso-input.stories.d.ts +2 -0
- package/dist/components/lukso-input/lukso-input.stories.d.ts.map +1 -1
- package/dist/components/lukso-modal/index.cjs +1 -1
- package/dist/components/lukso-modal/index.js +1 -1
- package/dist/components/lukso-navbar/index.cjs +2 -2
- package/dist/components/lukso-navbar/index.js +2 -2
- package/dist/components/lukso-profile/index.cjs +2 -2
- package/dist/components/lukso-profile/index.js +2 -2
- package/dist/components/lukso-progress/index.cjs +1 -1
- package/dist/components/lukso-progress/index.js +1 -1
- package/dist/components/lukso-sanitize/index.cjs +1 -1
- package/dist/components/lukso-sanitize/index.js +1 -1
- package/dist/components/lukso-share/index.cjs +1 -1
- package/dist/components/lukso-share/index.js +1 -1
- package/dist/components/lukso-switch/index.cjs +2 -2
- package/dist/components/lukso-switch/index.js +2 -2
- package/dist/components/lukso-tag/index.cjs +2 -2
- package/dist/components/lukso-tag/index.js +2 -2
- package/dist/components/lukso-terms/index.cjs +2 -2
- package/dist/components/lukso-terms/index.js +2 -2
- package/dist/components/lukso-test/index.cjs +1 -1
- package/dist/components/lukso-test/index.js +1 -1
- package/dist/components/lukso-username/index.cjs +6 -1
- package/dist/components/lukso-username/index.d.ts +1 -0
- package/dist/components/lukso-username/index.js +6 -1
- package/dist/components/lukso-wizard/index.cjs +1 -1
- package/dist/components/lukso-wizard/index.js +1 -1
- package/dist/index-0910f19f.cjs +61 -0
- package/dist/index-bbe92b0f.js +54 -0
- package/dist/index.cjs +2 -2
- package/dist/index.js +2 -2
- package/dist/shared/tailwind-element/index.cjs +1 -1
- package/dist/shared/tailwind-element/index.js +1 -1
- package/dist/{style-map-abc9b925.js → style-map-62fb8069.js} +1 -1
- package/dist/{style-map-11254084.cjs → style-map-8491c144.cjs} +1 -1
- package/package.json +1 -1
- package/dist/index-2754b007.js +0 -54
- package/dist/index-6683f423.cjs +0 -61
package/README.md
CHANGED
|
@@ -73,7 +73,7 @@ module.exports = {
|
|
|
73
73
|
// main.scss
|
|
74
74
|
$font-file-path: '/assets/fonts';
|
|
75
75
|
|
|
76
|
-
@import '@lukso/web-components/sass/main.scss';
|
|
76
|
+
@import '@lukso/web-components/tools/sass/main.scss';
|
|
77
77
|
```
|
|
78
78
|
|
|
79
79
|
##### 3. Add script to copy assets in your build config
|
|
@@ -81,8 +81,8 @@ $font-file-path: '/assets/fonts';
|
|
|
81
81
|
In order to use other files like fonts or images from library we need to manually copy them to your project. This is ESM limitation that allow to import only `js` files.
|
|
82
82
|
|
|
83
83
|
```ts
|
|
84
|
-
import { copyAssets } from '@lukso/web-components/copy-assets'
|
|
85
|
-
import assets from '@lukso/web-components/assets'
|
|
84
|
+
import { copyAssets } from '@lukso/web-components/tools/copy-assets'
|
|
85
|
+
import assets from '@lukso/web-components/tools/assets'
|
|
86
86
|
|
|
87
87
|
copyAssets('./src', assets)
|
|
88
88
|
```
|
|
@@ -97,7 +97,7 @@ Atm the only thing that you can benefit from non Tailwind CSS projects is loadin
|
|
|
97
97
|
// main.scss
|
|
98
98
|
$font-file-path: '/assets/fonts';
|
|
99
99
|
|
|
100
|
-
@import '@lukso/web-components/sass/fonts.scss';
|
|
100
|
+
@import '@lukso/web-components/tools/sass/fonts.scss';
|
|
101
101
|
```
|
|
102
102
|
|
|
103
103
|
## Development workflow
|
|
@@ -20,11 +20,11 @@ const components_luksoTerms_index = require('./lukso-terms/index.cjs');
|
|
|
20
20
|
const components_luksoTest_index = require('./lukso-test/index.cjs');
|
|
21
21
|
const components_luksoUsername_index = require('./lukso-username/index.cjs');
|
|
22
22
|
const components_luksoWizard_index = require('./lukso-wizard/index.cjs');
|
|
23
|
-
const shared_tailwindElement_index = require('../index-
|
|
23
|
+
const shared_tailwindElement_index = require('../index-0910f19f.cjs');
|
|
24
24
|
require('../directive-db00f5fb.cjs');
|
|
25
25
|
require('../state-a62a7d5d.cjs');
|
|
26
26
|
require('../index-7dc05ee5.cjs');
|
|
27
|
-
require('../style-map-
|
|
27
|
+
require('../style-map-8491c144.cjs');
|
|
28
28
|
require('../style-map-ce3031bc.cjs');
|
|
29
29
|
|
|
30
30
|
|
package/dist/components/index.js
CHANGED
|
@@ -16,9 +16,9 @@ export { LuksoTerms } from './lukso-terms/index.js';
|
|
|
16
16
|
export { LuksoTest } from './lukso-test/index.js';
|
|
17
17
|
export { LuksoUsername } from './lukso-username/index.js';
|
|
18
18
|
export { LuksoWizard } from './lukso-wizard/index.js';
|
|
19
|
-
export { a as TailwindElement, T as TailwindStyledElement } from '../index-
|
|
19
|
+
export { a as TailwindElement, T as TailwindStyledElement } from '../index-bbe92b0f.js';
|
|
20
20
|
import '../directive-9ec64c08.js';
|
|
21
21
|
import '../state-7fde94d1.js';
|
|
22
22
|
import '../index-714323c9.js';
|
|
23
|
-
import '../style-map-
|
|
23
|
+
import '../style-map-62fb8069.js';
|
|
24
24
|
import '../style-map-06219dec.js';
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
|
-
const shared_tailwindElement_index = require('../../index-
|
|
5
|
+
const shared_tailwindElement_index = require('../../index-0910f19f.cjs');
|
|
6
6
|
const directive = require('../../directive-db00f5fb.cjs');
|
|
7
7
|
const state = require('../../state-a62a7d5d.cjs');
|
|
8
8
|
const index = require('../../index-7dc05ee5.cjs');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { T as TailwindStyledElement, x } from '../../index-
|
|
1
|
+
import { T as TailwindStyledElement, x } from '../../index-bbe92b0f.js';
|
|
2
2
|
import { e, a as e$1 } from '../../directive-9ec64c08.js';
|
|
3
3
|
import { t } from '../../state-7fde94d1.js';
|
|
4
4
|
import { c as customClassMap } from '../../index-714323c9.js';
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
|
-
const shared_tailwindElement_index = require('../../index-
|
|
5
|
+
const shared_tailwindElement_index = require('../../index-0910f19f.cjs');
|
|
6
6
|
const directive = require('../../directive-db00f5fb.cjs');
|
|
7
|
-
const styleMap = require('../../style-map-
|
|
7
|
+
const styleMap = require('../../style-map-8491c144.cjs');
|
|
8
8
|
const index = require('../../index-7dc05ee5.cjs');
|
|
9
9
|
require('../lukso-profile/index.cjs');
|
|
10
10
|
|
|
@@ -100,7 +100,7 @@ exports.LuksoCard = class LuksoCard extends shared_tailwindElement_index.Tailwin
|
|
|
100
100
|
class="min-h-[129px] -mb-6 bg-center bg-cover rounded-[24px_24px_0_0] relative"
|
|
101
101
|
>
|
|
102
102
|
<div
|
|
103
|
-
class="min-h-full min-w-full rounded-[24px_24px_0_0] bg-neutral-
|
|
103
|
+
class="min-h-full min-w-full rounded-[24px_24px_0_0] bg-neutral-90 absolute"
|
|
104
104
|
></div>
|
|
105
105
|
<div>
|
|
106
106
|
<slot name="header"></slot>
|
|
@@ -129,12 +129,67 @@ exports.LuksoCard = class LuksoCard extends shared_tailwindElement_index.Tailwin
|
|
|
129
129
|
</div>
|
|
130
130
|
`;
|
|
131
131
|
}
|
|
132
|
+
profile2Template() {
|
|
133
|
+
return shared_tailwindElement_index.x`
|
|
134
|
+
<div
|
|
135
|
+
data-testid="card"
|
|
136
|
+
class="bg-neutral-100 grid grid-rows-[auto,1fr] ${index.customClassMap({
|
|
137
|
+
[this.mediumStyles]: !this.customClass && this.size === "medium",
|
|
138
|
+
[this.smallStyles]: !this.customClass && this.size === "small",
|
|
139
|
+
[this.smallHoverStyles]: this.isHoverable && this.size === "small",
|
|
140
|
+
[this.customClass]: !!this.customClass,
|
|
141
|
+
["w-[362px]"]: this.isFixedWidth,
|
|
142
|
+
["min-h-[534px]"]: this.isFixedHeight,
|
|
143
|
+
["w-full"]: this.isFullWidth
|
|
144
|
+
})}"
|
|
145
|
+
>
|
|
146
|
+
<div
|
|
147
|
+
style=${styleMap.o({
|
|
148
|
+
backgroundImage: `url(${this.backgroundUrl})`
|
|
149
|
+
})}
|
|
150
|
+
class="min-h-[129px] -mb-6 bg-center bg-cover rounded-[24px_24px_0_0] relative"
|
|
151
|
+
>
|
|
152
|
+
<div
|
|
153
|
+
class="min-h-full min-w-full rounded-[24px_24px_0_0] bg-neutral-10 absolute opacity-10"
|
|
154
|
+
></div>
|
|
155
|
+
<div>
|
|
156
|
+
<slot name="header"></slot>
|
|
157
|
+
</div>
|
|
158
|
+
</div>
|
|
159
|
+
<div class="grid grid-rows-[max-content,auto]">
|
|
160
|
+
<div class="bg-neutral-100 shadow-neutral-drop-shadow relative">
|
|
161
|
+
<lukso-profile
|
|
162
|
+
profile-url=${this.profileUrl}
|
|
163
|
+
size="large"
|
|
164
|
+
profile-address=${this.profileAddress}
|
|
165
|
+
has-identicon
|
|
166
|
+
class="absolute -top-[40px] left-[calc(50%_-_40px)] z-10"
|
|
167
|
+
></lukso-profile>
|
|
168
|
+
<div
|
|
169
|
+
class="overflow-hidden w-[153px] h-[70px] -top-[70px] relative mx-auto flex items-end justify-center -mb-2"
|
|
170
|
+
>
|
|
171
|
+
<div
|
|
172
|
+
class="bg-neutral-100 rounded-[103px_103px_0_0] w-[96px] h-[48px]
|
|
173
|
+
shadow-neutral-above-shadow-1xl"
|
|
174
|
+
></div>
|
|
175
|
+
</div>
|
|
176
|
+
<slot name="content"></slot>
|
|
177
|
+
</div>
|
|
178
|
+
<div class="bg-neutral-97 rounded-b-24">
|
|
179
|
+
<slot name="bottom"></slot>
|
|
180
|
+
</div>
|
|
181
|
+
</div>
|
|
182
|
+
</div>
|
|
183
|
+
`;
|
|
184
|
+
}
|
|
132
185
|
render() {
|
|
133
186
|
switch (this.variant) {
|
|
134
187
|
case "with-header":
|
|
135
188
|
return this.withHeaderTemplate();
|
|
136
189
|
case "profile":
|
|
137
190
|
return this.profileTemplate();
|
|
191
|
+
case "profile-2":
|
|
192
|
+
return this.profile2Template();
|
|
138
193
|
default:
|
|
139
194
|
return this.basicTemplate();
|
|
140
195
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type CardVariants = 'basic' | 'with-header' | 'profile';
|
|
1
|
+
export type CardVariants = 'basic' | 'with-header' | 'profile' | 'profile-2';
|
|
2
2
|
export type CardSizes = 'small' | 'medium';
|
|
3
3
|
declare const LuksoCard_base: typeof import("lit").LitElement;
|
|
4
4
|
export declare class LuksoCard extends LuksoCard_base {
|
|
@@ -18,6 +18,7 @@ export declare class LuksoCard extends LuksoCard_base {
|
|
|
18
18
|
basicTemplate(): import("lit").TemplateResult<1>;
|
|
19
19
|
withHeaderTemplate(): import("lit").TemplateResult<1>;
|
|
20
20
|
profileTemplate(): import("lit").TemplateResult<1>;
|
|
21
|
+
profile2Template(): import("lit").TemplateResult<1>;
|
|
21
22
|
render(): import("lit").TemplateResult<1>;
|
|
22
23
|
}
|
|
23
24
|
declare global {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { T as TailwindStyledElement, x } from '../../index-
|
|
1
|
+
import { T as TailwindStyledElement, x } from '../../index-bbe92b0f.js';
|
|
2
2
|
import { e, a as e$1 } from '../../directive-9ec64c08.js';
|
|
3
|
-
import { o } from '../../style-map-
|
|
3
|
+
import { o } from '../../style-map-62fb8069.js';
|
|
4
4
|
import { c as customClassMap } from '../../index-714323c9.js';
|
|
5
5
|
import '../lukso-profile/index.js';
|
|
6
6
|
|
|
@@ -96,7 +96,7 @@ let LuksoCard = class extends TailwindStyledElement(style) {
|
|
|
96
96
|
class="min-h-[129px] -mb-6 bg-center bg-cover rounded-[24px_24px_0_0] relative"
|
|
97
97
|
>
|
|
98
98
|
<div
|
|
99
|
-
class="min-h-full min-w-full rounded-[24px_24px_0_0] bg-neutral-
|
|
99
|
+
class="min-h-full min-w-full rounded-[24px_24px_0_0] bg-neutral-90 absolute"
|
|
100
100
|
></div>
|
|
101
101
|
<div>
|
|
102
102
|
<slot name="header"></slot>
|
|
@@ -125,12 +125,67 @@ let LuksoCard = class extends TailwindStyledElement(style) {
|
|
|
125
125
|
</div>
|
|
126
126
|
`;
|
|
127
127
|
}
|
|
128
|
+
profile2Template() {
|
|
129
|
+
return x`
|
|
130
|
+
<div
|
|
131
|
+
data-testid="card"
|
|
132
|
+
class="bg-neutral-100 grid grid-rows-[auto,1fr] ${customClassMap({
|
|
133
|
+
[this.mediumStyles]: !this.customClass && this.size === "medium",
|
|
134
|
+
[this.smallStyles]: !this.customClass && this.size === "small",
|
|
135
|
+
[this.smallHoverStyles]: this.isHoverable && this.size === "small",
|
|
136
|
+
[this.customClass]: !!this.customClass,
|
|
137
|
+
["w-[362px]"]: this.isFixedWidth,
|
|
138
|
+
["min-h-[534px]"]: this.isFixedHeight,
|
|
139
|
+
["w-full"]: this.isFullWidth
|
|
140
|
+
})}"
|
|
141
|
+
>
|
|
142
|
+
<div
|
|
143
|
+
style=${o({
|
|
144
|
+
backgroundImage: `url(${this.backgroundUrl})`
|
|
145
|
+
})}
|
|
146
|
+
class="min-h-[129px] -mb-6 bg-center bg-cover rounded-[24px_24px_0_0] relative"
|
|
147
|
+
>
|
|
148
|
+
<div
|
|
149
|
+
class="min-h-full min-w-full rounded-[24px_24px_0_0] bg-neutral-10 absolute opacity-10"
|
|
150
|
+
></div>
|
|
151
|
+
<div>
|
|
152
|
+
<slot name="header"></slot>
|
|
153
|
+
</div>
|
|
154
|
+
</div>
|
|
155
|
+
<div class="grid grid-rows-[max-content,auto]">
|
|
156
|
+
<div class="bg-neutral-100 shadow-neutral-drop-shadow relative">
|
|
157
|
+
<lukso-profile
|
|
158
|
+
profile-url=${this.profileUrl}
|
|
159
|
+
size="large"
|
|
160
|
+
profile-address=${this.profileAddress}
|
|
161
|
+
has-identicon
|
|
162
|
+
class="absolute -top-[40px] left-[calc(50%_-_40px)] z-10"
|
|
163
|
+
></lukso-profile>
|
|
164
|
+
<div
|
|
165
|
+
class="overflow-hidden w-[153px] h-[70px] -top-[70px] relative mx-auto flex items-end justify-center -mb-2"
|
|
166
|
+
>
|
|
167
|
+
<div
|
|
168
|
+
class="bg-neutral-100 rounded-[103px_103px_0_0] w-[96px] h-[48px]
|
|
169
|
+
shadow-neutral-above-shadow-1xl"
|
|
170
|
+
></div>
|
|
171
|
+
</div>
|
|
172
|
+
<slot name="content"></slot>
|
|
173
|
+
</div>
|
|
174
|
+
<div class="bg-neutral-97 rounded-b-24">
|
|
175
|
+
<slot name="bottom"></slot>
|
|
176
|
+
</div>
|
|
177
|
+
</div>
|
|
178
|
+
</div>
|
|
179
|
+
`;
|
|
180
|
+
}
|
|
128
181
|
render() {
|
|
129
182
|
switch (this.variant) {
|
|
130
183
|
case "with-header":
|
|
131
184
|
return this.withHeaderTemplate();
|
|
132
185
|
case "profile":
|
|
133
186
|
return this.profileTemplate();
|
|
187
|
+
case "profile-2":
|
|
188
|
+
return this.profile2Template();
|
|
134
189
|
default:
|
|
135
190
|
return this.basicTemplate();
|
|
136
191
|
}
|
|
@@ -14,6 +14,8 @@ export declare const CardWithHeader: any;
|
|
|
14
14
|
export declare const CardWithCustomHeader: any;
|
|
15
15
|
/** Example of `profile` variant. This variant additionally uses `background-url`, `profile-url` and `profile-address` properties. */
|
|
16
16
|
export declare const ProfileCard: any;
|
|
17
|
+
/** Example of `profile-2` variant. */
|
|
18
|
+
export declare const Profile2Card: any;
|
|
17
19
|
/** You can customize card with `custom-class` property, it will be used instead of default styles. */
|
|
18
20
|
export declare const CustomCard: any;
|
|
19
21
|
/** You can select card size with `size` property. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lukso-card.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/lukso-card/lukso-card.stories.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAA;AAEhD,OAAO,SAAS,CAAA;AAEhB,qJAAqJ;AACrJ,QAAA,MAAM,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"lukso-card.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/lukso-card/lukso-card.stories.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAA;AAEhD,OAAO,SAAS,CAAA;AAEhB,qJAAqJ;AACrJ,QAAA,MAAM,IAAI,EAAE,IA8IX,CAAA;AAED,eAAe,IAAI,CAAA;AAwFnB,iDAAiD;AACjD,eAAO,MAAM,WAAW,KAA2B,CAAA;AAQnD,qGAAqG;AACrG,eAAO,MAAM,SAAS,KAA2B,CAAA;AAYjD,kGAAkG;AAClG,eAAO,MAAM,aAAa,KAA2B,CAAA;AAWrD,wCAAwC;AACxC,eAAO,MAAM,cAAc,KAA2B,CAAA;AAatD,+EAA+E;AAC/E,eAAO,MAAM,oBAAoB,KAAgC,CAAA;AAajE,sIAAsI;AACtI,eAAO,MAAM,WAAW,KAA2B,CAAA;AAmBnD,uCAAuC;AACvC,eAAO,MAAM,YAAY,KAA2B,CAAA;AAOpD,uGAAuG;AACvG,eAAO,MAAM,UAAU,KAA2B,CAAA;AAalD,sDAAsD;AACtD,eAAO,MAAM,SAAS,KAA2B,CAAA;AAKjD,sEAAsE;AACtE,eAAO,MAAM,aAAa,KAA2B,CAAA"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
|
-
const shared_tailwindElement_index = require('../../index-
|
|
5
|
+
const shared_tailwindElement_index = require('../../index-0910f19f.cjs');
|
|
6
6
|
const directive = require('../../directive-db00f5fb.cjs');
|
|
7
7
|
const state = require('../../state-a62a7d5d.cjs');
|
|
8
8
|
const index = require('../../index-7dc05ee5.cjs');
|
|
@@ -22,27 +22,19 @@ exports.LuksoCheckbox = class LuksoCheckbox extends shared_tailwindElement_index
|
|
|
22
22
|
constructor() {
|
|
23
23
|
super(...arguments);
|
|
24
24
|
this.name = "";
|
|
25
|
-
this.label = "";
|
|
26
25
|
this.id = "";
|
|
27
26
|
this.ref = void 0;
|
|
28
27
|
this.type = "text";
|
|
29
28
|
this.size = "medium";
|
|
30
29
|
this.error = "";
|
|
31
|
-
this.
|
|
32
|
-
this.profileAddress = "";
|
|
33
|
-
this.hasIdenticon = false;
|
|
34
|
-
this.upUsername = "";
|
|
35
|
-
this.upAddress = "";
|
|
30
|
+
this.checked = false;
|
|
36
31
|
this.customClass = "";
|
|
37
32
|
this.isReadonly = false;
|
|
38
33
|
this.isDisabled = false;
|
|
39
|
-
this.isChecked = false;
|
|
40
34
|
this.hasFocus = false;
|
|
41
|
-
this.hasChecked = false;
|
|
42
35
|
this.hasHighlight = false;
|
|
43
36
|
this.defaultContainerStyles = `
|
|
44
|
-
flex items-center
|
|
45
|
-
border border-solid border-neutral-100
|
|
37
|
+
flex items-center gap-2
|
|
46
38
|
select-none
|
|
47
39
|
`;
|
|
48
40
|
this.defaultInputStyles = `
|
|
@@ -52,7 +44,7 @@ exports.LuksoCheckbox = class LuksoCheckbox extends shared_tailwindElement_index
|
|
|
52
44
|
opacity-0
|
|
53
45
|
`;
|
|
54
46
|
this.defaultLabelStyles = `
|
|
55
|
-
|
|
47
|
+
text-neutral-20 block
|
|
56
48
|
`;
|
|
57
49
|
this.defaultCheckboxStyles = `
|
|
58
50
|
relative
|
|
@@ -61,25 +53,14 @@ exports.LuksoCheckbox = class LuksoCheckbox extends shared_tailwindElement_index
|
|
|
61
53
|
border border-solid rounded-md
|
|
62
54
|
outline-none transition transition-all duration-150 appearance-none`;
|
|
63
55
|
}
|
|
64
|
-
connectedCallback() {
|
|
65
|
-
super.connectedCallback();
|
|
66
|
-
this.hasChecked = this.isChecked;
|
|
67
|
-
}
|
|
68
|
-
attributeChangedCallback(name, _old, value) {
|
|
69
|
-
super.attributeChangedCallback(name, _old, value);
|
|
70
|
-
if (name === "is-checked") {
|
|
71
|
-
this.hasChecked = this.isChecked;
|
|
72
|
-
this.requestUpdate();
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
56
|
checkedIconTemplate() {
|
|
76
57
|
return shared_tailwindElement_index.x`
|
|
77
58
|
<lukso-icon
|
|
78
59
|
class=${index.customClassMap({
|
|
79
|
-
hidden: !this.
|
|
60
|
+
hidden: !this.checked
|
|
80
61
|
})}
|
|
81
62
|
name="tick"
|
|
82
|
-
color
|
|
63
|
+
color=${this.isDisabled ? "neutral-60" : "neutral-20"}
|
|
83
64
|
></lukso-icon>
|
|
84
65
|
`;
|
|
85
66
|
}
|
|
@@ -90,9 +71,7 @@ exports.LuksoCheckbox = class LuksoCheckbox extends shared_tailwindElement_index
|
|
|
90
71
|
[this.defaultCheckboxStyles]: true,
|
|
91
72
|
[this.error === "" ? "border-neutral-90" : "border-red-85"]: !this.hasHighlight,
|
|
92
73
|
[this.error === "" ? "border-neutral-35" : "border-red-65"]: this.hasHighlight,
|
|
93
|
-
["
|
|
94
|
-
["text-neutral-20"]: !this.isDisabled,
|
|
95
|
-
["cursor-not-allowed"]: this.isReadonly,
|
|
74
|
+
["border-neutral-60"]: this.isDisabled,
|
|
96
75
|
["h-[40px] w-[40px]"]: this.size === "medium",
|
|
97
76
|
["h-[32px] w-[32px]"]: this.size === "small",
|
|
98
77
|
["h-[28px] w-[28px]"]: this.size === "x-small",
|
|
@@ -108,16 +87,18 @@ exports.LuksoCheckbox = class LuksoCheckbox extends shared_tailwindElement_index
|
|
|
108
87
|
return shared_tailwindElement_index.x`
|
|
109
88
|
<input
|
|
110
89
|
name=${this.name}
|
|
111
|
-
?checked=${this.
|
|
90
|
+
?checked=${this.checked ? "checked" : void 0}
|
|
112
91
|
type="checkbox"
|
|
113
92
|
class=${index.customClassMap({
|
|
114
|
-
[this.defaultInputStyles]: true
|
|
93
|
+
[this.defaultInputStyles]: true,
|
|
94
|
+
["text-neutral-60"]: this.isDisabled
|
|
115
95
|
})}
|
|
116
96
|
ref=${this.ref}
|
|
117
97
|
id=${id}
|
|
118
98
|
data-testid=${this.name ? `input-${this.name}` : "input"}
|
|
119
99
|
?disabled=${this.isDisabled ? true : void 0}
|
|
120
|
-
|
|
100
|
+
?readonly=${this.isReadonly ? true : void 0}
|
|
101
|
+
@change=${!this.isReadonly ? this.handleChange : "return false;"}
|
|
121
102
|
/>
|
|
122
103
|
`;
|
|
123
104
|
}
|
|
@@ -135,61 +116,18 @@ exports.LuksoCheckbox = class LuksoCheckbox extends shared_tailwindElement_index
|
|
|
135
116
|
[this.defaultLabelStyles]: true,
|
|
136
117
|
["paragraph-inter-16-regular"]: this.size === "medium" || this.size === "small",
|
|
137
118
|
["paragraph-inter-12-semi-bold"]: this.size === "x-small",
|
|
138
|
-
["text-red-65"]: this.error !== ""
|
|
119
|
+
["text-red-65"]: this.error !== "",
|
|
120
|
+
["text-neutral-60"]: this.isDisabled
|
|
139
121
|
})}
|
|
140
|
-
>${this.label}</span
|
|
141
122
|
>
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
profileTemplate() {
|
|
145
|
-
let size;
|
|
146
|
-
switch (this.size) {
|
|
147
|
-
case "medium":
|
|
148
|
-
size = "small";
|
|
149
|
-
break;
|
|
150
|
-
case "small":
|
|
151
|
-
case "x-small":
|
|
152
|
-
default:
|
|
153
|
-
size = "x-small";
|
|
154
|
-
break;
|
|
155
|
-
}
|
|
156
|
-
return shared_tailwindElement_index.x`
|
|
157
|
-
<lukso-profile
|
|
158
|
-
class="ml-2"
|
|
159
|
-
profile-url=${this.profileUrl}
|
|
160
|
-
profile-address=${this.profileAddress}
|
|
161
|
-
has-identicon=${this.hasIdenticon}
|
|
162
|
-
size=${size}
|
|
163
|
-
></lukso-profile>
|
|
164
|
-
`;
|
|
165
|
-
}
|
|
166
|
-
usernameTemplate() {
|
|
167
|
-
let size;
|
|
168
|
-
switch (this.size) {
|
|
169
|
-
case "medium":
|
|
170
|
-
size = "large";
|
|
171
|
-
break;
|
|
172
|
-
case "small":
|
|
173
|
-
size = "small";
|
|
174
|
-
break;
|
|
175
|
-
case "x-small":
|
|
176
|
-
default:
|
|
177
|
-
size = "x-small";
|
|
178
|
-
break;
|
|
179
|
-
}
|
|
180
|
-
return shared_tailwindElement_index.x`
|
|
181
|
-
<lukso-username
|
|
182
|
-
class="ml-2"
|
|
183
|
-
name=${this.upUsername}
|
|
184
|
-
address=${this.upAddress}
|
|
185
|
-
size=${size}
|
|
186
|
-
></lukso-username>
|
|
123
|
+
<slot></slot>
|
|
124
|
+
</span>
|
|
187
125
|
`;
|
|
188
126
|
}
|
|
189
127
|
profileUsernameTemplate() {
|
|
190
128
|
return shared_tailwindElement_index.x`
|
|
191
|
-
<div class="flex items-center">
|
|
192
|
-
|
|
129
|
+
<div class="flex items-center text-neutral-20 gap-2 justify-center">
|
|
130
|
+
<slot></slot>
|
|
193
131
|
</div>
|
|
194
132
|
`;
|
|
195
133
|
}
|
|
@@ -198,28 +136,34 @@ exports.LuksoCheckbox = class LuksoCheckbox extends shared_tailwindElement_index
|
|
|
198
136
|
<div>
|
|
199
137
|
<label
|
|
200
138
|
for=${this.name}
|
|
201
|
-
class=${
|
|
139
|
+
class=${index.customClassMap({
|
|
140
|
+
[this.defaultContainerStyles]: true,
|
|
141
|
+
["cursor-not-allowed"]: this.isDisabled || this.isReadonly
|
|
142
|
+
})}
|
|
202
143
|
@mouseenter=${this.handleMouseOver}
|
|
203
144
|
@mouseleave=${this.handleMouseOut}
|
|
204
145
|
>
|
|
205
146
|
${this.inputTemplate()} ${this.checkboxTemplate()}
|
|
206
|
-
${this.type === "text" ? this.labelTemplate() :
|
|
147
|
+
${this.type === "text" ? this.labelTemplate() : shared_tailwindElement_index.A}
|
|
148
|
+
${this.type === "profile" ? this.profileUsernameTemplate() : shared_tailwindElement_index.A}
|
|
207
149
|
</label>
|
|
208
150
|
</div>
|
|
209
151
|
`;
|
|
210
152
|
}
|
|
211
153
|
handleChange(event) {
|
|
212
154
|
const target = event.target;
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
155
|
+
this.checked = target.checked;
|
|
156
|
+
this.dispatchEvent(
|
|
157
|
+
new CustomEvent("on-change", {
|
|
158
|
+
detail: {
|
|
159
|
+
value: target.value,
|
|
160
|
+
checked: target.checked,
|
|
161
|
+
event
|
|
162
|
+
},
|
|
163
|
+
bubbles: true,
|
|
164
|
+
composed: true
|
|
165
|
+
})
|
|
166
|
+
);
|
|
223
167
|
}
|
|
224
168
|
handleMouseOver() {
|
|
225
169
|
if (!this.isReadonly && !this.isDisabled) {
|
|
@@ -235,9 +179,6 @@ exports.LuksoCheckbox = class LuksoCheckbox extends shared_tailwindElement_index
|
|
|
235
179
|
__decorateClass([
|
|
236
180
|
directive.e({ type: String })
|
|
237
181
|
], exports.LuksoCheckbox.prototype, "name", 2);
|
|
238
|
-
__decorateClass([
|
|
239
|
-
directive.e({ type: String })
|
|
240
|
-
], exports.LuksoCheckbox.prototype, "label", 2);
|
|
241
182
|
__decorateClass([
|
|
242
183
|
directive.e({ type: String })
|
|
243
184
|
], exports.LuksoCheckbox.prototype, "id", 2);
|
|
@@ -254,20 +195,8 @@ __decorateClass([
|
|
|
254
195
|
directive.e({ type: String })
|
|
255
196
|
], exports.LuksoCheckbox.prototype, "error", 2);
|
|
256
197
|
__decorateClass([
|
|
257
|
-
directive.e({ type:
|
|
258
|
-
], exports.LuksoCheckbox.prototype, "
|
|
259
|
-
__decorateClass([
|
|
260
|
-
directive.e({ type: String, attribute: "profile-address" })
|
|
261
|
-
], exports.LuksoCheckbox.prototype, "profileAddress", 2);
|
|
262
|
-
__decorateClass([
|
|
263
|
-
directive.e({ type: Boolean, attribute: "has-identicon" })
|
|
264
|
-
], exports.LuksoCheckbox.prototype, "hasIdenticon", 2);
|
|
265
|
-
__decorateClass([
|
|
266
|
-
directive.e({ type: String, attribute: "up-username" })
|
|
267
|
-
], exports.LuksoCheckbox.prototype, "upUsername", 2);
|
|
268
|
-
__decorateClass([
|
|
269
|
-
directive.e({ type: String, attribute: "up-address" })
|
|
270
|
-
], exports.LuksoCheckbox.prototype, "upAddress", 2);
|
|
198
|
+
directive.e({ type: Boolean })
|
|
199
|
+
], exports.LuksoCheckbox.prototype, "checked", 2);
|
|
271
200
|
__decorateClass([
|
|
272
201
|
directive.e({ type: String, attribute: "custom-class" })
|
|
273
202
|
], exports.LuksoCheckbox.prototype, "customClass", 2);
|
|
@@ -277,15 +206,9 @@ __decorateClass([
|
|
|
277
206
|
__decorateClass([
|
|
278
207
|
directive.e({ type: Boolean, attribute: "is-disabled" })
|
|
279
208
|
], exports.LuksoCheckbox.prototype, "isDisabled", 2);
|
|
280
|
-
__decorateClass([
|
|
281
|
-
directive.e({ type: Boolean, attribute: "is-checked" })
|
|
282
|
-
], exports.LuksoCheckbox.prototype, "isChecked", 2);
|
|
283
209
|
__decorateClass([
|
|
284
210
|
state.t()
|
|
285
211
|
], exports.LuksoCheckbox.prototype, "hasFocus", 2);
|
|
286
|
-
__decorateClass([
|
|
287
|
-
state.t()
|
|
288
|
-
], exports.LuksoCheckbox.prototype, "hasChecked", 2);
|
|
289
212
|
__decorateClass([
|
|
290
213
|
state.t()
|
|
291
214
|
], exports.LuksoCheckbox.prototype, "hasHighlight", 2);
|
|
@@ -3,37 +3,26 @@ export type CheckboxSize = 'x-small' | 'small' | 'medium';
|
|
|
3
3
|
export type CheckboxType = 'text' | 'profile';
|
|
4
4
|
export declare class LuksoCheckbox extends TailwindElement {
|
|
5
5
|
name: string;
|
|
6
|
-
label: string;
|
|
7
6
|
id: string;
|
|
8
7
|
ref: string | undefined;
|
|
9
8
|
type: CheckboxType;
|
|
10
9
|
size: CheckboxSize;
|
|
11
10
|
error: string;
|
|
12
|
-
|
|
13
|
-
profileAddress: string;
|
|
14
|
-
hasIdenticon: boolean;
|
|
15
|
-
upUsername: string;
|
|
16
|
-
upAddress: string;
|
|
11
|
+
checked: boolean;
|
|
17
12
|
customClass: string;
|
|
18
13
|
isReadonly: boolean;
|
|
19
14
|
isDisabled: boolean;
|
|
20
|
-
isChecked: boolean;
|
|
21
15
|
private hasFocus;
|
|
22
|
-
private hasChecked;
|
|
23
16
|
private hasHighlight;
|
|
24
17
|
private defaultContainerStyles;
|
|
25
18
|
private defaultInputStyles;
|
|
26
19
|
private defaultLabelStyles;
|
|
27
20
|
private defaultCheckboxStyles;
|
|
28
|
-
connectedCallback(): void;
|
|
29
|
-
attributeChangedCallback(name: string, _old: string | null, value: string | null): void;
|
|
30
21
|
checkedIconTemplate(): unknown;
|
|
31
22
|
checkboxTemplate(): unknown;
|
|
32
23
|
inputTemplate(): import("lit").TemplateResult<1>;
|
|
33
24
|
errorTemplate(): import("lit").TemplateResult<1>;
|
|
34
25
|
labelTemplate(): import("lit").TemplateResult<1>;
|
|
35
|
-
profileTemplate(): import("lit").TemplateResult<1>;
|
|
36
|
-
usernameTemplate(): import("lit").TemplateResult<1>;
|
|
37
26
|
profileUsernameTemplate(): import("lit").TemplateResult<1>;
|
|
38
27
|
render(): import("lit").TemplateResult<1>;
|
|
39
28
|
private handleChange;
|