@lukso/web-components 1.65.0 → 1.66.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/lukso-navbar/index.cjs +1 -1
- package/dist/components/lukso-navbar/index.js +1 -1
- package/dist/components/lukso-tag/index.cjs +45 -29
- package/dist/components/lukso-tag/index.d.ts +3 -5
- package/dist/components/lukso-tag/index.d.ts.map +1 -1
- package/dist/components/lukso-tag/index.js +45 -29
- package/dist/components/lukso-tag/lukso-tag.stories.d.ts +2 -2
- package/dist/components/lukso-tag/lukso-tag.stories.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -10,7 +10,7 @@ require('../lukso-icon/index.cjs');
|
|
|
10
10
|
require('../lukso-tag/index.cjs');
|
|
11
11
|
require('../../style-map-c86dd6e2.cjs');
|
|
12
12
|
require('../../directive-8278ab14.cjs');
|
|
13
|
-
require('../../index-
|
|
13
|
+
require('../../index-98e8e0d5.cjs');
|
|
14
14
|
|
|
15
15
|
var __defProp = Object.defineProperty;
|
|
16
16
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -6,7 +6,7 @@ import '../lukso-icon/index.js';
|
|
|
6
6
|
import '../lukso-tag/index.js';
|
|
7
7
|
import '../../style-map-9fdda015.js';
|
|
8
8
|
import '../../directive-2bb7789e.js';
|
|
9
|
-
import '../../index-
|
|
9
|
+
import '../../index-1765cfe1.js';
|
|
10
10
|
|
|
11
11
|
var __defProp = Object.defineProperty;
|
|
12
12
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -4,8 +4,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
4
4
|
|
|
5
5
|
const shared_tailwindElement_index = require('../../index-688c3040.cjs');
|
|
6
6
|
const queryAssignedElements = require('../../query-assigned-elements-1d5d9d4c.cjs');
|
|
7
|
-
const
|
|
8
|
-
const index = require('../../index-
|
|
7
|
+
const index = require('../../index-e8741080.cjs');
|
|
8
|
+
const index$1 = require('../../index-98e8e0d5.cjs');
|
|
9
9
|
require('../../directive-8278ab14.cjs');
|
|
10
10
|
|
|
11
11
|
const style = ":host {\n display: inline-flex\n}";
|
|
@@ -27,42 +27,55 @@ exports.LuksoTag = class LuksoTag extends shared_tailwindElement_index.TailwindS
|
|
|
27
27
|
this.size = "small";
|
|
28
28
|
this.isRounded = false;
|
|
29
29
|
this.backgroundColor = "";
|
|
30
|
+
this.borderColor = "";
|
|
30
31
|
this.textColor = "";
|
|
31
|
-
this.
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
this.tagStyles = index.se({
|
|
33
|
+
base: "inline-flex items-center justify-center border border-neutral-20 text-neutral-20 px-2",
|
|
34
|
+
variants: {
|
|
35
|
+
size: {
|
|
36
|
+
"x-small": "font-inter text-8 font-500 leading-20 h-[20px] px-1 rounded-4",
|
|
37
|
+
small: "paragraph-inter-12-medium h-[28px] px-2 rounded-8",
|
|
38
|
+
large: "paragraph-inter-14-medium h-[34px] px-4 rounded-8"
|
|
39
|
+
},
|
|
40
|
+
isRounded: {
|
|
41
|
+
true: "rounded-[56px]"
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
compoundVariants: [
|
|
45
|
+
{
|
|
46
|
+
size: "small",
|
|
47
|
+
isRounded: true,
|
|
48
|
+
class: "px-3"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
size: "x-small",
|
|
52
|
+
isRounded: true,
|
|
53
|
+
class: "px-2"
|
|
54
|
+
}
|
|
55
|
+
]
|
|
56
|
+
});
|
|
35
57
|
}
|
|
36
|
-
|
|
37
|
-
if (this.
|
|
38
|
-
return
|
|
58
|
+
resolveBorderColor() {
|
|
59
|
+
if (this.borderColor) {
|
|
60
|
+
return this.borderColor;
|
|
39
61
|
}
|
|
40
|
-
if (this.
|
|
41
|
-
return
|
|
62
|
+
if (this.backgroundColor) {
|
|
63
|
+
return this.backgroundColor;
|
|
42
64
|
}
|
|
43
|
-
if (this.size === "large") {
|
|
44
|
-
return "px-4";
|
|
45
|
-
}
|
|
46
|
-
return "px-2";
|
|
47
65
|
}
|
|
48
66
|
render() {
|
|
67
|
+
const tagStyles = this.tagStyles({
|
|
68
|
+
size: this.size,
|
|
69
|
+
isRounded: this.isRounded
|
|
70
|
+
});
|
|
49
71
|
return shared_tailwindElement_index.x`
|
|
50
72
|
<div
|
|
51
73
|
data-testid="tag"
|
|
52
|
-
class=${
|
|
53
|
-
|
|
54
|
-
[this.
|
|
55
|
-
[
|
|
56
|
-
[
|
|
57
|
-
["rounded-4"]: !this.isRounded && this.size === "x-small",
|
|
58
|
-
[this.extraSmallStyles]: this.size === "x-small",
|
|
59
|
-
[this.smallStyles]: this.size === "small",
|
|
60
|
-
[this.largeStyles]: this.size === "large"
|
|
61
|
-
})}
|
|
62
|
-
style=${styleMap.o({
|
|
63
|
-
backgroundColor: `var(--${this.backgroundColor})`,
|
|
64
|
-
borderColor: `var(--${this.backgroundColor})`,
|
|
65
|
-
color: `var(--${this.textColor})`
|
|
74
|
+
class=${tagStyles}
|
|
75
|
+
style=${index$1.customStyleMap({
|
|
76
|
+
[`background-color: var(--${this.backgroundColor})`]: !!this.backgroundColor,
|
|
77
|
+
[`border-color: var(--${this.resolveBorderColor()})`]: !!this.resolveBorderColor(),
|
|
78
|
+
[`color: var(--${this.textColor})`]: !!this.textColor
|
|
66
79
|
})}
|
|
67
80
|
>
|
|
68
81
|
<slot></slot>
|
|
@@ -79,6 +92,9 @@ __decorateClass([
|
|
|
79
92
|
__decorateClass([
|
|
80
93
|
queryAssignedElements.n({ type: String, attribute: "background-color" })
|
|
81
94
|
], exports.LuksoTag.prototype, "backgroundColor", 2);
|
|
95
|
+
__decorateClass([
|
|
96
|
+
queryAssignedElements.n({ type: String, attribute: "border-color" })
|
|
97
|
+
], exports.LuksoTag.prototype, "borderColor", 2);
|
|
82
98
|
__decorateClass([
|
|
83
99
|
queryAssignedElements.n({ type: String, attribute: "text-color" })
|
|
84
100
|
], exports.LuksoTag.prototype, "textColor", 2);
|
|
@@ -4,12 +4,10 @@ export declare class LuksoTag extends LuksoTag_base {
|
|
|
4
4
|
size: TagSizes;
|
|
5
5
|
isRounded: boolean;
|
|
6
6
|
backgroundColor: string;
|
|
7
|
+
borderColor: string;
|
|
7
8
|
textColor: string;
|
|
8
|
-
private
|
|
9
|
-
private
|
|
10
|
-
private smallStyles;
|
|
11
|
-
private largeStyles;
|
|
12
|
-
private padding;
|
|
9
|
+
private tagStyles;
|
|
10
|
+
private resolveBorderColor;
|
|
13
11
|
render(): import("lit-html").TemplateResult<1>;
|
|
14
12
|
}
|
|
15
13
|
declare global {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/lukso-tag/index.ts"],"names":[],"mappings":"AAQA,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,OAAO,GAAG,OAAO,CAAA;;AAEpD,qBACa,QAAS,SAAQ,aAA4B;IAExD,IAAI,EAAE,QAAQ,CAAU;IAGxB,SAAS,UAAQ;IAGjB,eAAe,SAAK;IAGpB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/lukso-tag/index.ts"],"names":[],"mappings":"AAQA,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,OAAO,GAAG,OAAO,CAAA;;AAEpD,qBACa,QAAS,SAAQ,aAA4B;IAExD,IAAI,EAAE,QAAQ,CAAU;IAGxB,SAAS,UAAQ;IAGjB,eAAe,SAAK;IAGpB,WAAW,SAAK;IAGhB,SAAS,SAAK;IAEd,OAAO,CAAC,SAAS,CAyBf;IAEF,OAAO,CAAC,kBAAkB;IAU1B,MAAM;CAsBP;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,WAAW,EAAE,QAAQ,CAAA;KACtB;CACF"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { T as TailwindStyledElement, x } from '../../index-3527fb14.js';
|
|
2
2
|
import { n, e } from '../../query-assigned-elements-5d94572f.js';
|
|
3
|
-
import {
|
|
4
|
-
import { c as
|
|
3
|
+
import { s as se } from '../../index-c55a1069.js';
|
|
4
|
+
import { c as customStyleMap } from '../../index-1765cfe1.js';
|
|
5
5
|
import '../../directive-2bb7789e.js';
|
|
6
6
|
|
|
7
7
|
const style = ":host {\n display: inline-flex\n}";
|
|
@@ -23,42 +23,55 @@ let LuksoTag = class extends TailwindStyledElement(style) {
|
|
|
23
23
|
this.size = "small";
|
|
24
24
|
this.isRounded = false;
|
|
25
25
|
this.backgroundColor = "";
|
|
26
|
+
this.borderColor = "";
|
|
26
27
|
this.textColor = "";
|
|
27
|
-
this.
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
this.tagStyles = se({
|
|
29
|
+
base: "inline-flex items-center justify-center border border-neutral-20 text-neutral-20 px-2",
|
|
30
|
+
variants: {
|
|
31
|
+
size: {
|
|
32
|
+
"x-small": "font-inter text-8 font-500 leading-20 h-[20px] px-1 rounded-4",
|
|
33
|
+
small: "paragraph-inter-12-medium h-[28px] px-2 rounded-8",
|
|
34
|
+
large: "paragraph-inter-14-medium h-[34px] px-4 rounded-8"
|
|
35
|
+
},
|
|
36
|
+
isRounded: {
|
|
37
|
+
true: "rounded-[56px]"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
compoundVariants: [
|
|
41
|
+
{
|
|
42
|
+
size: "small",
|
|
43
|
+
isRounded: true,
|
|
44
|
+
class: "px-3"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
size: "x-small",
|
|
48
|
+
isRounded: true,
|
|
49
|
+
class: "px-2"
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
});
|
|
31
53
|
}
|
|
32
|
-
|
|
33
|
-
if (this.
|
|
34
|
-
return
|
|
54
|
+
resolveBorderColor() {
|
|
55
|
+
if (this.borderColor) {
|
|
56
|
+
return this.borderColor;
|
|
35
57
|
}
|
|
36
|
-
if (this.
|
|
37
|
-
return
|
|
58
|
+
if (this.backgroundColor) {
|
|
59
|
+
return this.backgroundColor;
|
|
38
60
|
}
|
|
39
|
-
if (this.size === "large") {
|
|
40
|
-
return "px-4";
|
|
41
|
-
}
|
|
42
|
-
return "px-2";
|
|
43
61
|
}
|
|
44
62
|
render() {
|
|
63
|
+
const tagStyles = this.tagStyles({
|
|
64
|
+
size: this.size,
|
|
65
|
+
isRounded: this.isRounded
|
|
66
|
+
});
|
|
45
67
|
return x`
|
|
46
68
|
<div
|
|
47
69
|
data-testid="tag"
|
|
48
|
-
class=${
|
|
49
|
-
|
|
50
|
-
[this.
|
|
51
|
-
[
|
|
52
|
-
[
|
|
53
|
-
["rounded-4"]: !this.isRounded && this.size === "x-small",
|
|
54
|
-
[this.extraSmallStyles]: this.size === "x-small",
|
|
55
|
-
[this.smallStyles]: this.size === "small",
|
|
56
|
-
[this.largeStyles]: this.size === "large"
|
|
57
|
-
})}
|
|
58
|
-
style=${o({
|
|
59
|
-
backgroundColor: `var(--${this.backgroundColor})`,
|
|
60
|
-
borderColor: `var(--${this.backgroundColor})`,
|
|
61
|
-
color: `var(--${this.textColor})`
|
|
70
|
+
class=${tagStyles}
|
|
71
|
+
style=${customStyleMap({
|
|
72
|
+
[`background-color: var(--${this.backgroundColor})`]: !!this.backgroundColor,
|
|
73
|
+
[`border-color: var(--${this.resolveBorderColor()})`]: !!this.resolveBorderColor(),
|
|
74
|
+
[`color: var(--${this.textColor})`]: !!this.textColor
|
|
62
75
|
})}
|
|
63
76
|
>
|
|
64
77
|
<slot></slot>
|
|
@@ -75,6 +88,9 @@ __decorateClass([
|
|
|
75
88
|
__decorateClass([
|
|
76
89
|
n({ type: String, attribute: "background-color" })
|
|
77
90
|
], LuksoTag.prototype, "backgroundColor", 2);
|
|
91
|
+
__decorateClass([
|
|
92
|
+
n({ type: String, attribute: "border-color" })
|
|
93
|
+
], LuksoTag.prototype, "borderColor", 2);
|
|
78
94
|
__decorateClass([
|
|
79
95
|
n({ type: String, attribute: "text-color" })
|
|
80
96
|
], LuksoTag.prototype, "textColor", 2);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Meta } from '@storybook/web-components';
|
|
1
|
+
import type { Meta } from '@storybook/web-components';
|
|
2
2
|
/** Documentation and examples of `lukso-tag` component. */
|
|
3
3
|
declare const meta: Meta;
|
|
4
4
|
export default meta;
|
|
@@ -10,7 +10,7 @@ export declare const LargeTag: any;
|
|
|
10
10
|
export declare const ExtraSmallTag: any;
|
|
11
11
|
/** You can create "pill" tags when adding `is-rounded` property. */
|
|
12
12
|
export declare const RoundedTag: any;
|
|
13
|
-
/** You can change color of the tag to any from the palette with `text-color` and
|
|
13
|
+
/** You can change color of the tag to any from the palette with `text-color`, `background-color` and 'border-color` property. */
|
|
14
14
|
export declare const CustomColorTag: any;
|
|
15
15
|
/** Tags can have icons inside. Please check `lukso-icon` component for more details about using icons. */
|
|
16
16
|
export declare const IconTag: any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lukso-tag.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/lukso-tag/lukso-tag.stories.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"lukso-tag.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/lukso-tag/lukso-tag.stories.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAA;AAErD,OAAO,SAAS,CAAA;AAChB,OAAO,eAAe,CAAA;AAEtB,4DAA4D;AAC5D,QAAA,MAAM,IAAI,EAAE,IAqFX,CAAA;AAED,eAAe,IAAI,CAAA;AAmBnB,mDAAmD;AACnD,eAAO,MAAM,UAAU,KAAoB,CAAA;AAQ3C,oFAAoF;AACpF,eAAO,MAAM,QAAQ,KAAoB,CAAA;AAYzC,yCAAyC;AACzC,eAAO,MAAM,aAAa,KAAoB,CAAA;AAY9C,oEAAoE;AACpE,eAAO,MAAM,UAAU,KAAoB,CAAA;AAW3C,iIAAiI;AACjI,eAAO,MAAM,cAAc,KAAoB,CAAA;AAa/C,0GAA0G;AAC1G,eAAO,MAAM,OAAO,KAAoB,CAAA"}
|