@lukso/web-components 1.68.1 → 1.70.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 -3
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +4 -3
- 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 +54 -43
- package/dist/components/lukso-card/index.d.ts +1 -1
- package/dist/components/lukso-card/index.d.ts.map +1 -1
- package/dist/components/lukso-card/index.js +54 -43
- package/dist/components/lukso-checkbox/index.cjs +1 -1
- package/dist/components/lukso-checkbox/index.js +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-image/index.cjs +127 -0
- package/dist/components/lukso-image/index.d.ts +20 -0
- package/dist/components/lukso-image/index.d.ts.map +1 -0
- package/dist/components/lukso-image/index.js +125 -0
- package/dist/components/lukso-image/lukso-image.stories.d.ts +14 -0
- package/dist/components/lukso-image/lukso-image.stories.d.ts.map +1 -0
- package/dist/components/lukso-input/index.cjs +1 -1
- package/dist/components/lukso-input/index.js +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 +3 -3
- package/dist/components/lukso-navbar/index.js +3 -3
- package/dist/components/lukso-profile/index.cjs +103 -74
- package/dist/components/lukso-profile/index.d.ts +2 -11
- package/dist/components/lukso-profile/index.d.ts.map +1 -1
- package/dist/components/lukso-profile/index.js +103 -74
- package/dist/components/lukso-profile/lukso-profile.stories.d.ts +3 -1
- package/dist/components/lukso-profile/lukso-profile.stories.d.ts.map +1 -1
- package/dist/components/lukso-progress/index.cjs +2 -2
- package/dist/components/lukso-progress/index.js +2 -2
- package/dist/components/lukso-sanitize/index.cjs +1 -1
- package/dist/components/lukso-sanitize/index.js +1 -1
- package/dist/components/lukso-search/index.cjs +5 -3
- package/dist/components/lukso-search/index.js +5 -3
- package/dist/components/lukso-select/index.cjs +4 -3
- package/dist/components/lukso-select/index.js +4 -3
- 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-tooltip/index.cjs +2 -2
- package/dist/components/lukso-tooltip/index.js +2 -2
- package/dist/components/lukso-username/index.cjs +2 -2
- package/dist/components/lukso-username/index.js +2 -2
- package/dist/components/lukso-wizard/index.cjs +1 -1
- package/dist/components/lukso-wizard/index.js +1 -1
- package/dist/index-5e074b8e.cjs +46 -0
- package/dist/{index-0e131d65.cjs → index-733d3158.cjs} +1 -1
- package/dist/index-a68aad08.js +39 -0
- package/dist/{index-f171e7da.js → index-b434231b.js} +1 -1
- package/dist/index.cjs +8 -3
- package/dist/index.js +4 -3
- package/dist/shared/tailwind-element/index.cjs +1 -1
- package/dist/shared/tailwind-element/index.js +1 -1
- package/dist/{style-map-21f59b89.js → style-map-43a6ddb8.js} +1 -1
- package/dist/{style-map-7d4ddea1.cjs → style-map-6443acae.cjs} +1 -1
- package/package.json +6 -1
- package/tools/assets/images/token-default.svg +27 -0
- package/dist/index-5cc4a839.cjs +0 -46
- package/dist/index-814bcac2.js +0 -39
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
|
|
5
|
+
const shared_tailwindElement_index = require('../../index-5e074b8e.cjs');
|
|
6
|
+
const queryAssignedElements = require('../../query-assigned-elements-1d5d9d4c.cjs');
|
|
7
|
+
const state = require('../../state-f73a8b4f.cjs');
|
|
8
|
+
const styleMap = require('../../style-map-6443acae.cjs');
|
|
9
|
+
const index = require('../../index-66211c85.cjs');
|
|
10
|
+
require('../../directive-8278ab14.cjs');
|
|
11
|
+
|
|
12
|
+
var __defProp = Object.defineProperty;
|
|
13
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
14
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
15
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
16
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
17
|
+
if (decorator = decorators[i])
|
|
18
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
19
|
+
if (kind && result)
|
|
20
|
+
__defProp(target, key, result);
|
|
21
|
+
return result;
|
|
22
|
+
};
|
|
23
|
+
exports.LuksoImage = class LuksoImage extends shared_tailwindElement_index.TailwindElement {
|
|
24
|
+
constructor() {
|
|
25
|
+
super(...arguments);
|
|
26
|
+
this.src = "";
|
|
27
|
+
this.placeholder = "";
|
|
28
|
+
this.isLoading = true;
|
|
29
|
+
this.resolvedPlaceholder = "";
|
|
30
|
+
this.hasError = false;
|
|
31
|
+
this.imageStyles = index.ie({
|
|
32
|
+
slots: {
|
|
33
|
+
wrapper: "bg-[50%] bg-no-repeat bg-cover bg-neutral-90 relative size-full",
|
|
34
|
+
image: "object-cover opacity-0 size-full"
|
|
35
|
+
},
|
|
36
|
+
variants: {
|
|
37
|
+
isLoading: {
|
|
38
|
+
true: {}
|
|
39
|
+
},
|
|
40
|
+
hasError: {
|
|
41
|
+
true: {}
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
compoundVariants: [
|
|
45
|
+
{
|
|
46
|
+
isLoading: false,
|
|
47
|
+
hasError: false,
|
|
48
|
+
class: {
|
|
49
|
+
image: "animate-fade-in animation-fill-forwards"
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
isLoading: true,
|
|
54
|
+
hasError: false,
|
|
55
|
+
class: {
|
|
56
|
+
wrapper: "animate-pulse"
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
isLoading: false,
|
|
61
|
+
hasError: true,
|
|
62
|
+
class: {
|
|
63
|
+
image: "opacity-0"
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
]
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
handleLoad() {
|
|
70
|
+
this.isLoading = false;
|
|
71
|
+
this.hasError = false;
|
|
72
|
+
}
|
|
73
|
+
handleError() {
|
|
74
|
+
this.isLoading = false;
|
|
75
|
+
this.hasError = true;
|
|
76
|
+
}
|
|
77
|
+
async willUpdate(changedProperties) {
|
|
78
|
+
if (changedProperties.has("hasError")) {
|
|
79
|
+
if (this.hasError) {
|
|
80
|
+
this.resolvedPlaceholder = this.placeholder;
|
|
81
|
+
} else {
|
|
82
|
+
this.resolvedPlaceholder = "";
|
|
83
|
+
}
|
|
84
|
+
await this.updateComplete;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
render() {
|
|
88
|
+
const { wrapper, image } = this.imageStyles({
|
|
89
|
+
isLoading: this.isLoading,
|
|
90
|
+
hasError: this.hasError
|
|
91
|
+
});
|
|
92
|
+
return shared_tailwindElement_index.x`
|
|
93
|
+
<div
|
|
94
|
+
class=${wrapper()}
|
|
95
|
+
style=${styleMap.o({
|
|
96
|
+
backgroundImage: `url('${this.resolvedPlaceholder}')`
|
|
97
|
+
})}
|
|
98
|
+
>
|
|
99
|
+
<img
|
|
100
|
+
src=${this.src}
|
|
101
|
+
class=${image()}
|
|
102
|
+
loading="lazy"
|
|
103
|
+
@load=${this.handleLoad}
|
|
104
|
+
@error=${this.handleError}
|
|
105
|
+
/>
|
|
106
|
+
</div>
|
|
107
|
+
`;
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
__decorateClass([
|
|
111
|
+
queryAssignedElements.n({ type: String })
|
|
112
|
+
], exports.LuksoImage.prototype, "src", 2);
|
|
113
|
+
__decorateClass([
|
|
114
|
+
queryAssignedElements.n({ type: String })
|
|
115
|
+
], exports.LuksoImage.prototype, "placeholder", 2);
|
|
116
|
+
__decorateClass([
|
|
117
|
+
state.t()
|
|
118
|
+
], exports.LuksoImage.prototype, "isLoading", 2);
|
|
119
|
+
__decorateClass([
|
|
120
|
+
state.t()
|
|
121
|
+
], exports.LuksoImage.prototype, "resolvedPlaceholder", 2);
|
|
122
|
+
__decorateClass([
|
|
123
|
+
state.t()
|
|
124
|
+
], exports.LuksoImage.prototype, "hasError", 2);
|
|
125
|
+
exports.LuksoImage = __decorateClass([
|
|
126
|
+
queryAssignedElements.e("lukso-image")
|
|
127
|
+
], exports.LuksoImage);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type PropertyValues } from 'lit';
|
|
2
|
+
import { TailwindElement } from '../../shared/tailwind-element';
|
|
3
|
+
export declare class LuksoImage extends TailwindElement {
|
|
4
|
+
src: string;
|
|
5
|
+
placeholder: string;
|
|
6
|
+
isLoading: boolean;
|
|
7
|
+
resolvedPlaceholder: string;
|
|
8
|
+
hasError: boolean;
|
|
9
|
+
private handleLoad;
|
|
10
|
+
private handleError;
|
|
11
|
+
willUpdate(changedProperties: PropertyValues<this>): Promise<void>;
|
|
12
|
+
private imageStyles;
|
|
13
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
14
|
+
}
|
|
15
|
+
declare global {
|
|
16
|
+
interface HTMLElementTagNameMap {
|
|
17
|
+
'lukso-image': LuksoImage;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/lukso-image/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAQ,MAAM,KAAK,CAAA;AAK/C,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAE3D,qBACa,UAAW,SAAQ,eAAe;IAE7C,GAAG,SAAK;IAGR,WAAW,SAAK;IAGhB,SAAS,UAAO;IAGhB,mBAAmB,SAAK;IAGxB,QAAQ,UAAQ;IAEhB,OAAO,CAAC,UAAU;IAKlB,OAAO,CAAC,WAAW;IAKb,UAAU,CAAC,iBAAiB,EAAE,cAAc,CAAC,IAAI,CAAC;IAYxD,OAAO,CAAC,WAAW,CAqCjB;IAEF,MAAM;CAuBP;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,aAAa,EAAE,UAAU,CAAA;KAC1B;CACF"}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { a as TailwindElement, x } from '../../index-a68aad08.js';
|
|
2
|
+
import { n, e } from '../../query-assigned-elements-5d94572f.js';
|
|
3
|
+
import { t } from '../../state-0a779257.js';
|
|
4
|
+
import { o } from '../../style-map-43a6ddb8.js';
|
|
5
|
+
import { i as ie } from '../../index-faa8c4ae.js';
|
|
6
|
+
import '../../directive-2bb7789e.js';
|
|
7
|
+
|
|
8
|
+
var __defProp = Object.defineProperty;
|
|
9
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
10
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
11
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
12
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
13
|
+
if (decorator = decorators[i])
|
|
14
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
15
|
+
if (kind && result)
|
|
16
|
+
__defProp(target, key, result);
|
|
17
|
+
return result;
|
|
18
|
+
};
|
|
19
|
+
let LuksoImage = class extends TailwindElement {
|
|
20
|
+
constructor() {
|
|
21
|
+
super(...arguments);
|
|
22
|
+
this.src = "";
|
|
23
|
+
this.placeholder = "";
|
|
24
|
+
this.isLoading = true;
|
|
25
|
+
this.resolvedPlaceholder = "";
|
|
26
|
+
this.hasError = false;
|
|
27
|
+
this.imageStyles = ie({
|
|
28
|
+
slots: {
|
|
29
|
+
wrapper: "bg-[50%] bg-no-repeat bg-cover bg-neutral-90 relative size-full",
|
|
30
|
+
image: "object-cover opacity-0 size-full"
|
|
31
|
+
},
|
|
32
|
+
variants: {
|
|
33
|
+
isLoading: {
|
|
34
|
+
true: {}
|
|
35
|
+
},
|
|
36
|
+
hasError: {
|
|
37
|
+
true: {}
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
compoundVariants: [
|
|
41
|
+
{
|
|
42
|
+
isLoading: false,
|
|
43
|
+
hasError: false,
|
|
44
|
+
class: {
|
|
45
|
+
image: "animate-fade-in animation-fill-forwards"
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
isLoading: true,
|
|
50
|
+
hasError: false,
|
|
51
|
+
class: {
|
|
52
|
+
wrapper: "animate-pulse"
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
isLoading: false,
|
|
57
|
+
hasError: true,
|
|
58
|
+
class: {
|
|
59
|
+
image: "opacity-0"
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
]
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
handleLoad() {
|
|
66
|
+
this.isLoading = false;
|
|
67
|
+
this.hasError = false;
|
|
68
|
+
}
|
|
69
|
+
handleError() {
|
|
70
|
+
this.isLoading = false;
|
|
71
|
+
this.hasError = true;
|
|
72
|
+
}
|
|
73
|
+
async willUpdate(changedProperties) {
|
|
74
|
+
if (changedProperties.has("hasError")) {
|
|
75
|
+
if (this.hasError) {
|
|
76
|
+
this.resolvedPlaceholder = this.placeholder;
|
|
77
|
+
} else {
|
|
78
|
+
this.resolvedPlaceholder = "";
|
|
79
|
+
}
|
|
80
|
+
await this.updateComplete;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
render() {
|
|
84
|
+
const { wrapper, image } = this.imageStyles({
|
|
85
|
+
isLoading: this.isLoading,
|
|
86
|
+
hasError: this.hasError
|
|
87
|
+
});
|
|
88
|
+
return x`
|
|
89
|
+
<div
|
|
90
|
+
class=${wrapper()}
|
|
91
|
+
style=${o({
|
|
92
|
+
backgroundImage: `url('${this.resolvedPlaceholder}')`
|
|
93
|
+
})}
|
|
94
|
+
>
|
|
95
|
+
<img
|
|
96
|
+
src=${this.src}
|
|
97
|
+
class=${image()}
|
|
98
|
+
loading="lazy"
|
|
99
|
+
@load=${this.handleLoad}
|
|
100
|
+
@error=${this.handleError}
|
|
101
|
+
/>
|
|
102
|
+
</div>
|
|
103
|
+
`;
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
__decorateClass([
|
|
107
|
+
n({ type: String })
|
|
108
|
+
], LuksoImage.prototype, "src", 2);
|
|
109
|
+
__decorateClass([
|
|
110
|
+
n({ type: String })
|
|
111
|
+
], LuksoImage.prototype, "placeholder", 2);
|
|
112
|
+
__decorateClass([
|
|
113
|
+
t()
|
|
114
|
+
], LuksoImage.prototype, "isLoading", 2);
|
|
115
|
+
__decorateClass([
|
|
116
|
+
t()
|
|
117
|
+
], LuksoImage.prototype, "resolvedPlaceholder", 2);
|
|
118
|
+
__decorateClass([
|
|
119
|
+
t()
|
|
120
|
+
], LuksoImage.prototype, "hasError", 2);
|
|
121
|
+
LuksoImage = __decorateClass([
|
|
122
|
+
e("lukso-image")
|
|
123
|
+
], LuksoImage);
|
|
124
|
+
|
|
125
|
+
export { LuksoImage };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Meta } from '@storybook/web-components';
|
|
2
|
+
/**
|
|
3
|
+
* Documentation and examples of `lukso-image` component. This is very primitive component that main goal is to
|
|
4
|
+
* handle error/loading states and provide ability to customize placeholder image.
|
|
5
|
+
*/
|
|
6
|
+
declare const meta: Meta;
|
|
7
|
+
export default meta;
|
|
8
|
+
/** Example of image with fixed size.*/
|
|
9
|
+
export declare const DefaultImage: any;
|
|
10
|
+
/** Example of image with rounded corners.*/
|
|
11
|
+
export declare const RoundedCorners: any;
|
|
12
|
+
/** Example of image with custom placeholder.*/
|
|
13
|
+
export declare const CustomPlaceholder: any;
|
|
14
|
+
//# sourceMappingURL=lukso-image.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lukso-image.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/lukso-image/lukso-image.stories.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAA;AAErD,OAAO,SAAS,CAAA;AAEhB;;;GAGG;AACH,QAAA,MAAM,IAAI,EAAE,IA+BX,CAAA;AAED,eAAe,IAAI,CAAA;AAWnB,uCAAuC;AACvC,eAAO,MAAM,YAAY,KAA2B,CAAA;AAKpD,4CAA4C;AAC5C,eAAO,MAAM,cAAc,KAA2B,CAAA;AAKtD,+CAA+C;AAC/C,eAAO,MAAM,iBAAiB,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-5e074b8e.cjs');
|
|
6
6
|
const queryAssignedElements = require('../../query-assigned-elements-1d5d9d4c.cjs');
|
|
7
7
|
const state = require('../../state-f73a8b4f.cjs');
|
|
8
8
|
const index = require('../../index-e9668573.cjs');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as TailwindElement, x, A } from '../../index-
|
|
1
|
+
import { a as TailwindElement, x, A } from '../../index-a68aad08.js';
|
|
2
2
|
import { n, e } from '../../query-assigned-elements-5d94572f.js';
|
|
3
3
|
import { t } from '../../state-0a779257.js';
|
|
4
4
|
import { c as customClassMap } from '../../index-5e194caf.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-5e074b8e.cjs');
|
|
6
6
|
const queryAssignedElements = require('../../query-assigned-elements-1d5d9d4c.cjs');
|
|
7
7
|
const index = require('../../index-e9668573.cjs');
|
|
8
8
|
require('../../directive-8278ab14.cjs');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as TailwindElement, x } from '../../index-
|
|
1
|
+
import { a as TailwindElement, x } from '../../index-a68aad08.js';
|
|
2
2
|
import { n, e } from '../../query-assigned-elements-5d94572f.js';
|
|
3
3
|
import { c as customClassMap } from '../../index-5e194caf.js';
|
|
4
4
|
import '../../directive-2bb7789e.js';
|
|
@@ -2,15 +2,15 @@
|
|
|
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-5e074b8e.cjs');
|
|
6
6
|
const queryAssignedElements = require('../../query-assigned-elements-1d5d9d4c.cjs');
|
|
7
7
|
const state = require('../../state-f73a8b4f.cjs');
|
|
8
8
|
const index = require('../../index-66211c85.cjs');
|
|
9
9
|
require('../lukso-icon/index.cjs');
|
|
10
10
|
require('../lukso-tag/index.cjs');
|
|
11
|
-
require('../../style-map-
|
|
11
|
+
require('../../style-map-6443acae.cjs');
|
|
12
12
|
require('../../directive-8278ab14.cjs');
|
|
13
|
-
require('../../index-
|
|
13
|
+
require('../../index-733d3158.cjs');
|
|
14
14
|
|
|
15
15
|
var __defProp = Object.defineProperty;
|
|
16
16
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { a as TailwindElement, x, A } from '../../index-
|
|
1
|
+
import { a as TailwindElement, x, A } from '../../index-a68aad08.js';
|
|
2
2
|
import { n, e } from '../../query-assigned-elements-5d94572f.js';
|
|
3
3
|
import { t } from '../../state-0a779257.js';
|
|
4
4
|
import { i as ie } from '../../index-faa8c4ae.js';
|
|
5
5
|
import '../lukso-icon/index.js';
|
|
6
6
|
import '../lukso-tag/index.js';
|
|
7
|
-
import '../../style-map-
|
|
7
|
+
import '../../style-map-43a6ddb8.js';
|
|
8
8
|
import '../../directive-2bb7789e.js';
|
|
9
|
-
import '../../index-
|
|
9
|
+
import '../../index-b434231b.js';
|
|
10
10
|
|
|
11
11
|
var __defProp = Object.defineProperty;
|
|
12
12
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -2,10 +2,12 @@
|
|
|
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-5e074b8e.cjs');
|
|
6
6
|
const queryAssignedElements = require('../../query-assigned-elements-1d5d9d4c.cjs');
|
|
7
|
-
const
|
|
8
|
-
|
|
7
|
+
const index = require('../../index-66211c85.cjs');
|
|
8
|
+
require('../lukso-image/index.cjs');
|
|
9
|
+
require('../../state-f73a8b4f.cjs');
|
|
10
|
+
require('../../style-map-6443acae.cjs');
|
|
9
11
|
require('../../directive-8278ab14.cjs');
|
|
10
12
|
|
|
11
13
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
@@ -468,85 +470,109 @@ exports.LuksoProfile = class LuksoProfile extends shared_tailwindElement_index.T
|
|
|
468
470
|
this.hasIdenticon = false;
|
|
469
471
|
this.size = "large";
|
|
470
472
|
this.isSquare = false;
|
|
471
|
-
this.
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
473
|
+
this.placeholder = "/assets/images/profile-default.svg";
|
|
474
|
+
this.profileStyles = index.ie({
|
|
475
|
+
slots: {
|
|
476
|
+
wrapper: "outline outline-2 outline-neutral-100 relative",
|
|
477
|
+
profile: "overflow-hidden",
|
|
478
|
+
identicon: "absolute shadow-shadow-1xl rounded-full outline outline-neutral-100 right-0 bottom-0"
|
|
476
479
|
},
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
480
|
+
variants: {
|
|
481
|
+
isSquare: {
|
|
482
|
+
false: {
|
|
483
|
+
wrapper: "rounded-full",
|
|
484
|
+
profile: "rounded-full"
|
|
485
|
+
}
|
|
486
|
+
},
|
|
487
|
+
size: {
|
|
488
|
+
"x-small": {
|
|
489
|
+
wrapper: "w-6 h-6",
|
|
490
|
+
profile: "w-6 h-6",
|
|
491
|
+
identicon: "w-3 h-3 outline-1"
|
|
492
|
+
},
|
|
493
|
+
small: {
|
|
494
|
+
wrapper: "w-10 h-10",
|
|
495
|
+
profile: "w-10 h-10",
|
|
496
|
+
identicon: "w-4 h-4 outline-2"
|
|
497
|
+
},
|
|
498
|
+
medium: {
|
|
499
|
+
wrapper: "w-14 h-14",
|
|
500
|
+
profile: "w-14 h-14",
|
|
501
|
+
identicon: "w-5 h-5 outline-2"
|
|
502
|
+
},
|
|
503
|
+
large: {
|
|
504
|
+
wrapper: "w-20 h-20",
|
|
505
|
+
profile: "w-20 h-20",
|
|
506
|
+
identicon: "w-6 h-6 outline-2"
|
|
507
|
+
},
|
|
508
|
+
"x-large": {
|
|
509
|
+
wrapper: "w-24 h-24",
|
|
510
|
+
profile: "w-24 h-24",
|
|
511
|
+
identicon: "w-7 h-7 outline-2"
|
|
512
|
+
}
|
|
513
|
+
}
|
|
481
514
|
},
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
515
|
+
compoundVariants: [
|
|
516
|
+
{
|
|
517
|
+
isSquare: true,
|
|
518
|
+
size: "x-small",
|
|
519
|
+
class: {
|
|
520
|
+
wrapper: "rounded-[2px]",
|
|
521
|
+
profile: "rounded-[2px]"
|
|
522
|
+
}
|
|
523
|
+
},
|
|
524
|
+
{
|
|
525
|
+
isSquare: true,
|
|
526
|
+
size: "small",
|
|
527
|
+
class: {
|
|
528
|
+
wrapper: "rounded-4",
|
|
529
|
+
profile: "rounded-4"
|
|
530
|
+
}
|
|
531
|
+
},
|
|
532
|
+
{
|
|
533
|
+
isSquare: true,
|
|
534
|
+
size: "medium",
|
|
535
|
+
class: {
|
|
536
|
+
wrapper: "rounded-8",
|
|
537
|
+
profile: "rounded-8"
|
|
538
|
+
}
|
|
539
|
+
},
|
|
540
|
+
{
|
|
541
|
+
isSquare: true,
|
|
542
|
+
size: "large",
|
|
543
|
+
class: {
|
|
544
|
+
wrapper: "rounded-[10px]",
|
|
545
|
+
profile: "rounded-[10px]"
|
|
546
|
+
}
|
|
547
|
+
},
|
|
548
|
+
{
|
|
549
|
+
isSquare: true,
|
|
550
|
+
size: "x-large",
|
|
551
|
+
class: {
|
|
552
|
+
wrapper: "rounded-12",
|
|
553
|
+
profile: "rounded-12"
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
]
|
|
557
|
+
});
|
|
508
558
|
}
|
|
509
559
|
identicon() {
|
|
510
|
-
return this.hasIdenticon && this.profileAddress
|
|
560
|
+
return this.hasIdenticon && this.profileAddress ? makeBlockie(this.profileAddress) : "";
|
|
511
561
|
}
|
|
512
562
|
render() {
|
|
563
|
+
const { wrapper, profile, identicon } = this.profileStyles({
|
|
564
|
+
size: this.size,
|
|
565
|
+
isSquare: this.isSquare
|
|
566
|
+
});
|
|
513
567
|
return shared_tailwindElement_index.x`
|
|
514
|
-
<div
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
borderRadius: `${this.isSquare ? this.squareRoundingSize() + "px" : "50%"}`
|
|
521
|
-
})}
|
|
522
|
-
class="bg-[50%] bg-no-repeat bg-cover bg-neutral-90
|
|
523
|
-
outline outline-2 outline-neutral-100"
|
|
524
|
-
>
|
|
525
|
-
<div
|
|
526
|
-
style=${styleMap.o({
|
|
527
|
-
backgroundImage: `url('${this.profileUrl}')`,
|
|
528
|
-
width: `${this.profileImageSize()}px`,
|
|
529
|
-
height: `${this.profileImageSize()}px`,
|
|
530
|
-
borderRadius: `${this.isSquare ? this.squareRoundingSize() + "px" : "50%"}`
|
|
531
|
-
})}
|
|
532
|
-
class="bg-[50%] bg-no-repeat bg-cover relative
|
|
533
|
-
"
|
|
534
|
-
>
|
|
535
|
-
${this.identicon() ? shared_tailwindElement_index.x`<img
|
|
536
|
-
src=${this.identicon()}
|
|
537
|
-
class="absolute shadow-shadow-1xl rounded-full
|
|
538
|
-
outline outline-neutral-100 right-0 bottom-0 ${index.customClassMap(
|
|
539
|
-
{
|
|
540
|
-
"outline-2": this.identiconSize() >= 16,
|
|
541
|
-
"outline-1": this.identiconSize() < 16
|
|
542
|
-
}
|
|
543
|
-
)}"
|
|
544
|
-
style=${styleMap.o({
|
|
545
|
-
width: `${this.identiconSize()}px`,
|
|
546
|
-
height: `${this.identiconSize()}px`
|
|
547
|
-
})}
|
|
548
|
-
/>` : ""}
|
|
568
|
+
<div data-testid="profile" class=${wrapper()}>
|
|
569
|
+
<div class=${profile()}>
|
|
570
|
+
<lukso-image
|
|
571
|
+
src=${this.profileUrl}
|
|
572
|
+
placeholder=${this.placeholder}
|
|
573
|
+
></lukso-image>
|
|
549
574
|
</div>
|
|
575
|
+
${this.identicon() ? shared_tailwindElement_index.x`<img src=${this.identicon()} class=${identicon()} />` : ""}
|
|
550
576
|
</div>
|
|
551
577
|
`;
|
|
552
578
|
}
|
|
@@ -566,6 +592,9 @@ __decorateClass([
|
|
|
566
592
|
__decorateClass([
|
|
567
593
|
queryAssignedElements.n({ type: Boolean, attribute: "is-square" })
|
|
568
594
|
], exports.LuksoProfile.prototype, "isSquare", 2);
|
|
595
|
+
__decorateClass([
|
|
596
|
+
queryAssignedElements.n({ type: String })
|
|
597
|
+
], exports.LuksoProfile.prototype, "placeholder", 2);
|
|
569
598
|
exports.LuksoProfile = __decorateClass([
|
|
570
599
|
queryAssignedElements.e("lukso-profile")
|
|
571
600
|
], exports.LuksoProfile);
|
|
@@ -1,22 +1,14 @@
|
|
|
1
1
|
import { TailwindElement } from '../../shared/tailwind-element';
|
|
2
2
|
export type ProfileSize = 'x-small' | 'small' | 'medium' | 'large' | 'x-large';
|
|
3
|
-
type SizeDef = {
|
|
4
|
-
identiconSize: number;
|
|
5
|
-
profileImageSize: number;
|
|
6
|
-
squareRounding: number;
|
|
7
|
-
};
|
|
8
3
|
export declare class LuksoProfile extends TailwindElement {
|
|
9
4
|
profileUrl: string;
|
|
10
5
|
profileAddress: string;
|
|
11
6
|
hasIdenticon: boolean;
|
|
12
7
|
size: ProfileSize;
|
|
13
8
|
isSquare: boolean;
|
|
14
|
-
|
|
15
|
-
private profileImageSize;
|
|
16
|
-
private identiconSize;
|
|
17
|
-
private squareRoundingSize;
|
|
18
|
-
private defaultProfileUrl;
|
|
9
|
+
placeholder: string;
|
|
19
10
|
private identicon;
|
|
11
|
+
private profileStyles;
|
|
20
12
|
render(): import("lit-html").TemplateResult<1>;
|
|
21
13
|
}
|
|
22
14
|
declare global {
|
|
@@ -24,5 +16,4 @@ declare global {
|
|
|
24
16
|
'lukso-profile': LuksoProfile;
|
|
25
17
|
}
|
|
26
18
|
}
|
|
27
|
-
export {};
|
|
28
19
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/lukso-profile/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/lukso-profile/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAC3D,OAAO,0BAA0B,CAAA;AAEjC,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,SAAS,CAAA;AAE9E,qBACa,YAAa,SAAQ,eAAe;IAE/C,UAAU,SAAK;IAGf,cAAc,SAAK;IAGnB,YAAY,UAAQ;IAGpB,IAAI,EAAE,WAAW,CAAU;IAG3B,QAAQ,UAAQ;IAGhB,WAAW,SAAuC;IAElD,OAAO,CAAC,SAAS;IAMjB,OAAO,CAAC,aAAa,CAoFnB;IAEF,MAAM;CAoBP;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,eAAe,EAAE,YAAY,CAAA;KAC9B;CACF"}
|